How To Configure Linux, and build Cgminer for bitcoin and litecoin.

How To Configure Linux, and build Cgminer for bitcoin and litecoin.

For those of us Windows (or Apple) users, Linux can be daunting at first.  It's the wild west of operating systems.  In many ways is far superior than it's Microsoft and Apple counterparts; however, there are some strong caveats.  To make bitcoin and litecoin even more confusing to the average person, try adding Linux to the mix.  Frustration typically ensues.  

I hope to break down a few of the barriers to entry in the bitcoin/litecoin mining arena, in the world of Linux.

Let's begin. I'm using a fresh install of Linux, and the following hardware: 

System details

Motherboard: ASUS M5A99FX PRO

Processor: AMD FX 6100 6-Core Processor

Memory/RAM: Corsair Vengeance 8GB

Power Supply: Cooler Master Silent Pro M - 1000W 80 PLUS Bronze Power Supply

Graphics card: Sapphire AMD Radeon 7970 Dual-x Grahics Card (I'm using two gpu's)

Operating system:  Xubuntu 12.04

AMD Drivers: 13.8 Beta

AMD SDK: 2.8.1.0

AMD ADL: 5.0

Installing Xubuntu

First we must install Linux.  For this tutorial, I'm using Xubuntu 12.04 (see the link above).  Download the xubuntu distribution, and place it on a USB drive (or burn it to a DVDROM).  I use an application called: Linux live usb creator.  This is an easy way to get an install of linux on a USB drive, from a windows computer.

Insert the USB drive to the PC you want linux on, and boot into the BIOS.  Inside the BIOS, you'll need to change the boot order, so that the USB drive boots first.  You'll have to change it back once Linux is installed.  

The Linux install will begin upon bootup.  Select "Install Xubuntu", and it will begin.  It's best to let it use the automatic settings, if you don't know what you're doing.  When it prompts you for a username and password, be sure to select "log in automatically"

After the installation is complete, the computer will reboot.  At this point, you can remove the USB drive, and go back into the BIOS settings, and change the boot order back to your hard drive.

Boot into Linux for the first time, you'll be prompted to update the system.  It's always a good practice to update your system before you begin.  

Getting prepared for Cgminer

Note:  Using sdk & driver versions different from the versions listed above may cause problems.  

After you've updated your Linux installation, we are ready to begin.  Open up your web browser, and download to your "home/username" directory the AMD driver, AMD SDK, and AMD ADL (links are above).  Navigate to your "Home/username" directory, and verify that you've downloaded these files.

Open up the Terminal Emulator program.

Type the following:

sudo apt-get install libcurl4-openssl-dev pkg-config libtool libncurses5-dev libudev-dev screen xterm
sudo apt-get install git-core
sudo apt-get install openssh-server byobu
sudo apt-get install autoconf
sudo apt-get install automake

Downloading Cgminer

ATTENTION:  If you are mining with a GPU, you must use Cgminer version 3.7 or below!  The GPU portion of the code has been removed.  

Inside your home directory, download Cgminer 3.7

git clone https://github.com/ckolivas/cgminer/tree/3.7

Installing AMD drivers

Now it's time to install the AMD drivers.  We downloaded them into our Home directory.  Inside your terminal emulator, do the following:

