Litecoin or Bitcoin: Ubuntu Cgminer install

I just spent a good amount of time trying to get my headless ubuntu litecoin miner to work.

There are several great tutorials out there:

But it would have saved me a lot of time if they were more concise and left out all the unnecessary stuff.

So here is my attempt at a more succinct, “get down to business”, type of tutorial.

Step 1

Install ubuntu, I am using 12.04, but I am sure you can choose any flavor you like.

Step 2

Clean up old drivers. This is important if you are already having issues with your install. If this is a brand new install, you can ignore this step.

sudo sh /usr/share/ati/
sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx

Step 3

Install dependencies. Honestly, I don’t know which of these are actually important, but they don’t hurt so just install them.

sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0 dh-modaliases libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm byobu

Step 4

Install the AMD catalyst driver so your video cards can be recognized. Caution: Using the build-in FGLRX drivers did not work for me, this method is much more fool-proof. Note: The catalyst driver installer requires a GUI, so be sure to turn on X if you are working from SSH.

chmod +x
sudo sh

Step 5

After you install the AMD catalyst drivers and come back from rebooting, it is time to see if your GPUs are being detected properly.

First, we run some magic:

export DISPLAY=:0

Then we probe aticonfig to see what it has.

This will list all the active devices.

sudo aticonfig --lsa

This will list all the devices and their respective fan speed — basically checking if you can read them.

sudo aticonfig --adapter=all --odgt

If that does not work, you can try one last command

sudo aticonfig --adapter=all --initial

Then reboot and try the first two aticonfig commands (including the magic commands) again to see if you get any results.

If the three commands above does not return to you all the cards you expected, or show any kind of errors, something is wrong. There is no need to go any further. Go back and see if you missed a step, or go try another tutorial.

Step 6

Go get a pre-built copy of cgminer from the author’s website:

You are free to compile it yourself from the github source, but it’s a tedious process, so why bother.

Step 7

See if cgminer pick up all the same cards aticonfig does.

First run the magic (basically you always do this before you run anything that requires the graphic cards):

export DISPLAY=:0


./cgminer -ndevs

It should list all your cards.

If it does, then you are ready to mine. Configuring cgminer properly is whole another topic I won’t discuss here.