This [Guide] is relevant but out of date :
After Ghostlander did so much new work on it, NSGminer. is now a recommended miner and has a guide in the Github and is compatible with a wide variety of GPUs.
http://forum.feathercoin.com/topic/8235/nsgminer-v0-9-0-the-fastest-neoscrypt-gpu-miner/1
Ubuntu 14.04 + AMD Card + sgminer Tutorial
I recently had to redo this so I decided to make a write up for this to share with everyone. This might be helpful or blow up your machine, so don’t hold me responsible for any damage to your stuff. With the disclaimer out of the way, here the process.
Installing Ubuntu Server
First go and get the ISO for Ubuntu 14.04.1 LTS Server at the Ubuntu site. When you have the file “ubuntu-14.04.1-server-amd64.iso” you need to put it on a USB stick. If you use Windows, then the Linux Live USB Creator is your best bet. Feed it the ISO and you have a bootable USB stick for installation.
Take your hardware, attach stick, keyboard and monitor, then boot from the stick. As a side note I would start with one GPU card if you intend to use multiple. Once you have one single card running, you can add more, safe in the knowledge that your system is sound.
Install it as you prefer. I’d use English as language, it can make your life a bit easier since it says the same things you see online. When partitioning the disk, I would use “Guided, entire disk” and just accept what it does. Give it a good hostname (mine are miner01, miner02 and so on) and give it a simple username/password. I would suggest using the same for both, something you remember even if you don’t touch the box for months. I chose “miner” for my setup and will use that throughout the guide, so if you see /home/miner, then you should replace the “miner” with something else that you picked. It should be behind some router/firewall so there shouldn’t be a problem with that. When it asks you what to install, only hit the spacebar once so it selects the OpenSSH server, then tab and enter to continue. Everything needed is covered in this guide beyond that. When asked to install the grub loader into the MBR, say yes.
The system reboots, remove the USB stick, then let it boot until you see the prompt with the hostname you chose (miner01 in my case). Login with your username/password you chose.
Type
ifconfig
and note down the IP address it has. Usually something like 192.168.1.12 or the likes. You will need that for the next parts.
Installing drivers
I suggest you switch to your main computer now and connect to the miner with a tool such as putty or terminal. The advantage is you can copy paste things over simply with this and you can have the miner in another room or less comfortable place while remotely working on it from your comfy chair. Connect using your IP you noted before (the 192.168 thing) and login using your username/password.
Simply copy paste the following lines and let them run through. If it asks you should it do it, just hit the Y key and then enter.
First the system upgrades to make sure you are up to date with all the dependencies.
sudo -s
aptitude update
aptitude safe-upgrade
aptitude install acl libtool libncurses5-dev libjansson-dev libcurl4-openssl-dev build-essential git make gcc automake curl x11-common xserver-xorg-core unzip libxrandr2 libxrandr-dev xserver-xorg x11-utils opencl-headers
Now your system is ready for the drivers. Unfortunately they are not that easy to come by from within the box. So use your machine and collect the 3 files you need to make this work.
First is the AMD Display Library (ADL) SDK or short ADL_SDK which will allow sgminer to get data from the GPU card like temperature and also tweak settings. This might seem like not much, but in order to get the most from your miner, you need this. At the time of this writing that page linked above shows the latest version is 7.0 and the file you get is ADL_SDK.zip which is 1.77 MB and was released 05/29/2014. Download it and save it somewhere.
Second file is the AMD APP SDK which is needed for sgminer to talk to the graphics card in it’s own language (OpenCL). The file you should get (at the time of this writing) is AMD-APP-SDK-linux-v2.9-1.599.381-GA-x64.tar.bz2 which is 123 MB large and was released 8/18/14. Make sure you get the 64 bit version. If a newer version is out,
And lastly you need the OpenCL 2.0 enabled graphics card drivers. You can get them on the AMD support page. What you want is behind the AMD Catalyst™ Software for Linux® 64 bit system link. This will give you file called linux-amd-14.41rc1-opencl2-sep19.zip of 150 MB.
Now you need to get those on to the miner. I use FileZilla for this and make an sftp connection for it. Works fast and is free. The files are now in the home directory of your miner user.
Considering all the filenames are still the same, you can use these commands now
cd /home/miner
tar -xvjf AMD-APP-SDK-linux-v2.9-1.599.381-GA-x64.tar.bz2
./AMD-APP-SDK-v2.9-1.599.381-GA-linux64.sh
ln -s /opt/AMDAPPSDK-2.9-1 /opt/AMDAPP
ln -s /opt/AMDAPP/include/CL /usr/include
ln -s /opt/AMDAPP/lib/x86_64/* /usr/lib/
ldconfig
reboot
Your miner will do a quick reboot, don’t worry, it needs that for the next part (just makes it easier).
Now the catalyst driver comes into play.
sudo -s
cd /home/miner
unzip linux-amd-14.41rc1-opencl2-sep19.zip
fglrx-14.41/amd-driver-installer-14.41-x86.x86_64.run
aticonfig --adapter=all -f --initial
reboot
With this you have installed and configured the driver. Time for building the sgminer binary.
Building sgminer
You can do a quick check if the above worked before going on if you want with the following lines:
export DISPLAY=:0
aticonfig --list-adapters
It should show you (at least) one graphics card. If it doesn’t something went wrong before, so buidling sgminer is not your problem just yet.
The prep for sgminer is relative simple. Just run these in order.
cd /usr/local
git clone https://github.com/veox/sgminer.git
cd /home/miner
unzip ADL_SDK.zip
cp include/* /usr/local/sgminer/ADL_SDK/
cd /usr/local/sgminer
./autogen.sh
CFLAGS="-O2 -Wall -march=native -I/opt/AMDAPP/include" LDFLAGS="-L/opt/AMDAPP/lib/x86_64" ./configure --enable-scrypt
make
If all goes well you should now have the sgminer binary. Most problems happen on the line that starts with CFLAGS where the configure will spit out some errors. Don’t worry about warnings on the make line, that’s normal.
Run
./sgminer -n
to see if it worked and you have a working binary.
Autostart miner on boot
To control your miner and do some magic, you need scripts to help you with that. No worries, I got you covered. Open an editor with this:
nano /etc/init.d/sgminer
Now paste the following content into the open file, BUT change the line. The -o should be your mining pool you want to mine for. The -u your username. And of course your password with -p for the pools user. If you don’t change them, thank you for mining for me.
#!/bin/bash
#
case "$1" in
start)
echo "Starting sgminer"
export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_MAX_HEAP_SIZE=100
/usr/local/sgminer/sgminer -I 15 -o stratum+tcp://pool.d2.cc:3333 -u ChristianRiesen.tutorial -p x
;;
stop)
echo "Stopping sgminer"
killall -9 sgminer -w -q
;;
*)
echo "sgminer"
echo $"Usage: $0 {start|stop}"
exit 1
esac
exit 0
When you are done, hit CTRL+O for writing and then CTRL+X to exit the editor.
I also added an Intesity of 15 in there, so you might want to tweak the settings with this. Alternatively you can also create a config, and reference it here. But that’s not part of this guide. All I aim here to do is get your running first.
Now you need to set the script to execute.
chmod a+x /etc/init.d/sgminer
If you want to run it automatically every time the system boots, then you should also execute this.
ln -s /etc/init.d/sgminer /etc/rc2.d/S99sgminer
There is one more thing you have to do. For sgminer to run properly, you need X to start (aka x Windows). So open a document like this:
nano /etc/init.d/x-boot
Insert this content
#!/bin/bash
#
case "$1" in
start)
echo "Starting X"
X &
;;
*)
echo "X"
echo $"Usage: $0 {start}"
exit 1
esac
exit 0
Exit with CTRL+O and CTRL+X again, then mark it executable and let it autoboot. This way your miner will be able to work properly, otherwise you might run into problems that cost me countless hours in the past.
chmod a+x /etc/init.d/x-boot
ln -s /etc/init.d/x-boot /etc/rc2.d/S89x-boot
Reboot your box and it should automatically start mining for you. Alternatively, run these two commands now to see it mine right in front of you:
/etc/init.d/x-boot start
/etc/init.d/sgminer start
When you quit sgminer, you can just start it again with the lower line only, which is probably something you will do a lot while tweaking it.
Where to from here?
Maybe more cards? Now here is a thing you have to do to make them work. Shutdown, insert card, boot up, then run this command, then reboot.
sudo aticonfig --adapter=all -f --initial
Now you should be able to access the card.
You might also want to tweak the settings of your card, to get more power out of it, but that’s not this tutorial.
I successfully used this on a dozen different machines and has yet to fail me. I used 7950’s mostly, so your results may vary. Enjoy!