linux-usb-bfgminer 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. How to setup a BFGMiner using Xubuntu 11.04 live on a USB
  2. The master version of this document is here:
  3. https://github.com/luke-jr/bfgminer/blob/master/linux-usb-bfgminer
  4. The original old version on bitcointalk is:
  5. https://bitcointalk.org/index.php?topic=28402.msg426741#msg426741
  6. ========
  7. I have said to select English for the install process for 2 reasons:
  8. 1) I don't know any other spoken language very well
  9. and
  10. 2) I'm not sure what problems installing under a different language
  11. might cause (it will probably cause no problems but I don't know)
  12. Software
  13. ========
  14. Short hardware comment:
  15. Your mining computer doesn't need any HDD or CD/DVD/BD as long as it has at
  16. least 2GB of RAM, can boot USB, has some network connection to the internet
  17. and of course a reasonable mining ATI graphics card
  18. ... Or you can boot a windows PC with the USB to only do mining ... and ignore
  19. the system HDD ... wasting energy running the HDD (roughly 10 Watts per HDD) :)
  20. If you wish to install to an HDD instead of a USB,
  21. see the changes to the instructions at the end
  22. To create the USB, you need of course a 4GB USB and temporarily need a PC
  23. with a CD (or DVD/BD) writer, a USB port and of course an internet
  24. connection to the PC
  25. 1) Download the xubuntu 11.04 desktop live CD iso for amd64
  26. ( look here for mirrors: http://www.xubuntu.org/getubuntu )
  27. 2) Burn it to CD then boot that temporarily on any PC with a CD/DVD/BD and
  28. a USB port (this and the next 2 step won't effect that PC)
  29. Select "English" then select "Try Xubuntu without installing"
  30. and wait for the desktop to appear
  31. (this happens by default if you wait for the timeouts)
  32. 3) Plug in your 4GB USB device and it should appear on the desktop - you can
  33. leave it's contents as long as there is at least 2.8GB free
  34. 4) Now run "Startup Disk Creator" in "Applications->System"
  35. (the system menu is the little rat in the top left corner)
  36. (if you have no mouse you can get the menu with <ctr><esc> and navigate
  37. the menu with the arrow keys and <return> key)
  38. From here select the boot CD as the "Source" and the USB as the "Disk to use"
  39. lastly move the slider to 2GB for reserved extra space
  40. The 2GB should be enough for modifications
  41. Click: "Make Install Disk"
  42. After about 10-15 minutes you have a base xubuntu 11.04 boot USB
  43. (you can shut down this computer now)
  44. 5) Boot your BFGMiner PC with this USB stick, select "English"
  45. then select "Try Xubuntu without installing" and wait for the desktop to
  46. appear (this happens by default if you wait for the timeouts)
  47. 6) Start a terminal
  48. "Applications->Accessories->Terminal Emulator"
  49. 7) sudo apt-get install openssh-server screen
  50. if you have a problem here then it's probably coz the internet isn't
  51. available ... sort that out by reading elsewhere about routers etc
  52. 8) sudo apt-get install fglrx fglrx-amdcccle fglrx-dev
  53. sudo sync
  54. sudo shutdown -r now
  55. N.B. always do a "sudo sync" and wait for it to finish every time before
  56. shutting down the PC to ensure all data is written to the USB
  57. 9) sudo aticonfig --lsa
  58. this lists your ATI cards so you can see them
  59. sudo aticonfig --adapter=all --odgt
  60. this checks it can access all the cards ...
  61. 10) sudo aticonfig --adapter=all --initial
  62. this gets an error - no idea why but the xorg.conf is OK
  63. sudo sync
  64. sudo shutdown -r now
  65. 11) sudo aticonfig --adapter=all --odgt
  66. this checks it can access all the cards ...
  67. 12) get AMD-APP-SDK-v2.8-lnx64.tgz from
  68. http://developer.amd.com/tools/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/
  69. ( http://developer.amd.com/wordpress/media/2012/11/AMD-APP-SDK-v2.8-lnx64.tgz )
  70. sudo su
  71. cd /opt
  72. (replace /home/ubuntu/ with wherever you put the file: )
  73. tar -xvzf /home/ubuntu/AMD-APP-SDK-v2.8-lnx64.tgz
  74. cd AMD-APP-SDK-v2.8-lnx64/
  75. cp -pv lib/x86_64/* /usr/lib/
  76. rsync -avl include/CL/ /usr/include/CL/
  77. tar -xvzf icd-registration.tgz
  78. rsync -avl etc/OpenCL/ /etc/OpenCL/
  79. ldconfig
  80. sync
  81. shutdown -r now
  82. You now have an OpenCL enabled xubuntu
  83. 13) BFGMiner:
  84. sudo apt-get install curl
  85. get the binary Ubuntu BFGMiner from PPA
  86. https://launchpad.net/~unit3/+archive/bfgminer
  87. ./bfgminer -n
  88. this shows you the GPU's it found on your PC
  89. See further below if you get an error regarding libtinfo.so.5
  90. 14) An OC option:
  91. This is no longer needed since BFGMiner 2.* includes OC, however:
  92. sudo apt-get install libwxbase2.8-0 libwxgtk2.8-0
  93. http://sourceforge.net/projects/amdovdrvctrl/
  94. for an Over/underclocking application and get the file listed below then:
  95. sudo dpkg -i amdoverdrivectrl_1.2.1_amd64.deb
  96. 15) set the screen saver to ONLY blank ...
  97. Move the mouse to the bottom of the screen and you see a set of icons like
  98. on an Apple PC
  99. Click on Settings, then in the Settings window "Screensaver"
  100. Set "Mode:" to "Blank Screen Only"
  101. 16) apt-get install ntpd
  102. An accurate clock is always a good idea :)
  103. 17) if you wish to ssh into the box you must set a password
  104. to do this you simply have to be logged into it at the screen and type
  105. sudo passwd ubuntu
  106. it will prompt you (twice) to enter a password for the ubuntu account
  107. Initial setup complete.
  108. ========
  109. If you want to SSH into the machine and run BFGMiner:
  110. From a terminal on the miner display each time after you boot:
  111. xhost +
  112. 'xhost +' isn't needed if you ssh into the machine with the same
  113. username that the GUI boots into (which is 'ubuntu' in this case)
  114. Then after you ssh into the machine:
  115. export DISPLAY=:0
  116. before running BFGMiner
  117. Also note, that you should force the screen to blank when mining if
  118. the ATI card is displaying the screen (using the screen saver
  119. application menu)
  120. In my case it takes away 50Mh/s when the screen isn't blanked
  121. It will auto blank - but make sure the blank is of course just blank
  122. as mentioned above at 15)
  123. This is of course just the basics ... but it should get you a computer
  124. up and running and able to run BFGMiner
  125. ========
  126. You should keep an eye on USB disk space
  127. The system logger writes log files in the /var/log/ directory
  128. The two main ones that grow large are 'kern.log' and 'syslog'
  129. If you want to keep them, save them away to some other computer
  130. When space is low, just delete them e.g.
  131. sudo rm -i /var/log/syslog
  132. sudo rm -i /var/log/kern.log
  133. The 'df' command will show you the current space e.g.:
  134. sudo df
  135. Filesystem 1K-blocks Used Available Use% Mounted on
  136. aufs 2099420 892024 1100748 45% /
  137. none 1015720 628 1015092 1% /dev
  138. /dev/sda1 3909348 2837248 1072100 73% /cdrom
  139. /dev/loop0 670848 670848 0 100% /rofs
  140. none 1023772 136 1023636 1% /dev/shm
  141. tmpfs 1023772 16 1023756 1% /tmp
  142. none 1023772 124 1023648 1% /var/run
  143. none 1023772 0 1023772 0% /var/lock
  144. This shows the 2GB space allocated when you setup the USB as '/' (aufs)
  145. In this example, it's currently 45% full with almost 1.1GB of free space
  146. ========
  147. The latest version (2.0.8) of BFGMiner is built with 11.10 (not 11.04)
  148. If you get the following error when running the prebuilt version in 11.04:
  149. ./bfgminer: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
  150. The fix is to simply link the old curses library to the new name e.g.:
  151. cd /lib64/
  152. sudo ln -s libncurses.so.5 libtinfo.so.5
  153. ========
  154. If you wish to install to an HDD instead of a USB:
  155. --------------------------------------------------
  156. As per before:
  157. 1) Download the xubuntu 11.04 desktop live CD iso for amd64
  158. ( look here for mirrors: http://www.xubuntu.org/getubuntu )
  159. Then:
  160. 2) Burn it to CD then boot that on your new mining PC
  161. Select "English" then select "Install Xubuntu"
  162. (you have 30 seconds to do this)
  163. 3) When the Install window comes up - again select "English" and click "Forward"
  164. 4) The next page will show you if you meet certain install requirements
  165. (make sure you do meet them all)
  166. Don't select the download option
  167. The 3rd party option isn't needed for mining so ignore that also
  168. Click "Forward"
  169. 5) With "Allocate drive space" it's probably easiest to say to use the
  170. "Erase" option.
  171. This is just for mining right? :)
  172. However, if you have anything on the HDD that you want to keep - the
  173. "Erase" install process will delete it - so back it up (quit the install)
  174. Also make sure there are no OTHER HDD attached that it may erase also
  175. i.e. only have attached the one HDD that you want to install onto unless
  176. you know exactly what you are doing
  177. If you see the "Install Xubuntu 11.04 alongside 'something'" then that
  178. just means that the HDD wasn't blank.
  179. If you want to try this option - do that yourself and then skip to step
  180. 7) below when you get to that.
  181. There are plenty of other options available if you select "Something else"
  182. but I'm not going to go into all the details here other than to say that
  183. my preferred partioning is: /boot = 1GB = ext2, swap = twice memory size,
  184. / = 100GB = ext3 and the rest: /extra = ext3
  185. Click "Forward"
  186. 6) If you selected "Erase" then it allows you to choose the drive to install to
  187. Then click "Install Now"
  188. 7) "Where are you?" sort that out then click "Forward"
  189. 8) "Keyboard layout" sort that out (use the default) then click "Forward"
  190. 9) "Who are you?" The important one here is "Pick a username:" coz that's
  191. the name you will need to ssh into, to access it remotely (and of course
  192. the "Choose a Password" you set)
  193. If you set the "username" to anything but "ubuntu" then: wherever in this
  194. document I have mentioned the username "ubuntu" you must of course use the
  195. username you chose here instead of "ubuntu"
  196. Important: set it to "log in automatically" if you ever want to be able
  197. to start BFGMiner without being in front of the computer since 'X' must
  198. be running to use BFGMiner properly
  199. That does of course mean that the computer isn't secure from anyone who
  200. has access to it - but then again no computer that can automatically
  201. reboot is secure from anyone who has access to the actual computer itself
  202. Then click "Forward"
  203. 10) Of course when it completes click on "Restart Now"
  204. ... and remove the Xubuntu CD when it asks you
  205. 11) Wait for it to finish rebooting ... and it will auto login
  206. (unless you didn't do step 9) "Important:")
  207. 12) After it logs in, an upgrade popup for 11.10 (or later) will appear
  208. Select "Don't Upgrade"
  209. 13) Now go to step 6) of the USB script above for what to do next and that
  210. covers everything else needed