linux-usb-cgminer 11 KB

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