linux-usb-cgminer 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. Software
  11. ========
  12. Short hardware comment:
  13. Your mining computer doesn't need any HDD or CD/DVD/BD as long as it has at
  14. least 2GB of RAM, can boot USB, has some network connection to the internet
  15. and of course a reasonable mining ATI graphics card
  16. ... Or you can boot a windows PC with the USB to only do mining ... and ignore
  17. the system HDD ... wasting energy running the HDD :)
  18. To create the USB, you need of course a 4GB USB and temporarily need a PC
  19. with a CD (or DVD/BD) writer, a USB port and of course an internet
  20. connection to the PC
  21. 1) Download the xubuntu 11.04 desktop live CD iso for amd64
  22. ( look here for mirrors: http://www.xubuntu.org/getubuntu )
  23. 2) Burn it to CD then boot that temporarily on any PC with a CD/DVD/BD and
  24. a USB port (this and the next 2 step won't effect that PC)
  25. 3) Plug in your 4GB USB device and it should appear on the desktop - you can
  26. leave it's contents as long as there is at least 2.8GB free
  27. 4) Now run "Startup Disk Creator" in "Applications->System"
  28. (the system menu is the little rat in the top left corner)
  29. (if you have no mouse you can get the menu with <ctr><esc> and navigate
  30. the menu with the arrow keys and <return> key)
  31. From here select the boot CD as the "Source" and the USB as the "Disk to use"
  32. lastly move the slider to 2GB for reserved extra space
  33. The 2GB should be enough for modifications
  34. Click: "Make Install Disk"
  35. After about 10-15 minutes you have a base xubuntu 11.04 boot USB
  36. (you can shut down this computer now)
  37. 5) Boot your cgminer PC with this USB stick, select "English"
  38. then select "Try Xubuntu without installing" and wait for the desktop to
  39. appear (this happens by default if you wait for the timeouts)
  40. 6) Start a terminal
  41. "Applications->Accessories->Terminal Emulator"
  42. 7) sudo apt-get install openssh-server screen
  43. if you have a problem here then it's probably coz the internet isn't
  44. available ... sort that out by reading elsewhere about routers etc
  45. 8) sudo apt-get install fglrx fglrx-amdcccle fglrx-dev
  46. sudo sync
  47. sudo shutdown -r now
  48. N.B. always do a "sudo sync" and wait for it to finish every time before
  49. shutting down the PC to ensure all data is written to the USB
  50. 9) sudo aticonfig --lsa
  51. this lists your ATI cards so you can see them
  52. sudo aticonfig --adapter=all --odgt
  53. this checks it can access all the cards ...
  54. 10) sudo aticonfig --adapter=all --initial
  55. this gets an error - no idea why but the xorg.conf is OK
  56. sudo sync
  57. sudo shutdown -r now
  58. 11) sudo aticonfig --adapter=all --odgt
  59. this checks it can access all the cards ...
  60. 12) get AMD-APP-SDK-v2.4-lnx64.tgz from
  61. http://developer.amd.com/sdks/amdappsdk/downloads/pages/default.aspx
  62. ( http://developer.amd.com/Downloads/AMD-APP-SDK-v2.4-lnx64.tgz )
  63. sudo su
  64. cd /opt
  65. (replace /home/ubuntu/ with wherever you put the file: )
  66. tar -xvzf /home/ubuntu/AMD-APP-SDK-v2.4-lnx64.tgz
  67. cd AMD-APP-SDK-v2.4-lnx64/
  68. cp -pv lib/x86_64/* /usr/lib/
  69. rsync -avl include/CL/ /usr/include/CL/
  70. tar -xvzf icd-registration.tgz
  71. rsync -avl etc/OpenCL/ /etc/OpenCL/
  72. ldconfig
  73. sync
  74. shutdown -r now
  75. You now have an OpenCL enabled xubuntu
  76. 13) cgminer:
  77. sudo apt-get install curl
  78. get the binary linux cgminer
  79. (see the bitcoin forum cgminer thread for where to get it)
  80. https://bitcointalk.org/index.php?topic=28402.0
  81. ./cgminer -n
  82. this shows you the GPU's it found on your PC
  83. See further below if you get an error regarding libtinfo.so.5
  84. 14) An OC option:
  85. This is no longer needed since cgminer 2.* includes OC, however:
  86. sudo apt-get install libwxbase2.8-0 libwxgtk2.8-0
  87. http://sourceforge.net/projects/amdovdrvctrl/
  88. for an Over/underclocking application and get the file listed below then:
  89. sudo dpkg -i amdoverdrivectrl_1.2.1_amd64.deb
  90. 15) set the screen saver to ONLY blank ...
  91. Move the mouse to the bottom of the screen and you see a set of icons like
  92. on an Apple PC
  93. Click on Settings, then in the Settings window "Screensaver"
  94. Set "Mode:" to "Blank Screen Only"
  95. 16) apt-get install ntpd
  96. An accurate clock is always a good idea :)
  97. 17) if you wish to ssh into the box you must set a password
  98. to do this you simply have to be logged into it at the screen and type
  99. sudo passwd ubuntu
  100. it will prompt you (twice) to enter a password for the ubuntu account
  101. Initial setup complete.
  102. ========
  103. If you want to SSH into the machine and run cgminer:
  104. From a terminal on the miner display each time after you boot:
  105. xhost +
  106. 'xhost +' isn't needed if you ssh into the machine with the same
  107. username that the GUI boots into (which is 'ubuntu' in this case)
  108. Then after you ssh into the machine:
  109. export DISPLAY=:0
  110. before running cgminer
  111. Also note, that you should force the screen to blank when mining if
  112. the ATI card is displaying the screen (using the screen saver
  113. application menu)
  114. In my case it takes away 50Mh/s when the screen isn't blanked
  115. It will auto blank - but make sure the blank is of course just blank
  116. as mentioned above at 15)
  117. This is of course just the basics ... but it should get you a computer
  118. up and running and able to run cgminer
  119. ========
  120. You should keep an eye on USB disk space
  121. The system logger writes log files in the /var/log/ directory
  122. The two main ones that grow large are 'kern.log' and 'syslog'
  123. If you want to keep them, save them away to some other computer
  124. When space is low, just delete them e.g.
  125. sudo rm -i /var/log/syslog
  126. sudo rm -i /var/log/kern.log
  127. The 'df' command will show you the current space e.g.:
  128. sudo df
  129. Filesystem 1K-blocks Used Available Use% Mounted on
  130. aufs 2099420 892024 1100748 45% /
  131. none 1015720 628 1015092 1% /dev
  132. /dev/sda1 3909348 2837248 1072100 73% /cdrom
  133. /dev/loop0 670848 670848 0 100% /rofs
  134. none 1023772 136 1023636 1% /dev/shm
  135. tmpfs 1023772 16 1023756 1% /tmp
  136. none 1023772 124 1023648 1% /var/run
  137. none 1023772 0 1023772 0% /var/lock
  138. This shows the 2GB space allocated when you setup the USB as '/' (aufs)
  139. In this example, it's currently 45% full with almost 1.1GB of free space
  140. ========
  141. The latest version (2.0.8) of cgminer is built with 11.10 (not 11.04)
  142. If you get the following error when running the prebuilt version in 11.04:
  143. ./cgminer: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
  144. The fix is to simply link the old curses library to the new name e.g.:
  145. cd /lib64/
  146. sudo ln -s libncurses.so.5 libtinfo.so.5