Bitcoin Forum
March 19, 2024, 03:17:52 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Newbie guide to setting up headless mining via ssh  (Read 3658 times)
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
January 14, 2012, 08:40:37 PM
 #1

Hi, All.

If you are a newbie, like me, you may have difficulty getting onto a forum to ask about
headless mining. Below you will find my scripts and links to help if, like me you run a
headless server administered via ssh using Debian.
This link/thread should do the heavy lifting to get started, giving most of the setup
and getting running before trying headless access:

https://bitcointalk.org/index.php?topic=3359.0

then create the following scripts. I put these in my ./poclbm directory YMMV:
> ./start1.sh

#!/bin/bash
export DISPLAY=:0
export LD_LIBRARY_PATH=/opt/ati-stream-sdk-v2.1-lnx64/lib/x86_64/:$LD_LIBRARY_PATH
python ~your _home_directory_here/poclbm/poclbm.py -d 1 yr.Uname:yrPwd@127.0.0.1:8332

replace yr.Uname with the user name for your JSON account
replace yr.Pwd with the password for your JSON account

> ./poclbm/start_mining

#!/bin/bash

cd /your_home_directory_here
# create a new screen, detatch then start bitcoin as
# a daemon. It takes a while for the daemon to get fully
# up to speed so be prepared to wait. Checking on bitcoins
# progress via another teminal might be a good idea

/usr/bin/screen -admS Mining  /usr/bin/bitcoind -daemon

# Now wait - start another screen - connect to the GPU
# and connect to the bitcoin server
#screen 1
cd /your_home_directory_here/poclbm
/usr/bin/screen -admS GPU0 ./start1.sh

# if more GPU's are available then add them to these following
#screen 2
#exec ./start2.sh
#screen 3
#exec ./start3.sh
#screen 4
#exec ./start4.sh

Getting the stuff to run can be a bit tricky, and my experience is limited :
# instruction on running headless with X server
# login via ssh
# gdm has to be stopped in /etc/init.d
# x11-common has to be stopped in init.d
# check /tmp - If X is running there will be a lock file there.
# With no X running; run this: $ sudo screen /usr/bin/X 2>1
# or as root : # screen /usr/bin/X 2>1
# then detatch via ctrl-A ctrl-D
# as root check via this # screen -ls
# to list the screens run by root.
# Exit from root and you are in a shell with X running
# export the display $ Display=:0.0 ; export $DISPLAY
# check your cards by running  ./CLInfo |grep CL_DEVICE_TYPE_GPU
# in this directory :
# cd /opt/ati-stream-sdk-v2.1-lnx64/samples/opencl/bin/x86_64
# then run the scripts to bring up bitcoind and put it onto
# the GPU

hth

donate? : tba


1710818272
Hero Member
*
Offline Offline

Posts: 1710818272

View Profile Personal Message (Offline)

Ignore
1710818272
Reply with quote  #2

1710818272
Report to moderator
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1710818272
Hero Member
*
Offline Offline

Posts: 1710818272

View Profile Personal Message (Offline)

Ignore
1710818272
Reply with quote  #2

1710818272
Report to moderator
1710818272
Hero Member
*
Offline Offline

Posts: 1710818272

View Profile Personal Message (Offline)

Ignore
1710818272
Reply with quote  #2

1710818272
Report to moderator
jake262144
Full Member
***
Offline Offline

Activity: 210
Merit: 100


View Profile
January 14, 2012, 08:59:38 PM
 #2

That's one way to skin the cat. Mighty decent of you to start your adventure with these forums by posting a guide.
Quite a few guides have been already posted but the newbies tend to be terrible at using the search function.
Good job!
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
January 15, 2012, 12:24:36 AM
 #3

Shamless bump to get my post count up...
Thanks for the reply, I'm no coder, I just scraped and distilled
the contents of other posts, but it looks better all in the one
place. If anyone has any advice on how to do it better, I'm
happy to learn.

Donate?:  1AYeBLj72r9ahqzCRVLFhrnNcxpH3697gU
jake262144
Full Member
***
Offline Offline

Activity: 210
Merit: 100


View Profile
January 15, 2012, 12:58:15 AM
 #4

I prefer launching the X server, bitcoind, and the miners as system daemons, via init.

That requires creating files in /etc/init.d/ and running update-rc.d1

I like to have it that way because it's a mining rig and:
(1) they are an integral part of this machine's purpose
(2) I like to be able to start/stop/restart them via the standard init commandline, eg. /etc/init.d/x-server restart or /etc/init.d/bcm2 stop

Also, instead of invoking /usr/bin/X directly, I'm invoking /usr/bin/xinit

Notes:
1    You wrote "# gdm has to be stopped in /etc/init.d"
      Please be more specific: # gdm has to be stopped in /etc/init.d by issuing the command update-rc.d gdm3 disable
      The noobs are going to love having been given the proper way of disabling a daemon on a silver platter.
      If you just remove the file or deny it execute rights the next time it is upgraded it might automagically re-enable itself.

2    Obviously, bcm stands for BitCoinMiner in this context


EDIT:: Here, have a BTC-dime. Just don't spend it all at once Smiley
      
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
January 16, 2012, 11:22:46 AM
 #5

 Smiley
Thanks for the hint on update-rc.d
My headless machine wasn't intended as a mining rig, I'm just
using the available MH/sec to do something useful, hence I'm
doing the minimum necessary to get the miner to work. If the
power goes off or something, I'm happy to fix it manually.
 
I use #/etc/init.d.gdm3 stop
to stop the daemon. I figured that if a newbie didn't know
how to work with init.d already, it might be better for them
to RTFM before attempting semi-permanent changes.
jake262144
Full Member
***
Offline Offline

Activity: 210
Merit: 100


