linux-usb-bfgminer 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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.4-lnx64.tgz from
  68. http://developer.amd.com/sdks/amdappsdk/downloads/pages/default.aspx
  69. ( http://developer.amd.com/Downloads/AMD-APP-SDK-v2.4-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.4-lnx64.tgz
  74. cd AMD-APP-SDK-v2.4-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 Linux BFGMiner
  86. (see the bitcoin forum bfgminer thread for where to get it)
  87. https://bitcointalk.org/index.php?topic=28402.0
  88. ./bfgminer -n
  89. this shows you the GPU's it found on your PC
  90. See further below if you get an error regarding libtinfo.so.5
  91. 14) An OC option:
  92. This is no longer needed since BFGMiner 2.* includes OC, however:
  93. sudo apt-get install libwxbase2.8-0 libwxgtk2.8-0
  94. http://sourceforge.net/projects/amdovdrvctrl/
  95. for an Over/underclocking application and get the file listed below then:
  96. sudo dpkg -i amdoverdrivectrl_1.2.1_amd64.deb
  97. 15) set the screen saver to ONLY blank ...
  98. Move the mouse to the bottom of the screen and you see a set of icons like
  99. on an Apple PC
  100. Click on Settings, then in the Settings window "Screensaver"
  101. Set "Mode:" to "Blank Screen Only"
  102. 16) apt-get install ntpd
  103. An accurate clock is always a good idea :)
  104. 17) if you wish to ssh into the box you must set a password
  105. to do this you simply have to be logged into it at the screen and type
  106. sudo passwd ubuntu
  107. it will prompt you (twice) to enter a password for the ubuntu account
  108. Initial setup complete.
  109. ========
  110. If you want to SSH into the machine and run BFGMiner:
  111. From a terminal on the miner display each time after you boot:
  112. xhost +
  113. 'xhost +' isn't needed if you ssh into the machine with the same
  114. username that the GUI boots into (which is 'ubuntu' in this case)
  115. Then after you ssh into the machine:
  116. export DISPLAY=:0
  117. before running BFGMiner
  118. Also note, that you should force the screen to blank when mining if
  119. the ATI card is displaying the screen (using the screen saver
  120. application menu)
  121. In my case it takes away 50Mh/s when the screen isn't blanked
  122. It will auto blank - but make sure the blank is of course just blank
  123. as mentioned above at 15)
  124. This is of course just the basics ... but it should get you a computer
  125. up and running and able to run BFGMiner
  126. ========
  127. You should keep an eye on USB disk space
  128. The system logger writes log files in the /var/log/ directory
  129. The two main ones that grow large are 'kern.log' and 'syslog'
  130. If you want to keep them, save them away to some other computer
  131. When space is low, just delete them e.g.
  132. sudo rm -i /var/log/syslog
  133. sudo rm -i /var/log/kern.log
  134. The 'df' command will show you the current space e.g.:
  135. sudo df
  136. Filesystem 1K-blocks Used Available Use% Mounted on
  137. aufs 2099420 892024 1100748 45% /
  138. none 1015720 628 1015092 1% /dev
  139. /dev/sda1 3909348 2837248 1072100 73% /cdrom
  140. /dev/loop0 670848 670848 0 100% /rofs
  141. none 1023772 136 1023636 1% /dev/shm
  142. tmpfs 1023772 16 1023756 1% /tmp
  143. none 1023772 124 1023648 1% /var/run
  144. none 1023772 0 1023772 0% /var/lock
  145. This shows the 2GB space allocated when you setup the USB as '/' (aufs)
  146. In this example, it's currently 45% full with almost 1.1GB of free space
  147. ========
  148. The latest version (2.0.8) of BFGMiner is built with 11.10 (not 11.04)
  149. If you get the following error when running the prebuilt version in 11.04:
  150. ./bfgminer: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
  151. The fix is to simply link the old curses library to the new name e.g.:
  152. cd /lib64/
  153. sudo ln -s libncurses.so.5 libtinfo.so.5
  154. ========
  155. If you wish to install to an HDD instead of a USB:
  156. --------------------------------------------------
  157. As per before:
  158. 1) Download the xubuntu 11.04 desktop live CD iso for amd64
  159. ( look here for mirrors: http://www.xubuntu.org/getubuntu )
  160. Then:
  161. 2) Burn it to CD then boot that on your new mining PC
  162. Select "English" then select "Install Xubuntu"
  163. (you have 30 seconds to do this)
  164. 3) When the Install window comes up - again select "English" and click "Forward"
  165. 4) The next page will show you if you meet certain install requirements
  166. (make sure you do meet them all)
  167. Don't select the download option
  168. The 3rd party option isn't needed for mining so ignore that also
  169. Click "Forward"
  170. 5) With "Allocate drive space" it's probably easiest to say to use the
  171. "Erase" option.
  172. This is just for mining right? :)
  173. However, if you have anything on the HDD that you want to keep - the
  174. "Erase" install process will delete it - so back it up (quit the install)
  175. Also make sure there are no OTHER HDD attached that it may erase also
  176. i.e. only have attached the one HDD that you want to install onto unless
  177. you know exactly what you are doing
  178. If you see the "Install Xubuntu 11.04 alongside 'something'" then that
  179. just means that the HDD wasn't blank.
  180. If you want to try this option - do that yourself and then skip to step
  181. 7) below when you get to that.
  182. There are plenty of other options available if you select "Something else"
  183. but I'm not going to go into all the details here other than to say that
  184. my preferred partioning is: /boot = 1GB = ext2, swap = twice memory size,
  185. / = 100GB = ext3 and the rest: /extra = ext3
  186. Click "Forward"
  187. 6) If you selected "Erase" then it allows you to choose the drive to install to
  188. Then click "Install Now"
  189. 7) "Where are you?" sort that out then click "Forward"
  190. 8) "Keyboard layout" sort that out (use the default) then click "Forward"
  191. 9) "Who are you?" The important one here is "Pick a username:" coz that's
  192. the name you will need to ssh into, to access it remotely (and of course
  193. the "Choose a Password" you set)
  194. If you set the "username" to anything but "ubuntu" then: wherever in this
  195. document I have mentioned the username "ubuntu" you must of course use the
  196. username you chose here instead of "ubuntu"
  197. Important: set it to "log in automatically" if you ever want to be able
  198. to start BFGMiner without being in front of the computer since 'X' must
  199. be running to use BFGMiner properly
  200. That does of course mean that the computer isn't secure from anyone who
  201. has access to it - but then again no computer that can automatically
  202. reboot is secure from anyone who has access to the actual computer itself
  203. Then click "Forward"
  204. 10) Of course when it completes click on "Restart Now"
  205. ... and remove the Xubuntu CD when it asks you
  206. 11) Wait for it to finish rebooting ... and it will auto login
  207. (unless you didn't do step 9) "Important:")
  208. 12) After it logs in, an upgrade popup for 11.10 (or later) will appear
  209. Select "Don't Upgrade"
  210. 13) Now go to step 6) of the USB script above for what to do next and that
  211. covers everything else needed