Author

Topic: UnicornHasher Ubuntu+Beta Drivers headless scrypt miner setup and tuning guide (Read 1647 times)

donator
Activity: 686
Merit: 519
It's for the children!
RESERVED for tuning guide
donator
Activity: 686
Merit: 519
It's for the children!



UNICORN HASHER MINER INSTALLATION GUIDE

UnicornHasher GPU Scrypt Miner Setup 201303xx

OS: Ubuntu 12.04 LTS Server 64 bit
Drive: ADATA 32GB SSD

Miners:
ckolivas / cgminer 3.7.2
veox / sgminer LATEST from GIT
Kalroth / cgminer-3.7.2-kalroth LATEST GIT
 
 This guide is copy and paste on how to setup a linux GPU scrypt miner
 Using any of the above three pieces of mining software.
 Copy EVERYTHING in the code blocks including empty lines!

 This is using the latest beta drivers from AMD 14.12 Beta
 This new driver set includes AMP-APP so we do not install it.
 
This is for altcoin Scrypt Mining on a minimal headless ubuntu linux server

 Please paste exact error messages if something doesnt work
 
References Used
Unicorn Hasher Scrypt-Master.txt
http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html

Preparing:
Download and Install Ubuntu Server 12.04 LTS 64 bit:
http://releases.ubuntu.com/12.04.4/ubuntu-12.04.4-server-amd64.iso
There are thousands of guides on installing ubuntu.  This is not one of them.  Sorry
To follow this guide without modifications set the Username and Password miner
select openssh-server during installation
make sure you can ssh to the box


Unplug the monitor and SSH into the machine everything else in this guide is normally done from a remote location!

Code:
sudo -s


Update the system
Code:
apt-get -y update
apt-get -y upgrade


Install dependencies
Code:
apt-get install -y dh-make dh-modaliases execstack libxrandr2 libice6 libsm6 libfontconfig1 libxi6 libxcursor1 libgl1-mesa-glx libxinerama1 libqtgui4 unzip xdm xorg git build-essential autoconf libtool libcurl4-openssl-dev libncurses5-dev pkg-config libudev-dev screen opencl-headers lib32gcc1 libc6-i386 dkms


Fix the grub failure bug, normally after a system crash or a few forced reboots Ubuntu will sit at the grub prompt and wait for you to hit enter.  Which sucks.
Code:
sed "s/:--1/0/g" -i /etc/grub.d/00_header
update-grub2


Swap privilege levels:
Code:
su miner


Download the newest catalyst beta driver for linux amd64 and the AMD_SDL headers

You will have to get a valid nonce or download the ADL_SDK FROM: http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/

The nonce is a code to prevent me from scripting this Smiley If you use the inspect element or developer view on chrome/IE/firefox/safari you can see the nonce inside the form on the download page.

Just replace the nonce= below with a new one or download the file and scp it over to the rig.

Code:
POSTDATA="amd_developer_central_nonce=c51137f55e&_wp_http_referer=%2Ftools-and-sdks%2Fgraphics-development%2Fdisplay-library-adl-sdk%2F&f=QURMX1NES182LjAuemlw"
REFER="http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/"
URL="http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/"
wget --post-data="$POSTDATA" --referer="$REFER" $URL -O ADL_SDK_6.0.zip

wget --referer="http://www.amd.com"  http://www2.ati.com/drivers/beta/amd-catalyst-14.2-betav1.3-linux-x86.x86_64.zip


Create a distribution specific package for the video driver

Code:
unzip amd-catalyst-*.zip
chmod +x amd-driver*.run
exit
./amd-driver*.run --buildpkg Ubuntu/precise


Install the video driver:

Code:
dpkg -i  fglrx_*.deb 
dpkg -i  fglrx-dev*.deb
dpkg -i  fglrx-amdcccle*.deb
aticonfig --adapter=all -f --initial
sed -i 's/DisplayManager\*authorize:.*true/DisplayManager\*authorize: false/' /etc/X11/xdm/xdm-config


Reboot so the new driver takes affect:
Code:
reboot


SSH back into the machine and become root user:
Code:
sudo -s


Swap privilege level
Code:
su miner


INSTALL K,C,S Gminer Or Pick One!
It can't hurt to have all three installed Smiley