View Profile
January 16, 2012, 10:21:34 PM
 #6

... it might be better for them to RTFM before attempting semi-permanent changes.

You're probably right. No panicked linux newbie will have the presence of mind to do a quick check as to how update-rc.d is supposed to be used  Roll Eyes
Better to RTFM and then RTFM some more instead of teasing those vindictive daemons  Grin
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
January 22, 2012, 10:33:24 AM
 #7

Speaking of vindictive daemons ... I installed my new HD7970 and tried to get it to run. Brief summary:
fglrxinfo would not detect the card, aticonfig could not find the card either, and the machine would
occasionally hang on bootup. I'm guessing there may be a power supply issue, but I updated my
software anyway. Along the way, I found other posts suggesting that a downgrade might be the
way to go, but I'll go with the upgrades first ...

https://bitcointalk.org/index.php?topic=7514.600
see post #614 -

some revisions ...
wget http://developer.amd.com/Downloads/AMD-APP-SDK-v2.5-lnx64.tgz
LD_LIBRARY_PATH=/opt/AMDAPP/lib/x86_64/:$LD_LIBRARY_PATH
cd /opt/AMDAPP/samples/opencl/bin/x86_64
wget http://pypi.python.org/packages/source/p/pyopencl/pyopencl-2011.2.tar.gz
tar xvfz pyopencl-2011.2.tar.gz
./configure.py --cl-inc-dir=/opt/AMDAPP/include/ --cl-lib-dir=/opt/AMDAPP/lib/x86_64

I also installed the latest versions of fglrx, but fglrxinfo still would not see the HD7970.
Finally installed fglrx.source and compiled on my machine. That got fglrx to identify
the card. clinfo sees the card, and the miner sees it too, but aticonfig refuses to see it.
Which is weird because GUI stuff on the desktop sees the card and details of internal
settings, clock rates etc.

When I run the miner with the new settings - the HD7970 has bumped the CPU into
second place in the list - it comes up and shows a hash rate of ~ 500MH/sec for
a couple of seconds before giving up with
Verification failed check your hardware.

Soooo .... nearly there




jake262144
Full Member
***
Offline Offline

Activity: 210
Merit: 100


View Profile
January 22, 2012, 11:09:59 AM
 #8

Nearly there.
Just keep in mind that not every mining kernel currently works with 79xx cards.
DiabloMiner is reported to support GCN architecture flawlessly.
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
January 24, 2012, 05:30:14 PM
 #9

Still on the learning curve with the HD7970, waiting for the new Catalyst for linux to appear ...

I found that the card fought with the sound chip during the boot process,
and compiled the linux kernel to drop the sound card. I also disabled the sound
in the BIOS too. lspci still reports this though ...

00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control
01:00.0 VGA compatible controller: ATI Technologies Inc Tahiti XT [Radeon HD 7970]
01:00.1 Audio device: ATI Technologies Inc Device aaa0

but now I'm able to boot without the system hanging halfway through the pci stuff :-)
I tried altering some settings on the motherboard, to no effect, and without aticonfig,
I'm kinda working blind :-(
hmmm maybe a different miner to try (thanks for the hint)

elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
January 25, 2012, 09:17:14 PM
 #10

Found that on the 2.5 SDK poclbm reported the HD7970 as "Lions" ... not good.
Installed the 2.6 SDK and it reported is as Tahiti :-)

No improvemnt in stablity with the 2.6 SDK on poclbm.

Installed the phoenix miner(s) and this runs...
The highest I've seen from the HD7970 is ~550MH/s
Currently I've downgraded to phoenix-1.4 to reduce this
to ~100MH/s until I can get aticonfig to report the card
correctly, and to provide control of fan speeds and
temperatures. 

 
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
February 04, 2012, 08:45:30 PM
 #11

Just updating the thread, noted that the guidance is becoming obsolete, but
because AMD is expected to support the 7970 in Catalyst12.3 or later, this is
still a work in progress and I can only suggest the following:

fglrx-source did not work for me ... :-(
fglrx-12-1 packages proved unreliable, hence downgraded ...
to fglrx-11-12   

now running phoenix-1.7.4 @ 350-450 MH/sec (could do higher but ... )

_when_ I get my 7970 to run stably and fully under control, I will
post updated setup notes
elvizzzzzzz (OP)
Full Member
***
Offline Offline

Activity: 135
Merit: 100


View Profile
April 14, 2012, 07:30:10 PM
 #12

I'd checked out Catalyst-12.1 with no success, and tried and upgrade from 11-12 to running Catalyst 12-3.
Initially things looked good, Aticonfig showed the card correctly, and told me that my card temperature was
97C. I was even able to change the clock settings and drop the M/Hash.

Both poclbm, and phoenix.py segfaulted. Fglrxinfo threw an Oops ... here it is :
fglrxinfo
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 7900 Series
OpenGL version string: 4.2.11566 Compatibility Profile Context


Message from syslogd@ at Apr 14 20:09:42 ...
 kernel:[ 5399.754765] Oops: 0000 [#1] SMP

Message from syslogd@ at Apr 14 20:09:42 ...
 kernel:[ 5399.755058] Stack:

Message from syslogd@ at Apr 14 20:09:42 ...
 kernel:[ 5399.755095] Call Trace:

Message from syslogd@ at Apr 14 20:09:42 ...
 kernel:[ 5399.756008] Code: 4c 8d 64 24 20 c7 44 24 04 00 00 00 00 4c 8d af 80 00 00 00 48 c7 44 24 20 00 00 00 00 48 c7 44$

Message from syslogd@ at Apr 14 20:09:42 ...
 kernel:[ 5399.756008] CR2: 00000000000001c8


#############################################
More to do I guess ...
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!