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: 1288

  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. Pre-stage - Installation Media
  21. Install Xubuntu 12.04
  22. Install AMD Driver on Xubuntu
  23. Config AMD Driver
  24. Install SSH for remote login
  25. Install CGMiner
  26. Further reading
  27. Install Bitcoin 0.6.2 on Xubuntu (optional)
  28. Pre-stage - Installation Media
  29. The first thing you need is a USB to load Xubuntu in (Yap, a USB is still essential to get rid of CD-ROMs).
  30. Then, download Unetbootin to load your Xubuntu CD image on the USB.
  31. Now you’re ready to roll!
  32. Install Xubuntu 12.04
  33. Try follow this article: “The Perfect Desktop - Xubuntu 12.04” until you get a working desktop.
  34. Remember to check “Log in automatically” when you create a superuser.
  35. We’ll need a logged user to mine headlessly.
  36. Oh! You forget to check the option?
  37. That’s all right, you can edit the /etc/lightdm/lightdm.conf like this after installation.
  38. [SeatDefaults]
  39. autologin-guest=false
  40. autologin-user=<your username>
  41. autologin-user-timeout=0
  42. autologin-session=lightdm-autologin
  43. greeter-session=lightdm-gtk-greeter
  44. user-session=xubuntu
  45. Install AMD Driver on Xubuntu
  46. Caution: Choose your driver wisely, or you’ll lose 10% ~ 20% hash power!
  47. [ For AMD Raedon 7xxx Series ]
  48. 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
  49. (I recommend Catalyst 12.3 - which include SDK 2.6).
  50. Reason: 7xxx Series use some kind of new architecture called GCN, which can only be recognized with SDK 2.6+.
  51. Now follow the steps (in commandline):
  52. (Don’t use the GUI (Settings -> Additional drivers) to install the post-release driver. It will fail and I don’t know why.)
  53. sudo apt-get install fglrx-updates fglrx-amdcccle-updates fglrx-updates-dev
  54. Done!
  55. [ For AMD Raedon 6xxx, 5xxx Series ]
  56. 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.
  57. (Recommend Catalyst 11.11)
  58. Reason: Non-7xxx Series with SDK 2.6 will lose about 10% performance.
  59. Now follow the steps.
  60. Install the prerequisite packages:
  61. sudo apt-get install build-essential cdbs dh-make dkms execstack dh-modaliases fakeroot libqtgui4
  62. If you are using the x86_64 architecture (64 bit):
  63. sudo apt-get install ia32-libs-multiarch:i386 lib32gcc1 libc6-i386
  64. sudo apt-get install ia32-libs
  65. Compile and install the driver:
  66. wget http://www2.ati.com/drivers/linux/ati-driver-installer-11-11-x86.x86_64.run
  67. sudo sh ./ati-driver-installer-11-11-x86.x86_64.run --buildpkg Ubuntu/precise
  68. sudo dpkg -i fglrx*.deb
  69. Done!
  70. Config AMD Driver
  71. Check if all your cards can be detected and then write configuration to /etc/X11/xorg.conf.
  72. aticonfig --lsa
  73. sudo aticonfig --adapter=all --initial
  74. If everything went fine, reboot the computer by “sudo reboot”.
  75. After that, check if everything works:
  76. sudo aticonfig --adapter=all --odgt
  77. Install SSH for remote login
  78. Install openssh-server and byobu to perform remote login.
  79. sudo apt-get install openssh-server byobu
  80. Now you can pull out the cables of your monitor, mouse and keyboard and enjoy a headless Xubuntu!
  81. Install CGMiner
  82. Go to CGMINER on bitcointalk page and download the latest version of cgminer.
  83. Or on the command line:
  84. wget http://ck.kolivas.org/apps/cgminer/cgminer-2.9.5-x86_64-built.tar.bz2
  85. Then unzip it to a directory.
  86. tar jxvf cgminer-2.9.5-x86_64-built.tar.bz2
  87. Note: If you got libcurl4 error, install the lib:
  88. sudo apt-get install curl
  89. Go to the directory and check if cgminer detects all your cards.
  90. cd cgminer-2.9.5-x86_64-built
  91. export DISPLAY=:0
  92. export GPU_USE_SYNC_OBJECTS=1
  93. ./cgminer -n
  94. The correct result should show like the left diagram..
  95. Note that both the OpenCL and the ADL detects 4 devices.
  96. Note that the ADL can’t be initialized.
  97. (you forgot to set
  98. export GPU_USE_SYNC_OBJECTS=1)
  99. *
  100. *
  101. Write a script for your favorite mining pool:
  102. Ordinary pool
  103. (like deepbit, BTC Guild, OzCoin, … etc.)
  104. #!/bin/sh
  105. export DISPLAY=:0
  106. export GPU_USE_SYNC_OBJECTS=1
  107. cd /home/<yourhome>/cgminer-2.9.5-x86_64-built
  108. ./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
  109. P2Pool
  110. You can mine at my pool for testing: http://btcm.dyndns.org:9332/
  111. Or try any of the public available p2pool instances.
  112. Remember to replace <username> with your BTC address where the payments are to be sent
  113. #!/bin/sh
  114. export DISPLAY=:0
  115. export GPU_USE_SYNC_OBJECTS=1
  116. cd /home/<yourhome>/cgminer-2.9.5-x86_64-built
  117. ./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
  118. Save it as a file and change the permission to execute it.
  119. nano cg.sh
  120. chmod +x cg.sh
  121. ./cg.sh
  122. You now have a headess bitcoin mining machine! Just SSH to your machine with byobu and execute you script.
  123. byobu
  124. ./cg.sh
  125. You can safely press “F6” and exit since your mining session will be kept in byobu.
  126. -- If you think this article is useful to you, please make a donation to:
  127. 1M1mB5BQX5QthTojfHxXxJQJr8ro5xLcKR
  128. Further reading
  129. P2Pool
  130. If you want to setup a private p2pool:
  131. https://bitcointalk.org/index.php?topic=62842.0
  132. If you don’t waste your time on setting up p2pool, you can test on my p2pool node:
  133. http://btcm.dyndns.org:9332/
  134. username: <Bitcoin Address you want to receive payment>
  135. password: <any letter would be ok>
  136. Exchange
  137. 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.
  138. Liberty Reserve
  139. MTGox
  140. Perfect Money
  141. CryptoXchange
  142. PecUnix
  143. Vouchx
  144. HDMoney
  145. Cosmicpay
  146. C-Gold
  147. SolidTrustPay
  148. http://goo.gl/gJqZS
  149. Install Latest Bitcoind on Xubuntu (optional)
  150. If you want to run bitcoin daemon on your Xubuntu system, open your terminal and install packages by typing the following commands:
  151. sudo apt-get install python-software-properties
  152. sudo add-apt-repository ppa:bitcoin/bitcoin
  153. sudo apt-get install bitcoind
  154. Now you have the latest version of bitcoind installed. Pretty easy, right?
  155. -- If you think this article is useful to you, please make a donation to:
  156. 14qweWDSvLhHuV13YinmNEoGSjtDZbJbgP

comments powered by Disqus