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:
Motherboard: ASUS M5A99FX PRO
Processor: AMD FX 6100 6-Core Processor
Memory/RAM: Corsair Vengeance 8GB
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: 18.104.22.168
AMD ADL: 5.0
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
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:
sudo tar xvzf /home/username/AMD-APP-SDK-v22.214.171.124-lnx32.tgz
sudo tar xvzf /opt/icd-registration.tgz
sudo tar xvzf AMD-APP-SDK-v126.96.36.199-RC-lnx32.tgz
sudo ln -s /opt/AMD-APP-SDK-v188.8.131.52-RC-lnx32/include/CL /usr/include
sudo ln -s /opt/AMD-APP-SDK-v184.108.40.206-RC-lnx32/lib/x86/* /usr/lib/
Now we will install the ADL drivers. Inside the home/username directory
mv ADL_SDK_5.0.zip ADL
sudo cp include/*.h /home/username/cgminer/ADL_SDK
Build Cgminer with Bitcoin, and Litecoin (scrypt) support.
./autogen.sh # Only needed if building from git
CFLAGS="-O2 -Wall -march=native -I/opt/AMD-APP-SDK-v220.127.116.11-RC-lnx32/include" LDFLAGS="-L/opt/AMD-APP-SDK-v18.104.22.168-RC-lnx32/lib/x86" ./configure --enable-opencl --enable-scrypt
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).
chmod 700 amd-catalyst-13.8-beta2-linux-x86.x86_64.run
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:
Now, we have to make sure that cgminer recognizes our drivers, and our GPU cards. In terminal:
It should look like this, with no errors.
You can start cgminer, and enter the pool information manually. This will be the final confirmation, that you've installed, and configured everything properly.
Here is a fresh install, with no overclock settings. Hashing away.
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