Home

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Login
    Login Login form

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

Posted by on in Tutorials
  • Font size: Larger Smaller
  • 27 Comments
  • Print

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

Last modified on
Rate this blog entry:
7

Leave your comments

Post comment as a guest

0 / 1000 Character restriction
Your text should be in between 10-1000 characters

Popular Articles

How to Configure Cgminer for Litecoin & Bitcoin (Windows 8)
Tutorials
Rate this blog entry:
13
How To Configure Linux, and build Cgminer for bitcoin and litecoin.
Tutorials
Rate this blog entry:
7
How to Configure Cgminer for Bitcoin-Litecoin (Linux)
Tutorials
Rate this blog entry:
5
How To Buy Litecoin - CoinAxis
Tutorials
Rate this blog entry:
11
Google+