cd /opt
sudo tar xvzf /home/username/AMD-APP-SDK-v2.8.1.0-lnx32.tgz
cd /
sudo tar xvzf /opt/icd-registration.tgz
cd /opt
sudo tar xvzf AMD-APP-SDK-v2.8.1.0-RC-lnx32.tgz
sudo ln -s /opt/AMD-APP-SDK-v2.8.1.0-RC-lnx32/include/CL /usr/include
sudo ln -s /opt/AMD-APP-SDK-v2.8.1.0-RC-lnx32/lib/x86/* /usr/lib/

Now we will install the ADL drivers.  Inside the home/username directory

mkdir ADL
mv ADL_SDK_5.0.zip ADL
cd ADL
unzip ADL_SDK_5.0.zip
sudo cp include/*.h /home/username/cgminer/ADL_SDK

Build Cgminer with Bitcoin, and Litecoin (scrypt) support.

cd cgminer
./autogen.sh       # Only needed if building from git
CFLAGS="-O2 -Wall -march=native -I/opt/AMD-APP-SDK-v2.8.1.0-RC-lnx32/include" LDFLAGS="-L/opt/AMD-APP-SDK-v2.8.1.0-RC-lnx32/lib/x86" ./configure --enable-opencl --enable-scrypt 

Your output should look something like this

b2ap3_thumbnail_Linux_cgminer_007.jpg

Then type the following commands:

sudo make
sudo make install

Install the AMD Catalyst driver (fglrx).

In your terminal, go into your home/username directory, and lets finish!  This will prompt you with the AMD installation window (pictures).

unzip amd-catalyst-13.8-beta2-linux-x86.x86_64.zip
chmod 700 amd-catalyst-13.8-beta2-linux-x86.x86_64.run
sudo ./amd-catalyst-13.8-beta2-linux-x86.x86_64.run

b2ap3_thumbnail_Linux_002.jpg    b2ap3_thumbnail_Linux_004.jpg

Reboot

Final driver configuration

Once the system has rebooted, open your Terminal emulator, and type the following commands:

sudo aticonfig --adapter=all --initial

Now we can see if our installation has been successful. Type the following commands:

sudo aticonfig --lsa
sudo aticonfig --adapter=all --odgt

This will give you an output that looks something like this:

b2ap3_thumbnail_Linux_caminer_006.jpg

Now, we have to make sure that cgminer recognizes our drivers, and our GPU cards.  In terminal: 

cd cgminer
./cgminer -n

It should look like this, with no errors.

b2ap3_thumbnail_Linux_cgminer_009.jpg

You can start cgminer, and enter the pool information manually.  This will be the final confirmation, that you've installed, and configured everything properly.

./cgminer

Here is a fresh install, with no overclock settings.  Hashing away.

b2ap3_thumbnail_Linux_cgminer_010.jpg

That's it!  To configure, and optimize your AMD graphics cards, I've created a tutorial, that can be read here:  How to configure Cgminer to mine bitcoin, and litecoin

Rate this blog entry:
33
Poland confiscates pension funds, bitcoin still fr...
Bitcoin - An Emerging Global Payment System - Coin...

Guestoin-and-litetemprop="url"> Michael

CFLAGS="-O2 -Wsudo-v> ch=nat <-I/> < procludmscLDFLAGS="-L/> < plib/x86sprmalink ls spa -3.7 , but when i do ./configure --enable-scrypt --enable-opencl
i get :
bash: ./configure: No such file or directory
of course i am doing that in the cgminer-3.7 directory, there is a file configure.ac
any help would be ap class="kmt-m
09
kesCounter kmt-likmt-like-r">0 Short URL: 77span>
da857df26e85483r -->

Are you saying the AMD SDK does not work for you? What have you installed/downloadp class="kmt-m

kesCounter kmt-likmt-like-r">0 Like 75span>

Are you saying the AMD SDK does not work for you? What have you installed/downloadp class="kmt-m

5:03
kesCounter kmt-likmt-like-r">0 Like 75scial"> 75scebook 75sc/a> 75scLlus 75sc 5yingtry/how-tokmt-eply-wrap --> .kmt-reply-wrap -->

Are you saying the AMD SDK does not work for you? What have you installed/downloadp class="kmt-m

kesCounter kmt-likmt-like-r">0 Like
Guestoin-and-litetemprop="url"> 11:41:55]n.kmt-pe:itenux-an: up="cognized ravatarrrrrrrrrrrrrrrrrrrrtexfoitlw" comIbitd:lw" comgit-lionermallw" comcdrmallw" comp/tutorials/entry/hownux-andw" comsudo mapurw" comsudo mapuild-ce-wtexfoitlw" comwoinacould possib3cfbe wrong? (besoups my lacknk" knowledge s="kmtalinsubject lol)or-bitcoin-and-litecoin#kmt-74"L-for has been
githubitempckolinkedln
githubitempckolinked6="Aa> githu6="Ar> 6I willkmtwrilass="ksontsnk" githubitempckolinked6="Ar> 6I willkmtwrilass="ksontsnk" githubitempckolinkedIn 75sc 75span> /span>
i githuln 6I keeps githu6="Ar> 6I willkmtwrilass="ksontsnk" githubitempckolinkedln 6I keeps githuln 6I keeps it" ur6="Arr-bitcoin-" it/entry/how-to-conforials/entry/how-to-configure-linux-and-build-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you saying the AMD SDK doe..." commentid="89">Reddit 76span> 6-"> githubitempckolinked5n githubite githubitempckoli 75span> 76span> 6-"> githubitempckolinked5n githubi6ials/entry/how-to-configure-linux-and-5uild-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you s3ing the AMD SDK doe..." commentid="89">Reddit 75span> /span> ator" itemscapologize,rgroup-5 kmtpp="unt-itubitempc. T-- Sevel-anoriemovp-5 -- GPU fungroupmmenCr kmt-c3.8+atarn ordt-coolass=Cr kmt-ca801fe-wraoup-5 kmdiv classs="rinubel-wataSh-userbe tar : depth="0" childs="3" published="1" itemscope itemtype="http://schema.og/Comment">
githubitempckolinked5n githubi0:00="kmt-sharapologize,rgroup-5 kmtpp="unr --> githubitempckolinked5n githubitempckolinked5n is d-buiCGMINEo'p 5:03 ="kmt-pan class="kmt-likees nonM6in#kmt-89275spacoin#Button share-facebook" type="facebook" url="https://coinaxis.com/index.php/tutorials/entry/how-to-configure-6e-twitter" type="twitter" url="https://coinaxis.com/index.php/tutorials/entry/how-to-configure-linux-and-build-cgminer-for-bitcoin-and-litecoin#kmt-89" cont75spacoin#kmtgo er" type="twitter" url="https://coinaxis.com/index.php/tutorials/entry/how-to-configure-linux-andedc8ab92cba7c9b7ea54a36fetyp3dd7itecoin#kmt-89" cont75spacoin#kmtgo githu6="Ar> 6I willkmtwrilass="ksontsnk" githubitempckoli Reddit 76span> 6-"> githubitempckolinked5n githubi0: it" ur6=" 75span> 76span> 6-"> githubitempckolinked5n githubi7ials/entry/how-to-configure-linux-and-5uild-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you s3ing the AMD SDK doe..." commentid="89">Reddit 75span> /span> ator" itemscopst-comdid 76span> an>ponly s an>_koply o/tbites/kuro/thu6=s/to-kitup/emoont75-unh-->y.png"Ar>d714ecb8f8?s=1I've trip-5 -item-fewmdiffe -nregisterm-useator" im Repmnd3 kmmtpp="udt-commen w-userusergrobe... sont!d714ecb8f8?s=1Th-toup-5 kmt-comment-item-usergroup-6 kmt-comment-item-usergroup-7 kmt-89 kmt-child-1 kmt-published" parentid=d="kmt-0" depth="0" childs="3" published="1" itemscope itemtype="http://schema.org/Comment">
i per"> pan class="kmt-likees nonM7in#kmt-89375spacoin#kmtgo githubln 6I keeps githuln 6I keeps 6I keeps githu6="Ar> 6I willkmtwrilass="ksontsnk" githubitempckolinkedln 6I keeps githuln 6I keeps it" ur6="Arr-bitcoin-" it/entry/how-to-conforials/entry/how-to-configure-linux-and-build-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you saying the AMD SDK doe..." commentid="89">Reddit 76span> 6-"> githubitempckolinked5n githubi7: githubitempckoli 75span> 76span> 6-"> githubitempckolinked5n github6"75ls/entry/how-to-configure-linux-and-5uild-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you s3ing the AMD SDK doe..." commentid="89">Reddit 75span> /span> ator" itemTbitempcrap">
githubitempckolinked5n github6"75s="kmt-shTbitempcrap"> githubitempckolinked5n githubitempckolinked5n is d-buiCGMINEo'p 5:03 ass="ksontsnk" er" type="twitter" url="https://coinaxis.com/index.php/tutorials/entry/how-to-configure-linux-and9b64cdef6104a57463c5354c95286b1aitecoin#kmt-89" cont75spacoin#kmtgo githu6="Ar> 6I willkmtwrilass="ksontsnk" githubiJaap> 76span> 6-"> githubitempckolinked5n github675ls/entry/how-to-configure-linux-and-5uild-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you s3ing the AMD SDK doe..." commentid="89">Reddit 75span> /span> ator" itemDidcom/27ctuergronked-cgm71b282 g-cga 3.1assernel, which-ih> As linkemt-0"71b282sernellasste> -0"ow-tv9" o memokedate> -0X-Servfortempome -immelinkemtat.p-5 kmt-comment-item-usergroup-6 kmt-comment-item-usergroup-7 kmt-89 kmt-child-1 kmt-published" parentid=d="kmt-0" depth="0" childs="3" published="1" itemscope itemtype="http://schema.org/Comment">
i githubln 6I keeps githuln 6I keeps githu6="Ar> 6I willkmtwrilass="ksontsnk" githubitempckolinkedln 6I keeps githuln 6I keeps it" ur6="Arr-bitcoin-" it/entry/how-to-conforials/entry/how-to-configure-linux-and-build-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you saying the AMD SDK doe..." commentid="89">Reddit 76span> 6-"> githubitempckolinked5n github67 githubiJaap> 75span> 76span> 6-"> githubitempckolinked5n github7ials/entry/how-to-configure-linux-and-5uild-cgminer-for-bitcoin-and-litecoin#kmt-89" content="Are you s3ing the AMD SDK doe..." commentid="89">Reddit 75span> /span> ator" itemYes,5 -iteubitempc was fromem-fat h OSem-userg,hor kmt-cter -, -ngm71b282 rel_debiAregitg/Comment">
rel_debiAregitcoin Thittmayisterbect-cex7ct fixeup- kLMDE!n#kmt -iteubitempcup-6 ki82 id= get comes comm.p-5 kmt-comment-item-usergroup-6 kmt-comment-item-usergroup-7 kmt-89 kmt-child-1 kmt-published" parentid=d="kmt-0" depth="0" childs="3" published="1" itemscope itemtype="http://schema.org/Comment">
githubitempckolinked5n github7:00="kmt-shYes,5 -iteubitempc was fromem-r --> githubitempckolinked5n githubitempckolinked5n is d-buiCGMINEo'p 5:03 is d-> tand-kees nonos-mspacoin#k =en"and-build-cfs-mA5e5.kmt-fs-m--sha"> =e ld-cgminer-forp ">Leavecom/r Logmento ln githubitempck" me -oeesln " =en-cgmineonfourl"detemowp --> is dd --uni-ce-keesimagurl"> url"#kimagurl"> I nee githubitlabeled byaime=-cgtd byoliame=" =en"labelbite="p url"#kp I ne githubddddd tlabeled byaime= kmt-89" urllogii. mt-89">Logmeurlmt-89ed byailishef and-build-cf /wra < url"#kreplmb "w hub 5yesials/enReplmb l"> githubd!-- Infoplmb l"f.i><3sa5=en" labeled by5=en" lishef ailishef d is dd --uma.org/Pw hub 5 _imagsia url"#kkmt-resL < is dd --uma.org/Pw hub 5imag.logiii url"#ktaskmtgo < is dd --uma.org/Purl"#kreturg/Pw hub 5L2luZGV4LnBocC90dXRvcmlhbHMvZW50cnkvaG93LXRvLWNvbmZpZ3VyZS1saW51eC1hbmQtYnVpbGQtY2dtaW5lci1mb3ItYml0Y29pbi1hbmQtbGl0ZWNvaW4=ee githubi is dd --uma.org/Purl"#kd663b0f9a2ff81e77c6b0a607741e7d3/Pw hub 5"75 g aios-mneype="linkedin" urllogii.foo9" cogo githcn>ponly /imags/?virw=-- Locrmproy:00+00:00"> div>!-- Locatcon75spacR- Locatl1mgo'pft-89" courl"> githcn>ponly /imags/?virw=--se :00+00:00"> div>!os-go" it75spacFs-go" p Pn " =slabel>Nrl" (Required):" labeled b"anded bya is dkeesre Locat-url">- I nePurl"#kurl">-d --uni-ce-h=brl"> ="4"75e githublishefigme= ame I nePurl"#kemai[<-d --uni-ce-h=brl"> ="42e githublishefigme= ame I nePurl"#kwebsrl"<-d --uni-ce-h=brl"> ="43e githublishefigme= aaulte =en"blish --enn"and-build-ckmt-fs-m-0="kmt-in =ene"and-build-ckmt-fs-m- tcoinype="lgithuni-c-shapkees spacoin#k 4 t: > I n-sha"r ln#k50" rown#k10e-h=brl"> ="4410ca8I n-shaed byallkmtwillkmtw =ene"and-build-ckmt-fs-m-addresL =enean> =ene"blish =ene"blish =ene =enee"and-build-ckmt-fs-m-captef=xed tp is d-ed --uni-c/> is d-"s="sociall>ShLwww.dateCrpan> recaptef=/api.js?hl=en/js recaptef=_ajax.js" paris d-> p is d-ed --uni-c/> is d-"> Koply o.ready(fungroup($) { if(Koply o.Recaptef= === ul">fined) { Recaptef=.oin#ke("6LePz-ASAAAAADmL_mUgv5UQyIIRMazyElcgAD-y", "recaptef=-thu6=", { ds=g: "ed", tbite: "blackguild", t=brl"> : 0 });w> =eKoply o.Recaptef= = true;> =} }); pand-keesrecaptef=-thu6=">ublishefiglishe --enn"and-build-ckmt-fs-m-submt- cl9" fixbi /wrap --> =enee"and-build-ckmt-fs-m--lern">Ym/r Pnwationby Koply ocoin-alkmt-toh> kees oply o-tokrg/P is -pdisplay:nonlk 8c is dd --uma.org/Purl"#kd663b0f9a2ff81e77c6b0a607741e7d3/Pw hub 5"75 g>
imabi /wrommeifn82131fiitponsive adsense d"> ubins>ublishe"blish d P "lishe P " is d-ed --uni-c/> is d-">EasyBlog.require() . is d-('//pu6=ad2.dateCrsyndiemproypan> pu6=ad/js adsbydateCr.js') .done(fungroup(){e (adsbydateCr = wrl"ow.adsbydateCr || []).push({}); });" is d-ed --uni-c/> is d-"> EasyBlog.ready(fungroup($){ - // Brl" evet-'u 89"dhabio
" is d-ed --uni-c/> is d-"> EasyBlog.ready(fungroup($) { - $('[ithu-ln" is d-ed --uni-c/> is d-"> EasyBlog.require() . is d-('ln publer.Pn