Bitcoin Mining with Ubuntu 12.04 LTS and CGMiner

a guest Oct 9th, 2014 659 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <a href=""><img class="aligncenter size-large wp-image-9523" src="" alt="image012" width="625" height="400" /></a><strong>CGMiner</strong> is a GPU miner written in C, cross platform for Windows, Linux and OS X, based on the original code Cpu Miner, with limited FPGA support merged from BFGMiner. This document should be complete enough to get you started mining Bitcoins using a graphics card.
  3. <!--more-->
  5. <strong>Hardware</strong>
  7. Staging was done on the following hardware:
  8. <ul>
  9.         <li>CPU: <a title="CPU" href="" target="_blank">AMD A6-5400K Trinity 3.6GHz</a></li>
  10.         <li>Motherboard: <a title="Motherboard" href="" target="_blank">GIGABYTE GA-F2A85XM-HD3 FM2 AMD A85X</a></li>
  11.         <li>Graphics Card: <a title="Graphics Card" href="" target="_blank">GIGABYTE GV-R795WF3-3GD Radeon HD 7950 3GB</a></li>
  12.         <li>RAM: <a title="RAM" href="" target="_blank">G.SKILL Ripjaws X Series 16GB (2 x 8GB)</a></li>
  13.         <li>Power: <a title="Power Supply" href=";Tpk=Cooler%20Master%20Extreme%20Power%20Plus%20700W&amp;IsVirtualParent=1" target="_blank">Cooler Master Extreme Power Plus 700W</a></li>
  14.         <li>Hard Drive: A used re-formatted spare 300 GB Sata hard drive I salvaged from another machine</li>
  15. </ul>
  16. <strong>STEP 1: Install Ubuntu 12.04 LTS</strong>
  18. Download and install Ubuntu 12.04 LTS:
  20. <a href="" target="_blank"></a>
  22. <strong>STEP 2: Install proprietary drivers for your graphics card</strong>
  24. With the Radeon HD 7950, Ubuntu automatically suggested proprietary drivers after install. I selected and installed ATI/AMD proprietary FGLRX graphics driver (post-release updates). I avoided the beta drivers.
  26. <strong>STEP 3: Install Ubuntu Updates</strong>
  28. NOTE: I am using the terminal window to run these commands.
  29. <pre>sudo apt-get update</pre>
  30. NOTE: I recommend rebooting again here once updates are complete. Type sudo reboot in the terminal window. After you reboot your system make sure to install synaptic package package manager and check for updates manually with that application too, just to make you have the latest kernel image. Don't install your graphics drivers until there are no more updates available to download or found.
  32. <strong>STEP 4: Install vim</strong>
  33. <pre>sudo apt-get install gedit vim</pre>
  34. <strong>STEP 5: Update grub</strong>
  35. <pre>sudo gedit /etc/default/grub</pre>
  36. In this file, update the following line:
  37. change GRUB_TIMEOUT=10 to GRUB_TIMEOUT=”10″
  38. <pre>sudo update-grub</pre>
  39. <strong>STEP 6: Install other needed packages</strong>
  40. <pre>sudo apt-get install subversion git-core</pre>
  41. <strong>STEP 7: Install ATI OpenCL Drivers</strong>
  43. NOTE: Release 2.8 is current at time of writing this how-to. For more information, visit <a title="ATI OpenCL Drivers" href="" target="_blank"></a>
  44. <pre>mkdir amdapp_2-8
  45. cd amdapp_2-8</pre>
  46. Download the appropriate AMD APP SDK for your machine, i.e. AMD-APP-SDK-v2.8-lnx32.tgz or AMD-APP-SDK-v2.8-lnx64.tgz from here: <a title="Drivers Download" href="" target="_blank"></a>
  47. <pre>tar -zxvf ~/Downloads/AMD-APP-SDK-v2.8-lnx32.tgz</pre>
  48. By default on a new Ubuntu install, your Firefox downloads should be located in ~/Downloads unless you modified your download folder in Firefox preferences.
  49. <pre>sudo ./</pre>
  50. <strong>STEP 8: Reboot again</strong>
  51. <pre>sudo reboot</pre>
  52. <strong>STEP 9: Install cgminer’s prerequisites</strong>
  54. NOTE: At this point, I am using some of the instructions from this post: <a title="Cgminer Install Tutorial" href="" target="_blank"></a>
  55. <pre>sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm</pre>
  56. <strong>STEP 10: Get cgminer</strong>
  57. <pre>git clone git:// cgminer</pre>
  58. <strong>STEP 11: Install ADL SDK 5.0</strong>
  60. NOTE: This will allow cgminer adjustments of such things as your GPU’s clocking, voltage and fan speed.
  62. Special Note: Download ADL_SDK_5.0.ZIP from <a title="ADL SDK 5.0" href="" target="_blank"></a>. You might want to check if 5.0 is still the most current version first, and download whatever is most current. Modify the commands below according to the version you’re going to download.
  63. <pre>mkdir ADL_SDK
  64. cd ADL_SDK
  65. mv ~/Downloads/ .
  66. unzip
  67. cp include/* ~/cgminer/ADL_SDK
  68. cd ~/cgminer
  69. ./</pre>
  70. Special Note: After running the command, you should see a summary similar to this one:
  71. <pre>Configuration Options Summary:
  72. curses.TUI...........: FOUND: -lncurses
  73. OpenCL...............: FOUND. GPU mining support enabled
  74. scrypt...............: Disabled
  75. ADL..................: SDK found, GPU monitoring support enabled
  77. BFL.ASICs............: Disabled
  78. BitForce.FPGAs.......: Disabled
  79. Icarus.FPGAs.........: Disabled
  80. ModMiner.FPGAs.......: Disabled
  81. Ztex.FPGAs...........: Disabled
  83. Compilation............: make (or gmake)
  84. CPPFLAGS.............:
  85. CFLAGS...............: -g -O2
  86. LDFLAGS..............: -lpthread
  87. LDADD................: -ldl -lcurl compat/jansson/libjansson.a -lpthread -L/opt/AMDAPP/lib/x86 -lOpenCL -lm
  88. Installation...........: make install (as root if needed, with 'su' or 'sudo')
  89. prefix...............: /usr/local</pre>
  90. Continue with the next command (it is formatted for a 64 bit Ubuntu environment):
  91. <pre>CFLAGS="-O2 -Wall -march=native -I /opt/AMDAPP/include/" LDFLAGS="-L/opt/AMDAPP/lib/x86_64" ./configure</pre>
  92. Special Note: After running the above command, you should see a summary again, similar to this one:
  93. <pre>Configuration Options Summary:
  94. curses.TUI...........: FOUND: -lncurses
  95. OpenCL...............: FOUND. GPU mining support enabled
  96. scrypt...............: Disabled
  97. ADL..................: SDK found, GPU monitoring support enabled
  99. BFL.ASICs............: Disabled
  100. BitForce.FPGAs.......: Disabled
  101. Icarus.FPGAs.........: Disabled
  102. ModMiner.FPGAs.......: Disabled
  103. Ztex.FPGAs...........: Disabled
  105. Compilation............: make (or gmake)
  106. CPPFLAGS.............:
  107. CFLAGS...............: -O2 -Wall -march=native -I /opt/AMDAPP/include/
  108. LDFLAGS..............: -L/opt/AMDAPP/lib/x86 -lpthread
  109. LDADD................: -ldl -lcurl compat/jansson/libjansson.a -lpthread -L/opt/AMDAPP/lib/x86_64 -lOpenCL -lm
  110. Installation...........: make install (as root if needed, with 'su' or 'sudo')
  111. prefix...............: /usr/local</pre>
  112. Continue with the next command (You are still in Terminal, in your cgminer folder):
  113. <pre>make</pre>
  114. <strong>STEP 12: Testing</strong>
  115. <pre>export DISPLAY=:0
  116. export GPU_USE_SYNC_OBJECTS=1
  117. ./cgminer -n</pre>
  118. On my machine, I have one Radeon HD 7950, so this is the summary I see:
  119. <pre>[2013-03-20 14:35:32] CL Platform 0 vendor: Advanced Micro Devices, Inc.
  120. [2013-03-20 14:35:32] CL Platform 0 name: AMD Accelerated Parallel Processing
  121. [2013-03-20 14:35:32] CL Platform 0 version: OpenCL 1.2 AMD-APP (1113.2)
  122. [2013-03-20 14:35:32] Platform 0 devices: 1
  123. [2013-03-20 14:35:32] 0 Tahiti
  124. [2013-03-20 14:35:32] GPU 0 AMD Radeon HD 7900 Series hardware monitoring enabled
  125. [2013-03-20 14:35:32] 1 GPU devices max detected</pre>
  126. <strong>STEP 13: Run cgminer</strong>
  128. Special Note: There is up-to-date information on cgminer on the <a title="Bitcoin Talk Forum" href="" target="_blank">Bitcoin Talk Forum</a> here: <a title="CGMiner on Bitcoin Talk" href="" target="_blank"></a>.
  130. You will most likely need to join a <a title="What is Pooled Mining?" href="" target="_blank">mining pool</a>. I recommend <a title="AKA Slush" href="" target="_blank">Slush’s pool</a>, but there are several other good ones.
  132. Starting cgminer: Once you’re registered on a mining pool, you can simply run the following basic Terminal command in your cgminer folder:
  133. <pre>cgminer -o http://pool:port -u username -p password</pre>
  134. <ul>
  135.         <li>Where
  136. <pre>http://pool:port</pre>
  137. is the URL the pool requires you point your miner to.</li>
  138.         <li>Where username is the worker username you created on the pool. See your pool’s instructions.</li>
  139.         <li>Where password is the worker password (not your pool account password) you created on the pool. See your pool’s instructions.</li>
  140. </ul>
  141. <strong>STEP 14: Running cgminer with a configuration script</strong>
  143. Once I experimented a bit with cgminer settings, I created a configuration script as shown on <a title="Complete Guide to Mine Bitcoin on Xubuntu 12.04" href="" target="_blank">Complete Guide to Mine Bitcoin on Xubuntu 12.04</a>.
  145. To make your first cgminer configuration script, you simply cut and paste the following into a text document and save it in your cgminer folder as Don’t forget to add your pool credentials.
  146. <pre>#!/bin/sh
  147. export DISPLAY=:0
  148. export GPU_USE_SYNC_OBJECTS=1
  149. cd /home/worker1/cgminer
  150. ./cgminer -o http://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</pre>
  151. Once the file is saved, update it with:
  152. <pre>chmod +x</pre>
  153. Then, start cgminer:
  154. <pre>./</pre>
  155. That’s it. This should get you running. If you have a HD 7950, you might want to tweak the cgminer settings a bit to get more hashing power, adjust the fan speed etc.
  157. See this post: <a title="The 7950 Megahash Thread" href="" target="_blank">The 7950 Megashash Thread</a>.
  159. <strong>References:</strong>
  160. <ul>
  161.         <li><a title="Bitcoin headless miner configuration" href="" target="_blank">Bitcoin headless miner configuration</a></li>
  162.         <li><a title="Complete Guide to Mine Bitcoin on Xubuntu 12.04" href="" target="_blank">Complete Guide to Mine Bitcoin on Xubuntu 12.04</a></li>
  163.         <li><a title="ATI OpenCL Drivers" href="" target="_blank">ATI OpenCL Drivers</a></li>
  164.         <li><a title="CGMiner Installation Tutorial" href="" target="_blank">Cgminer Install Tutorial</a></li>
  165.         <li><a title="ADL_SDK_5.0.ZIP" href="" target="_blank">ADL SDK 5.0</a></li>
  166.         <li><a title="The 7950 Megahash Thread" href="" target="_blank">The 7950 Megahash Thread</a></li>
  167.         <li><a title="CGMINER Information on the Bitcoin Talk Forum" href="" target="_blank">CGMINER GPU FPGA overc monit fanspd RPC stratum linux/windws/osx/mip/r-pi 2.11.3</a></li>
  168. </ul>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand