Quick and Dirty Automated Ubuntu 15.10 ZCash Mining Setup for Older GCN-based Cards
Note
Please read the end of these instructions. They will advise you about Optiminer.
These directions pertain to Ubuntu 15.10 specifically, though any version from 14.04 LTS to 15.10 will work here. The main reason for this particular range of versions is to facilitate use of Catalyst 15.12 which is non-functional on later versions of Ubuntu for various reasons. Note that software support for these versions of Ubuntu has ceased, so if any security vulnerabilities crop up, it'll be up to you to decide whether or not you want to keep running older versions of Ubuntu.
The reason for Ubuntu 15.10 specifically is that it defaults to the latest kernel of all Ubuntu versions that still support Catalyst 15.12 . You are free to upgrade your kernel by hand on 14.04 if you so choose.
The reason to use Catalyst 15.12 is to ensure working OpenCL support for older AMD video cards based on GCN 1.1 and earlier (Hawaii and earlier). You may be able to get your older cards working on 16.04 or 16.10 using the AMDGPU-pro drivers but I have no experience with that. For now, 16.04 at least still defaults to the radeon drivers on older cards which may not have suitable OpenCL support.
If you are using Polaris video cards, newer Ubuntu builds (16.04 or 16.10) are recommended since your cards will be fully-supported by AMDGPU out-of-the-box. The same applies for any GCN 1.2 cards (Tonga, Fury, Carrizo iGPU).
Hardware Requirements
Any GCN 1.0/1.1 card that worked with Ethereum mining will also work with Claymore's miner (see below). The card should have at least 2 GB of VRAM, with 4+ being preferred. Since this guide is aimed at helping miners transition into ZCash under Linux, it is assumed that you know how to get your rig up and running with PCIe risers and other hardware required for such things. If not, ask questions elsewhere in this thread so we can answer them on a case-by-case basis.
You should know the target GPU and RAM clocks for all your cards in advance, and you should have the voltages dialed in on your cards' respective BIOSes already (or just stick with default). You may be able to tweak card voltage in other ways but I am not going to go into all that.
Software Requirements
A naked Ubuntu 14.04-15.10 (15.10 preferred) is all you really need. I install mine to 32 Gb Silicon Power USB 3.0 thumb drives with zero swap space. That config might not be optimal, but I found that swap partitions on a USB drive actually slowed things down a bit. Dedicated SSDs or even platter-based drives will provide better usability during setup and installation, but no additional mining performance will be had from such a luxury.
When you install Ubuntu (I use the Lubuntu flavor but you can choose a different one), be sure to set up your primary account to log in automatically, and then disable lightlocker so it won't lock/shut down the machine or attempt to initiate sleep mode from idleness.
There
are some is one dependency required to run
SilentArmy's Claymore's miner:
git
build-essential
python3
fglrx-updates
To install this, type the following on a command line:
Code:
sudo apt-get install fglrx-updates
After installing fglrx-updates, restart the machine. Then open up a terminal in your home directory and type:
Code:
sudo aticonfig --adapter=all --initial
Then restart again, or at least log out/log in (logging out may be all that is required but the Windows user in me just loves to reboot all the damn time).
After rebooting, the first thing you should do is create a script to set the GPU and RAM clocks you want for each card assuming they aren't already set up in their BIOSes to run how you want. I'm fairly conservative, so I flash all my cards to a low-ish clockspeed for default operation (usually 900 MHz GPU and 1175 MHz RAM on Hawaii). Then I use software controls to bring speeds up to the desired target. I create a file called setclocks.sh in my home directory. Then I type the following at the command line:
That ensures that the script can be executed. The script contains something like this:
Code:
aticonfig --od-enable
aticonfig --adapter=0 --od-setclocks=1075,1175
aticonfig --adapter=1 --od-setclocks=950, 1175
aticonfig --adapter=2 --od-setclocks=1060,1175
aticonfig --adapter=3 --od-setclocks=1090,1175
aticonfig --adapter=all --od-commitclocks
The --od-enable switch enables OverDrive, and the rest configures GPU,RAM clockspeeds for the specified cards. The --od-commitclocks switch locks in the changes to be permanent until reboot or until aticonfig is used again to change the speeds. Use a standard text editor like LeafPad to input all those lines.
Execute the script from the command line in your home directory like this:
Since this guide is aimed at GCN GPUs, you will also need to/want to install the AMD APP SDK 3.0. Follow the instructions posted here. I post the link for brevity; if anyone wishes for me to expound on the subject here in detail, I'll do so on request.
Okay! Now we install the SilentArmy miner itself. First we use git to download the source files. At the command line, type:
Code:
git clone https://github.com/mbevand/silentarmy.git
This will create a subdirectory called silentarmy. It is recommended you run this command from your home directory.
Once the clone process is complete, open a terminal in the silentarmy subdirectory and type:
That should create a number of files, including a binary called "silentarmy" inside the silentarmy subdirectory. You can execute the miner from your home directory by typing:
Code:
./silentarmy/silentarmy -c stratum+tcp://<pooladdress>:<port> -use=<GPU #s> -u <wallet>/<minername>/<emailaddy> -p x
Or just use the --help switch when running ./silentarmy/silentarmy to see the commands for yourself. Be sure to use commas when specifying which GPUs to use via the -use command (example: -use=0,1,2,3). You can use the --list switch to find the order and number of your GPUs as detected by silentarmy.
Bear in mind that if you have any 2 Gb cards, you will need to enter the following lines in the terminal BEFORE running
silentarmy Claymore's miner to get those cards to work:
Code:
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
Now you want to set up Claymore's miner. It's pretty straightforward. Download the .zip from his archive (check OP of this thread for link), find the latest Linux binary archive in the .zip you get, and extract its contents. I used /home/<username>/ClaymoreZEC as my directory name. Edit the config.txt exactly the same way you would under windows.
If that starts up okay and it mines, it's time to automate!
Automation: Quick n' Dirty
There are better ways to automate. This guide makes use of the .profile file which will cause all the below scripts to execute every time you log in as the associated user (assumed user is the default one) which would get ugly if you ssh into the box without using a separate login. With more time and care, a proper cron or systemd setup would be possible. But I digress.
The first thing you need to do is set up a mining script. Create a file in your home directory (mine is called multimine.sh) and then type the following in a terminal:
Whatever is your filename, put it in there instead of multimine.sh, but make sure your file ends with the .sh extension regardless. As above with setclocks.sh, this command allows execution of the script.
Open up multimine.sh (or whatever you named it) in LeafPad and put in the following:
Code:
/home/<username>/ClaymoreZEC/zecminer64 config.txt
Try executing multimine.sh from a terminal opened to your home directory. Just type:
And if it works, then we're ready for the next step.
Now you need to set the PCManFM file manager to view hidden files. Inside your home directory, you will find a file named ".profile". You need to add some language to the end of the file using something like LeafPad. I recommend:
Code:
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
./setclocks.sh
sleep 15
xterm -e ./multimine.sh
Note that the sleep line is mostly superfluous, but I leave it in there anyway. Every time you start up the account with that particular text in its .profile file in its home directory, that stuff gets executed BEFORE loading the desktop environment. The net effect is that you get a single xterm running the SilentArmy miner without any desktop. The desktop will not load until you kill the xterm. Just mouse over it (you will have a mouse cursor), left-click to make sure you have the term selected, and then hit Ctrl-C to kill the xterm. Then the desktop environment will load normally. Even if you kill the xterm, the environment variables set in your .profile will still enable mining with 2 Gb cards, and the effects of the setclocks.sh script will still be in effect, so you can always manually open up a terminal and execute multimine.sh by hand to resume mining.
Reboot your machine and watch what happens. If it starts mining in a tiny little term window against a black screen, you're in there! Now you can shut down the machine, disconnect the monitor, and reboot and mine with headless confidence. If it doesn't work . . . post here, I'll do my best to help you.
About Optiminer
Optiminer (linked in the OP) is an alternate client for GCN only that does not require compilation and is faster than the SilentArmy miner at this time. It is a simple binary blob that works a lot like Claymore's miner. Read the instructions on its use, but you can use it instead of the SilentArmy miner for more performance. There is a mining fee. All development of Optiminer has ceased, but for now, it's still the fastest Linux miner out there.
All you really need to do is set it up in a separate directory (I use OptiminerZEC, or /home/<username>/OptiminerZEC) and then change your mining shell script (multiminer.sh above) to reflect the new binary. So for example, I use:
Code:
cd OptiminerZEC
./optiminer-zcash -s <pooladdress>:<port> -u <wallet>/<minername>/<emailaddy> -p x
Note that if you use the above line for Optiminer 6.0, it may autodetect strange intensity settings for your cards, causing instability/crashing. I had to manually set intensity for it to work. For example, on a machine with 3 Hawaii cards and 1 Pitcairn, I settled on -i 5 -i 5 -i 5 -i 3 . That sets intensity 5 for the Hawaii cards (the first three) and intensity 3 for the Pitcairn.