Complete Guide to Mining Bitcoin on Xubuntu 12.04


SUBMITTED BY: Guest

DATE: Oct. 24, 2013, 5:35 a.m.

FORMAT: Text only

SIZE: 8.8 kB

HITS: 1060

  1. Complete Guide To Mine Bitcoin on Xubuntu 12.04
  2. -- by Leonard Huang (lueotw@gmail.com)
  3. -- Latest version could be found on http://goo.gl/vP3G9
  4. -- If you think this article is useful to you, please make a donation to:
  5. 1M1mB5BQX5QthTojfHxXxJQJr8ro5xLcKR
  6. Firstly, I’d like to thank Kanoi, who wrote an excellent howto guide on “How to setup a cgminer using xubuntu 11.04 live on a USB”. However, I don’t need to mine on a USB (it’s slow compared to a HDD). Also, his guide didn’t update with the latest version of Xubuntu (12.04), which in my opinion is the easiest version of Xubuntu ever to mine bitcoin with. Although it’s relatively easy, there are still some pitfalls I want to you to avoid, so I wrote this guide.
  7. I had been mining Bitcoin since July, 2011. I had used Windows 7 for mining until May, 2012. The reason I use Windows 7 is as the following:
  8. AMD driver got better support on Windows.
  9. Much more overclock tools on Windows (MSI AfterBurner rocks!).
  10. Less time wasting on trouble shooting.
  11. With (3), I can focus on tweaking the best CPU/MEM clock combination for maximizing profit.
  12. I had tried to switch to a headless Linux solution but failed, due to the following problems:
  13. My machine constantly crashed after operating 3 hours.
  14. The lan port on my motherboard didn’t get support well on Linux at that time(r8169 on a Gigabyte motherboard - buggy driver on Ubuntu 11.04 and 11.10).
  15. I wasted 5 days struggling on troubleshooting linux problems. Not worth it.
  16. I decided to give Xubuntu 12.04 a try, since I’ve heard that 12.04 is not only getting Long-Term-Support, but also fixing various bugs since 11.04 and 11.10.
  17. The result is amazingly great! My machines never crash anymore!
  18. Enough for my experience. Let’s move on.
  19. Table of Content
  20. 
  21. Pre-stage - Installation Media
  22. Install Xubuntu 12.04
  23. Install AMD Driver on Xubuntu
  24. Config AMD Driver
  25. Install SSH for remote login
  26. Install CGMiner
  27. Further reading
  28. Install Bitcoin 0.6.2 on Xubuntu (optional)
  29. Pre-stage - Installation Media
  30. The first thing you need is a USB to load Xubuntu in (Yap, a USB is still essential to get rid of CD-ROMs).
  31. Then, download Unetbootin to load your Xubuntu CD image on the USB.
  32. Now you’re ready to roll!
  33. Install Xubuntu 12.04
  34. Try follow this article: “The Perfect Desktop - Xubuntu 12.04” until you get a working desktop.
  35. Remember to check “Log in automatically” when you create a superuser.
  36. We’ll need a logged user to mine headlessly.
  37. Oh! You forget to check the option?
  38. That’s all right, you can edit the /etc/lightdm/lightdm.conf like this after installation.
  39. [SeatDefaults]
  40. autologin-guest=false
  41. autologin-user=<your username>
  42. autologin-user-timeout=0
  43. autologin-session=lightdm-autologin
  44. greeter-session=lightdm-gtk-greeter
  45. user-session=xubuntu
  46. Install AMD Driver on Xubuntu
  47. Caution: Choose your driver wisely, or you’ll lose 10% ~ 20% hash power!
  48. [ For AMD Raedon 7xxx Series ]
  49. If any of your cards on board is AMD Raedon 7xxx Series cards, you’ll need AMD APP SDK 2.6+, which is included in Catalyst 11.12+ and beyond
  50. (I recommend Catalyst 12.3 - which include SDK 2.6).
  51. Reason: 7xxx Series use some kind of new architecture called GCN, which can only be recognized with SDK 2.6+.
  52. Now follow the steps (in commandline):
  53. (Don’t use the GUI (Settings -> Additional drivers) to install the post-release driver. It will fail and I don’t know why.)
  54. sudo apt-get install fglrx-updates fglrx-amdcccle-updates fglrx-updates-dev
  55. Done!
  56. [ For AMD Raedon 6xxx, 5xxx Series ]
  57. If you don’t have any AMD Raedon 7xxx Series cards (like 6xxx, 5xxx), you should use SDK 2.5, which is included in Catalyst 11.7 ~ 11.11.
  58. (Recommend Catalyst 11.11)
  59. Reason: Non-7xxx Series with SDK 2.6 will lose about 10% performance.
  60. Now follow the steps.
  61. Install the prerequisite packages:
  62. sudo apt-get install build-essential cdbs dh-make dkms execstack dh-modaliases fakeroot libqtgui4
  63. If you are using the x86_64 architecture (64 bit):
  64. sudo apt-get install ia32-libs-multiarch:i386 lib32gcc1 libc6-i386
  65. sudo apt-get install ia32-libs
  66. Compile and install the driver:
  67. wget http://www2.ati.com/drivers/linux/ati-driver-installer-11-11-x86.x86_64.run
  68. sudo sh ./ati-driver-installer-11-11-x86.x86_64.run --buildpkg Ubuntu/precise
  69. sudo dpkg -i fglrx*.deb
  70. Done!
  71. Config AMD Driver
  72. Check if all your cards can be detected and then write configuration to /etc/X11/xorg.conf.
  73. aticonfig --lsa
  74. sudo aticonfig --adapter=all --initial
  75. If everything went fine, reboot the computer by “sudo reboot”.
  76. After that, check if everything works:
  77. sudo aticonfig --adapter=all --odgt
  78. Install SSH for remote login
  79. Install openssh-server and byobu to perform remote login.
  80. sudo apt-get install openssh-server byobu
  81. Now you can pull out the cables of your monitor, mouse and keyboard and enjoy a headless Xubuntu!
  82. Install CGMiner
  83. Go to CGMINER on bitcointalk page and download the latest version of cgminer.
  84. Or on the command line:
  85. wget http://ck.kolivas.org/apps/cgminer/cgminer-2.9.5-x86_64-built.tar.bz2
  86. Then unzip it to a directory.
  87. tar jxvf cgminer-2.9.5-x86_64-built.tar.bz2
  88. Note: If you got libcurl4 error, install the lib:
  89. sudo apt-get install curl
  90. Go to the directory and check if cgminer detects all your cards.
  91. cd cgminer-2.9.5-x86_64-built
  92. export DISPLAY=:0
  93. export GPU_USE_SYNC_OBJECTS=1
  94. ./cgminer -n
  95. The correct result should show like the left diagram..
  96. Note that both the OpenCL and the ADL detects 4 devices.
  97. Note that the ADL can’t be initialized.
  98. (you forgot to set
  99. export GPU_USE_SYNC_OBJECTS=1)
  100. *
  101. *
  102. Write a script for your favorite mining pool:
  103. Ordinary pool
  104. (like deepbit, BTC Guild, OzCoin, … etc.)
  105. #!/bin/sh
  106. export DISPLAY=:0
  107. export GPU_USE_SYNC_OBJECTS=1
  108. cd /home/<yourhome>/cgminer-2.9.5-x86_64-built
  109. ./cgminer -o http://<mining_pool>:<port> -u <username> -p <password> --api-listen --api-network -I 9 --gpu-reorder --auto-fan --gpu-powertune 20 --gpu-engine 920,920,920,1125 --gpu-memclock 795,795,795,975
  110. P2Pool
  111. You can mine at my pool for testing: http://btcm.dyndns.org:9332/
  112. Or try any of the public available p2pool instances.
  113. Remember to replace <username> with your BTC address where the payments are to be sent
  114. #!/bin/sh
  115. export DISPLAY=:0
  116. export GPU_USE_SYNC_OBJECTS=1
  117. cd /home/<yourhome>/cgminer-2.9.5-x86_64-built
  118. ./cgminer -o http://<mining_pool>:<port> -u <username> -p <password> --api-listen --api-network -I 8 -g 2 --gpu-reorder --auto-fan --gpu-powertune 20 --gpu-engine 920,920,920,1125 --gpu-memclock 795,795,795,975
  119. Save it as a file and change the permission to execute it.
  120. nano cg.sh
  121. chmod +x cg.sh
  122. ./cg.sh
  123. You now have a headess bitcoin mining machine! Just SSH to your machine with byobu and execute you script.
  124. byobu
  125. ./cg.sh
  126. You can safely press “F6” and exit since your mining session will be kept in byobu.
  127. -- If you think this article is useful to you, please make a donation to:
  128. 1M1mB5BQX5QthTojfHxXxJQJr8ro5xLcKR
  129. Further reading
  130. P2Pool
  131. If you want to setup a private p2pool:
  132. https://bitcointalk.org/index.php?topic=62842.0
  133. If you don’t waste your time on setting up p2pool, you can test on my p2pool node:
  134. http://btcm.dyndns.org:9332/
  135. username: <Bitcoin Address you want to receive payment>
  136. password: <any letter would be ok>
  137. Exchange
  138. If you want to buy or exchange Bitcoin with the following currency company, you can use my affiliate link of AurumXchange. It is the official partner of Mt. Gox to transfer Bitcoin to LibertyReserve.
  139. Liberty Reserve
  140. MTGox
  141. Perfect Money
  142. CryptoXchange
  143. PecUnix
  144. Vouchx
  145. HDMoney
  146. Cosmicpay
  147. C-Gold
  148. SolidTrustPay
  149. http://goo.gl/gJqZS
  150. Install Latest Bitcoind on Xubuntu (optional)
  151. If you want to run bitcoin daemon on your Xubuntu system, open your terminal and install packages by typing the following commands:
  152. sudo apt-get install python-software-properties
  153. sudo add-apt-repository ppa:bitcoin/bitcoin
  154. sudo apt-get install bitcoind
  155. Now you have the latest version of bitcoind installed. Pretty easy, right?
  156. -- If you think this article is useful to you, please make a donation to:
  157. 14qweWDSvLhHuV13YinmNEoGSjtDZbJbgP

comments powered by Disqus