SGMINER
Code:
git clone https://github.com/veox/sgminer
mkdir ADL-SDK
cd ADL-SDK
unzip -o -qq /home/miner/ADL_SDK_*.zip
cp include/* /home/miner/sgminer/ADL_SDK/
cd
cd /home/miner/sgminer
autoreconf -i
CFLAGS="-O2 -Wall -march=native" ./configure

Make sure you have GPU support!!!!
#  OpenCL...............: FOUND. GPU mining support enabled
#  ADL..................: SDK found, GPU monitoring support enabled

Code:
make clean
make
cd


#KGMINER
Code:
git clone https://github.com/Kalroth/cgminer-3.7.2-kalroth.git kgminer
mkdir ADL-SDK
cd ADL-SDK
unzip -o -qq /home/miner/ADL_SDK_*.zip
cp include/* /home/miner/kgminer/ADL_SDK/
cd
cd /home/miner/kgminer
autoreconf -i
CFLAGS="-O2 -Wall -march=native" ./configure --disable-ADL --enable-opencl --enable-scrypt

Make sure you have GPU support!!!!
#  OpenCL...............: FOUND. GPU mining support enabled
#  ADL..................: SDK found, GPU monitoring support enabled

Code:
make clean
make
cd


CGMINER
Code:
cd
wget http://ck.kolivas.org/apps/cgminer/3.7/cgminer-3.7.2.tar.bz2
bunzip2 cgminer-3.7.2.tar.bz2
tar -xvf cgminer-3.7.2.tar
mv cgminer cgminer.old
rm -rfv cgminer
mv cgminer-3.7.2 cgminer
mkdir ADL-SDK
cd ADL-SDK
unzip -o -qq /home/miner/ADL_SDK_*.zip
cp include/* /home/miner/cgminer/ADL_SDK/
cd
cd /home/miner/cgminer
CFLAGS="-O2 -Wall -march=native" ./configure --enable-opencl --enable-scrypt

Make sure you have GPU support!!!!
#  OpenCL...............: FOUND. GPU mining support enabled
#  ADL..................: SDK found, GPU monitoring support enabled

Code:
make clean
make
cd
exit


Test your ati-config to ensure you have GPU support:

THIS SHOULD LIST ALL OF YOUR GPUS!!!
# * 0. 00:01.0 AMD Radeon HD 7480D
#  1. 05:00.0 Supported device 6810

Code:
export DISPLAY=:0
aticonfig --list-adapters


TEST YOUR three xGMINER BUILDS

This should output a lot of text.  Look for errors and make sure you have supported GPU's listed in the output

Code:
export DISPLAY=:0
export GPU_MAX_ALLOC_PERCENT=100
export GPU_USE_SYNC_OBJECTS=1
/home/miner/kgminer/cgminer -n
/home/miner/sgminer/sgminer -n
/home/miner/cgminer/cgminer -n


Create the auto-start file so mining always starts on reboot
Code:
cat > /etc/rc.local << EOF
/bin/su miner -c "bash /home/miner/mine.sh&"
EOF

Create a force reboot command so you can reboot the rig if cgminer hangs
Code:
cat > /home/miner/frboot.sh << EOF
#!/bin/sh
echo 1 > /proc/sys/kernel/sysrq &
echo b > /proc/sysrq-trigger &
EOF
chmod +x frboot.sh
su miner

Create the actual miner script which will start c/k/s gminer
CHANGE SGMINER to whatever miner you are using!!!

Code:
cat > mine.sh << EOF
#!/bin/bash
#Dynamic miner config for `hostname`
POOLA="-o stratum+tcp://us.clevermining.com:3333 -u 132axFgv4WmtC9r4xSZN5hCZzdPnyaNTg9 -p x"
POOLB="-o stratum+tcp://stratum.scryptguild.com:3333 -u unicornhasher -p  x"
POOLC="-o stratum+tcp://middlecoin.com:3333 -u 132axFgv4WmtC9r4xSZN5hCZzdPnyaNTg9 -p x"
API="--api-port 4028 --api-listen --api-allow 0.0.0.0"
GENERAL="--queue 0 --scan-time 1 --gpu-threads 2 --auto-fan --gpu-fan 35-85 --temp-target 78 " #--scrypt #For K and C
#CARD="--gpu-engine xxx --gpu-memclock xxx --gpu-powertune xxx"
WORK="--xintensity 4 --worksize 256 --lookup-gap 2 " #--thread-concurrency 8192
export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
sleep 1
cd /home/miner/sgminer/
/usr/bin/screen -dmS miner /home/miner/sgminer/sgminer \$API \$POOLA \$POOLB \$POOLC \$GENERAL \$CARD \$WORK
sleep 1
EOF
chmod +x mine.sh



CHANGE SGMINER to whatever miner you are using!!!

Create an Xgminer reboot script to assist in tuning the cards!
Code:
cat > cgrestart.sh << EOF
rm sgminer/*.bin
rm -r .sgminer/
cd
./frboot.sh
EOF
chmod +x cgrestart.sh


ONLY NEEDED IF YOU ARE USING A LEASING SYSTEM
This is only used to swap pools using a cron job or remote system in case you lease out or change pools frequently
Code:
cat > pool.unicorn.sh << EOF
#!/bin/bash
#Unicorn Pools
POOLA="-o stratum+tcp://us.clevermining.com:3333 -u 132axFgv4WmtC9r4xSZN5hCZzdPnyaNTg9 -p x"
POOLB="-o stratum+tcp://stratum.scryptguild.com:3333 -u unicornhasher -p  x"
POOLC="-o stratum+tcp://middlecoin.com:3333 -u 1NHTgjErdNS9SRHrwN3CsVXERibRmKGkAU -p x"
EOF
cp pool.unicorn.sh pool.sh
cat > lease.sh << EOF
#!/bin/bash
DATE=\`date +%Y%m%d\`
cp /home/miner/pool.sh /home/miner/pool.sh-\$DATE
if [ -f /home/miner/pool.next.sh ];
then
 mv /home/miner/pool.next.sh /home/miner/pool.sh
else
 cp /home/miner/pool.unicorn.sh /home/miner/pool.sh
fi

mv mine.sh mine.sh-\$DATE

echo "#!/bin/bash" > mine.sh
echo "#Dynamic miner config for \`hostname\`" >> mine.sh
sed -n '/^POOL/p' pool.sh >> mine.sh
sed  -e '/^\#/d' -e '/^POOL/d' mine.sh-\$DATE >> mine.sh
chmod +x mine.sh

screen -S miner -X quit

bash /home/miner/mine.sh &
EOF
chmod +x lease.sh

END OF LEASING SYSTEM CODE

That is it.  You are done. Reboot directly into a functioning mining rig!

Code:
reboot


after the reboot ssh into the rig and use screen -x to join the mining session

my SSDs take under 15 seconds for a cold reboot with this setup
The system should be mining using the default config listed (to my pools if you didn't change them Smiley
I'll post the clock tuning guide next

Long Live the Unicorn
Jump to: