Bitcoin Forum
April 18, 2014, 09:15:01 PM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2  All
  Print  
Author Topic: Ubuntu 11.04 Natty 64bit Headless Bitcoin mining with ATI 11.5 binary driver  (Read 55145 times)
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 21, 2011, 01:08:18 PM
 #1

Hi Everyone,

I was able to repurpose an existing computer now running headless in text console mode only with two new AMD Radeon HD5830's cards over clocked to 875MHz.  The GPUs are running at a stable 86 degrees Celsius and average 519 Mhash/s between the two HD5830's.

*** Warning this may cause irreparable damage to your computer system, harm yourself and your family, burn down your house, neighborhood and city, generate untold amounts of carbon dioxide at your electric company and harm the polar bears and baby seals in the Arctic Circle.  I am NOT responsible if you try this or for any errors that may exist within this post.

Load a fresh Ubuntu Natty 11.04 64-bit Desktop with the latest updates and log into system with a user that has sudo permissions.
   sudo apt-get remove nvidia-common
   sudo apt-get install libqtgui4

Load python and other development tools
   cd ~
   sudo apt-get install python-setuptools python-numpy subversion g++ libboost-all-dev

Download and install ATI Driver 11.5 for Linux 64bit.
   cd ~
   wget http://www2.ati.com/drivers/linux/ati-driver-installer-11-5-x86.x86_64.run
   sudo sh ati-driver-installer-11-5-x86.x86_64.run --buildpkg Ubuntu/natty
   sudo dpkg -i *.deb
   sudo apt-get -f install
   sudo aticonfig -f --initial --adapter=all
   sudo reboot

Verify that the ATI Driver is setup and running
   cd ~
   DISPLAY=:0 sudo fglrxinfo

Download and install bitcoin
   cd ~
   wget http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.3.21/bitcoin-0.3.21-linux.tar.gz
   tar xzvf bitcoin-0.3.21-linux.tar.gz
   chmod +x bitcoin-0.3.21/bin/64/bitcoin*
   mkdir -p ~/.bitcoin
   echo "rpcuser=user" >> ~/.bitcoin/bitcoin.conf
   echo "rpcpassword=password" >> ~/.bitcoin/bitcoin.conf

Install python-jsonrpc
   cd ~
   svn checkout http://svn.json-rpc.org/trunk/python-jsonrpc
   cd python-jsonrpc/
   sudo python setup.py install

Download and install AMD APP SDK 2.4 for Linux 64bit.
   cd ~
   wget http://download2-developer.amd.com/amd/APPSDK/AMD-APP-SDK-v2.4-lnx64.tgz
   tar xvzf AMD-APP-SDK-v2.4-lnx64.tgz
   echo export AMDAPPSDKROOT=${HOME}/AMD-APP-SDK-v2.4-lnx64/ >> ~/.bashrc
   echo export AMDAPPSDKSAMPLESROOT=${HOME}/AMD-APP-SDK-v2.4-lnx64/ >> ~/.bashrc
   echo 'export LD_LIBRARY_PATH=${AMDAPPSDKROOT}lib/x86_64:${LD_LIBRARY_PATH}' >> ~/.bashrc
   source ~/.bashrc
   cd /
   sudo tar xfz $AMDAPPSDKROOT/icd-registration.tgz

Download, Compile and Install pyopencl-0.92
   cd ~
   wget http://pypi.python.org/packages/source/p/pyopencl/pyopencl-0.92.tar.gz
   tar xzvf pyopencl-0.92.tar.gz
   cd pyopencl-0.92
   ./configure.py --cl-inc-dir=${AMDAPPSDKROOT}include --cl-lib-dir=${AMDAPPSDKROOT}lib/x86_64
   make
   sudo make install

Download and Install Phoenix Miner 1.48
   wget http://svn3.xp-dev.com/svn/phoenix-miner/files/phoenix-1.48.tar.bz2
   tar xvf phoenix*.bz2

Verify that OpenCL is setup and running
   cd ~
   cd AMD-APP-SDK-v2.4-lnx64/bin/x86_64
   ./clinfo

Create a startminer script using code from below.  Make sure to substitute the correct home directory path, miner pool server, miner user and miner password.
   cd ~
   sudo touch /usr/local/bin/startminer.sh
   sudo chmod 755 /usr/local/bin/startminer.sh
   sudo gedit /usr/local/bin/startminer.sh

      # ${1} is used as a variable for the username, password and for the gpu device number.  Ex. mineruser0, minerpass0, Device=0 or mineruser1, minerpass1, Device=1
      HOMEDIR=/home/user
      MINERSERV=btcmine.com:8332
      MINERUSER=mineruser@miner${1}
      MINERPASS=minerpass${1}

      export AMDAPPSDKROOT=${HOMEDIR}/AMD-APP-SDK-v2.4-lnx64/
      export AMDAPPSDKSAMPLESROOT=${HOMEDIR}/AMD-APP-SDK-v2.4-lnx64/
      export LD_LIBRARY_PATH=${AMDAPPSDKROOT}lib/x86_64:${LD_LIBRARY_PATH}

      #Overclock GPU to 875Mhz
      DISPLAY=:0 aticonfig --od-enable --adapter=all
      DISPLAY=:0 aticonfig --od-setclocks=875,1000 --adapter=${1}
      cd ${HOMEDIR}/phoenix-1.48
      echo "Startming Miner: ${1}"
      ${HOMEDIR}/phoenix-1.48/phoenix.py -u http://${MINERUSER}:${MINERPASS}@${MINERSERV} -k phatk VECTORS BFI_INT AGGRESSION=12 DEVICE=${1}


Setup Headless Bitcoin Mining
 *** Warning *** This will stop your computer from booting a graphical desktop and allow only text console or remote ssh access into the mining server.
 If you rely on a GUI for administration you may want to rethink this.

   sudo apt-get install openssh-server
   sudo apt-get install screen
   sudo mv /etc/init/gdm.conf /etc/init/gdm.org
   sudo gedit /etc/init/startx.conf
        description     "Start X Server for btc mining"
        start on runlevel [2345]
        stop on runlevel [!2345]
        kill timeout 30
        script
           exec /usr/bin/X 2>&1
        end script


   sudo gedit /etc/init/btcminer_0.conf
        description     "Start BTC Mining"
        start on runlevel [2345]
        stop on runlevel [!2345]
        kill timeout 30
        script
           LOGINUSER=ChangeToMyLoginUser
          #Wait 30 seconds to make sure X is started.
          sleep 30
          exec /usr/bin/screen -dmS gpu0 su -c '/usr/local/bin/startminer.sh 0' ${LOGINUSER}
        end script


   sudo gedit /etc/init/btcminer_1.conf
        description     "Start BTC Mining"
        start on runlevel [2345]
        stop on runlevel [!2345]
        kill timeout 30
        script
        LOGINUSER=ChangeToMyLoginUser
        #Wait 35 seconds to make sure X is started.
        sleep 35
           exec /usr/bin/screen -dmS gpu1 su -c '/usr/local/bin/startminer.sh 1' ${LOGINUSER}
        end script


How to access the miner server
   ssh into the mining server as your normal login user.
   sudo screen -r gpu0 or sudo screen -r gpu1

To disconnect from screen Control-A + Control-D.

How to check the GPU temperatures

   ssh into mining server as your normal login user.
   DISPLAY=:0 sudo aticonfig --odgt --adapter=all

How to monitor your screens on an Xterminal on the main Xwindows console on boot up.

   sudo gedit /etc/init/btcmonitor_0.conf
        description     "Start BTC Monitor 0"
        start on runlevel [2345]
        stop on runlevel [!2345]
        kill timeout 30
        script
          LOGINUSER=ChangeToMyLoginUser
          export DISPLAY=:0
          #Wait 40 seconds to make sure X is started.
          sleep 40
          exec  /usr/bin/xterm -geometry 80x40+0+0 -e "/usr/bin/screen -d -r gpu0"
        end script

sudo gedit /etc/init/btcmonitor_1.conf
        description     "Start BTC Monitor 1"
        start on runlevel [2345]
        stop on runlevel [!2345]
        kill timeout 30
        script
          LOGINUSER=ChangeToMyLoginUser
          export DISPLAY=:0
          #Wait 45 seconds to make sure X is started.
          sleep 45
          exec  /usr/bin/xterm -geometry 80x40+500+0 -e "/usr/bin/screen -d -r gpu1"
        end script
   


I have compiled this with the help from many sources from around the internet including.

http://sectio-aurea.blogspot.com/2011/05/bitcoin-mining-on-ubuntu-1104-natty.html
http://forum.bitcoin.org/?topic=7514.0

Along with my own 30 years of computer experience and 24 years of Unix and Linux.

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs


- Dukejer

      
1397855701
Hero Member
*
Offline Offline

Posts: 1397855701

View Profile Personal Message (Offline)

Ignore
1397855701
Reply with quote  #2

1397855701
Report to moderator
1397855701
Hero Member
*
Offline Offline

Posts: 1397855701

View Profile Personal Message (Offline)

Ignore
1397855701
Reply with quote  #2

1397855701
Report to moderator
GAWMiners.com - Buy 4 ASIC Miners get ONE FREE!
Limited 24hr Offer Code: BUY4GET1
Mining Made Easy
For Everyone

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1397855701
Hero Member
*
Offline Offline

Posts: 1397855701

View Profile Personal Message (Offline)

Ignore
1397855701
Reply with quote  #2

1397855701
Report to moderator
1397855701
Hero Member
*
Offline Offline

Posts: 1397855701

View Profile Personal Message (Offline)

Ignore
1397855701
Reply with quote  #2

1397855701
Report to moderator
1397855701
Hero Member
*
Offline Offline

Posts: 1397855701

View Profile Personal Message (Offline)

Ignore
1397855701
Reply with quote  #2

1397855701
Report to moderator
1397855701
Hero Member
*
Offline Offline

Posts: 1397855701

View Profile Personal Message (Offline)

Ignore
1397855701
Reply with quote  #2

1397855701
Report to moderator
leepfrog
Member
**
Offline Offline

Activity: 84


View Profile

Ignore
May 21, 2011, 05:22:37 PM
 #2

This is an extremely helpful tutorial and I am looking forward to use it when configuring my rig at the beginning of next week.
Thanks for your effort!

If you find one of my posts useful you have the possibility to express your gratitude here: 1CHjoCfU9R6z5iadGqhed2HdHepmv7NjUE
Syke
Hero Member
*****
Offline Offline

Activity: 1260


View Profile

Ignore
May 22, 2011, 12:27:21 AM
 #3

I have a much simpler setup, but I am mining headless successfully (no monitor, keyboard, or mouse plugged in at all). What I can't do is aticonfig. It complains about X not running. Do I have to hack up the /etc/init scripts to get X running without a monitor plugged in?

Buy & Hold
elrock
Jr. Member
*
Offline Offline

Activity: 41


View Profile

Ignore
May 22, 2011, 12:40:19 AM
 #4

I have a much simpler setup, but I am mining headless successfully (no monitor, keyboard, or mouse plugged in at all). What I can't do is aticonfig. It complains about X not running. Do I have to hack up the /etc/init scripts to get X running without a monitor plugged in?

These three lines worked for me.
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 22, 2011, 12:57:00 AM
 #5

I have a much simpler setup, but I am mining headless successfully (no monitor, keyboard, or mouse plugged in at all). What I can't do is aticonfig. It complains about X not running. Do I have to hack up the /etc/init scripts to get X running without a monitor plugged in?

Hi Syke,

You are able to mine without running X Windows?   I was not able to run atiConfig or mining without X running.  If you want to start X you should be able to do it through a small script in /etc/init or in one of the /etc/rc scripts.  You will need to set the DISPLAY=:0 command if you are remote and also you may need to run sudo aticonfig since X will be owned by root once it starts.

- Dukejer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
Syke
Hero Member
*****
Offline Offline

Activity: 1260


View Profile

Ignore
May 22, 2011, 02:01:06 AM
 #6

Well I guess my problem isn't due to running headless. When I boot with a monitor and see X (Ubuntu Desktop 10.10) up and running, I still can't aticonfig over ssh. The three lines didn't help either.

Buy & Hold
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 22, 2011, 01:57:06 PM
 #7

Well I guess my problem isn't due to running headless. When I boot with a monitor and see X (Ubuntu Desktop 10.10) up and running, I still can't aticonfig over ssh. The three lines didn't help either.

Hi Syke,

Did you try this from ssh?  

DISPLAY=:0 sudo aticonfig --odgt --adapter=all

This is what I use.  You may need to be logged into X for this to work.  If you are still running the desktop try and have gdm autologin your user under the console.  You can set up autologin for Ubuntu under System -> Administration -> Login Screen.



- Dukejer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
lexa500
Jr. Member
*
Offline Offline

Activity: 49


View Profile

Ignore
May 22, 2011, 05:27:58 PM
 #8

Thanks for the manual!
but i have problem with pyopencl. it looks like i have missed some links to the sdk libraries
Code:
/usr/bin/ld: cannot find -lOpenCL
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
make: *** [all] Error 1
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 23, 2011, 12:15:41 PM
 #9

Thanks for the manual!
but i have problem with pyopencl. it looks like i have missed some links to the sdk libraries
Code:
/usr/bin/ld: cannot find -lOpenCL
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
make: *** [all] Error 1

Hi lexa500,

Did you make sure your LD_LIBRARY_PATH is set correctly?  You can check it by echo $LD_LIBRARY_PATH.

Did you see any errors while compiling pyopencl?  You can rerun make and see if any errors show.

Also are you running 32-bit or 64-bit?  The links in my post were for 64-bit.

- Dukejer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
lexa500
Jr. Member
*
Offline Offline

Activity: 49


View Profile

Ignore
May 23, 2011, 01:34:39 PM
 #10

thanks! i`ve found the missing path
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 23, 2011, 02:29:30 PM
 #11

I made one minor change in the overclocking.  I forgot to show how to enable overclocking first in aticonf.
Here are the changes.  If anyone sees any other errors please let me know and I will update the main post.

      #Overclock GPU to 875Mhz
      DISPLAY=:0 aticonfig --od-enable --adapter=all
      DISPLAY=:0 aticonfig --od-setclocks=875,1000 --adapter=${1}

Thank you,

-DukeJer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
leepfrog
Member
**
Offline Offline

Activity: 84


View Profile

Ignore
May 23, 2011, 04:42:42 PM
 #12

thanks! i`ve found the missing path

Could you please explain how? I am still stuck at this error.
The path seems to be fine:

Code:
<user>@miner:~$ echo $LD_LIBRARY_PATH
/home/<user>/AMD-APP-SDK-v2.4-lnx64/lib/x86_64:

Also the folder does contain files:

Code:
<user>@miner:~$ ls /home/<user>/AMD-APP-SDK-v2.4-lnx64/lib/x86_64
libamdocl64.so  libGLEW.so  libglut.so  libOpenCL.so  libOpenCL.so.1

However I am getting the exact same error as you.

Thanks in advance!

If you find one of my posts useful you have the possibility to express your gratitude here: 1CHjoCfU9R6z5iadGqhed2HdHepmv7NjUE
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 23, 2011, 10:03:21 PM
 #13

thanks! i`ve found the missing path

Could you please explain how? I am still stuck at this error.
The path seems to be fine:

Code:
<user>@miner:~$ echo $LD_LIBRARY_PATH
/home/<user>/AMD-APP-SDK-v2.4-lnx64/lib/x86_64:

Also the folder does contain files:

Code:
<user>@miner:~$ ls /home/<user>/AMD-APP-SDK-v2.4-lnx64/lib/x86_64
libamdocl64.so  libGLEW.so  libglut.so  libOpenCL.so  libOpenCL.so.1

However I am getting the exact same error as you.

Thanks in advance!

Hi Leepfrog,

We found some cut and paste errors in my original script when I was writing the post.  Some of the lines with the "--" dash dash symbol were being substituted with a long hyphen instead.  You will probably have to run the following lines below to correct it.

  cd ~
  cd pyopencl-0.92
  rm ./siteconf.py
 ./configure.py --cl-inc-dir=${AMDAPPSDKROOT}include --cl-lib-dir=${AMDAPPSDKROOT}lib/x86_64
   make
   sudo make install

-Dukejer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
leepfrog
Member
**
Offline Offline

Activity: 84


View Profile

Ignore
May 23, 2011, 10:47:02 PM
 #14

Hi dukejer,

thanks for your fast response. Yes I've found those errors (wanted to post about it but they were already fixed).
However the error persisted.
I was able to solve it via this command:

Code:
./configure.py --cl-inc-dir=/home/<user>/AMD-APP-SDK-v2.4-lnx64/include/ --cl-lib-dir=/home/<user>/AMD-APP-SDK-v2.4-lnx64/lib/x86_64

So I suppose that one of the other variables must have caused problems... anyhow - working now!

Just a quick question: Is there a quick to stop or restart the miners once they have been stopped? (besides from going into every screen to ctrl+c and reboot the server to restart again)?

If you find one of my posts useful you have the possibility to express your gratitude here: 1CHjoCfU9R6z5iadGqhed2HdHepmv7NjUE
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 24, 2011, 03:06:33 AM
 #15

Hi dukejer,

thanks for your fast response. Yes I've found those errors (wanted to post about it but they were already fixed).
However the error persisted.
I was able to solve it via this command:

Code:
./configure.py --cl-inc-dir=/home/<user>/AMD-APP-SDK-v2.4-lnx64/include/ --cl-lib-dir=/home/<user>/AMD-APP-SDK-v2.4-lnx64/lib/x86_64

So I suppose that one of the other variables must have caused problems... anyhow - working now!

Just a quick question: Is there a quick to stop or restart the miners once they have been stopped? (besides from going into every screen to ctrl+c and reboot the server to restart again)?

Hi Leepfrog,

You should be able to restart either of the GPUs using the service command for upstart.

sudo service btcminer_0 start
sudo service btcminer_1 start for the 2nd gpu.

- Dukejer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
Zamicol
Jr. Member
*
Offline Offline

Activity: 57



View Profile

Ignore
May 25, 2011, 05:00:36 AM
 #16

Good guide!  I stumbled onto this while looking for screen session help.  I've been scavenging the internet trying to figure this out:

Is there any way to make a simple, purely miner (no overclock) startup script that puts each miner into its own screen?  I've been experimenting with something like:
Code:
#!/bin/sh
screen -d -m -S "gpu0"
screen -d -m -S "gpu1"
screen -p gpu0 -X python pheonix.py -blah -blah
screen -p gpu1 -X python pheonix.py -blah -blah


Thanks!


17rbcNNzwkKLePN8n4gLcYQ2GqR39QGEfU
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 25, 2011, 03:53:59 PM
 #17

Good guide!  I stumbled onto this while looking for screen session help.  I've been scavenging the internet trying to figure this out:

Is there any way to make a simple, purely miner (no overclock) startup script that puts each miner into its own screen?  I've been experimenting with something like:
Code:
#!/bin/sh
screen -d -m -S "gpu0"
screen -d -m -S "gpu1"
screen -p gpu0 -X python pheonix.py -blah -blah
screen -p gpu1 -X python pheonix.py -blah -blah


Thanks!



Hi Zamicol,

I did not have much luck running screen as a normal user since the tty devices are created on demand now with udev even though I put my normal user in the tty group.  I normally run screen using sudo so that the super user will create the devices and then I can connect to the screen instance.  The only problem is that when I want to reconnect I also have to do a sudo screen.   The /usr/local/bin/startminer.sh script  I created in the top post can be ran without overclocking.  You can just leave out the aticonfig lines from the script that are used for overclocking.

     DISPLAY=:0 aticonfig --od-enable --adapter=all
      DISPLAY=:0 aticonfig --od-setclocks=875,1000 --adapter=${1}


You should be able to start the /usr/local/bin/startminer.sh script using the following command:

sudo /usr/bin/screen -dmS gpu0 su -c '/usr/local/bin/startminer.sh 0' YourLogin
or
sudo /usr/bin/screen -dmS gpu0 su -c '/usr/local/bin/startminer.sh 1' YourLogin
for the 2nd gpu.

- DukeJer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 25, 2011, 03:56:29 PM
 #18

Thank you for the donation whoever sent it.  It is nice to see a bitcoin or two from time to time.

-Dukejer
Basiley
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 25, 2011, 03:58:18 PM
 #19

jeez, just stay with Debian sid[this time, codenamed "Wheezy"], if you need power of Debian w/o Ubuntu bugs.
stay away from crippled forks such as "xbuntu" crap, IMO.
dukejer
Jr. Member
*
Offline Offline

Activity: 42


View Profile

Ignore
May 25, 2011, 04:22:57 PM
 #20

jeez, just stay with Debian sid[this time, codenamed "Wheezy"], if you need power of Debian w/o Ubuntu bugs.
stay away from crippled forks such as "xbuntu" crap, IMO.

Hi Basiley,

  I have used every Linux distribution from Yggdrasil, Slackware, Caldera, Redhat, Suse, Gento, Debian, etc.  Ubuntu works fine for me.  Seems polished just enough compared to other distributions I have used in the past.  I think with a little debugging I could fix the udev issues with probably writing a udev script or some other fix but since I already have my rig autostarting in a headless configuration I have not delved into it to much.  Also taking down my rig for a bit feels like I am waisting bitcoins.  Wink

- Dukejer

If you find this post helpful feel free to donate to address: 19oQLN2v1auiGqBDFfxSDUfu8Ax6ooT6xs
Pages: [1] 2  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!