How to Build a Zcash Miner on Ubuntu Linux 16.04 with Optiminer 1.5 with AMD GPU’s

Rolf Versluis
Jan 23, 2017 · 10 min read
Image for post
Image for post

A few weeks ago I posted a how-to on building a Linux GPU miner for Claymore. Well, at least as of right now, the Optiminer 1.5 Zcash miner is faster than Claymore. I have set up my mining rigs to run both Claymore and Optiminer now. I recommend you run Optiminer 1.5 on Ubuntu Linux.

It’s much easier to SSH into a remote linux miner and change what it is running than to do the same thing with Windows. No VPN connection required, just SSH to my $10/month VPS box running Linux, SSH from there to the Linux box at my small office that my firewall forwards TCP port 22 to, and from there SSH to my GPU-miners.

Copy the files from one miner to another with SCP, reboot remotely if the mining application hangs, and otherwise do complete management remotely. Linux is great for system administration!

Here’s the speed of Optiminer 1.5 on a six GPU mining rig running Sapphire Nitro R9 Fury cards — about 2620 H/s:

Image for post
Image for post

And on a miner with six XFX RX480–8G GPU’s. It’s around 1730 H/s

Image for post
Image for post

The improvement over the Claymore application is enough to make the switch. By the way, this is with stock, unmodified BIOS on the GPU’s.

Bill of Materials

Equipment list — Links are to Newegg or Amazon or Parallel Mining product page

  1. Motherboard — BIOSTAR TB85 LGA 1150 Intel B85 SATA 6Gb/s USB 3.0 ATX Motherboards — Intel — $71
  1. PCI-E Risers — ELEGIANT PCI-E USB 3.0 Cable Express 1X to 16X Extension Cable — Mining Dedicated Graphics Card Extension Cable Adapter with SATA Cable for PC Desktop Laptop — qty 6 at $11 — $66

Total Cost for Bill of Materials — $2270

Build Notes:

I used an MSI board in the video, and the Biostar on a different build. I like the Biostar better because it does not require any messing around with BIOS. It just works. And it costs less.

Buy twice as many PCI-E risers as you think you will need. I’ve tried 3 different brands, and usually half of the risers will be bad and won’t work. Most of the time the GPU card will stop working due to a bad risers after a few hours or a day. This latest batch had some that had electric shorts that prevented the PC from starting!

You may want to buy two of the HP power supplies also.

Build Instructions

I always forget something when I build the machine. Here’s some basic instructions for the most efficient order of operations. The idea is to get a basic computer built, troubleshoot any potential issues, install the operating system and application, then build the rest of the machine.

Hardware Build — Part One

  1. Assemble the Case

If it doesn’t boot, this is the time to do basic troubleshooting. Don’t add any more graphics cards until later after the operating system is installed. The motherboard has a VGA connector if you want to connect a monitor directly to it. Just make sure there are no graphics cards plugged in if you use the onboard video.

Image for post
Image for post

Software Installation and Configuration

Initial Operating System Setup

Install Ubuntu 16.04 LTS Server
Do a standard install using all the defaults , include OpenSSH on installation
After install, login with your username and password
Get ip address with


Go to your PC, ssh to the Ubuntu machine, and do the rest of the setup from your PC so you can copy and paste the commands. I prefer to SSH from Bash shell, but Putty is a good client also.

If you are using a Bash shell from Windows or a Linux machine, or terminal from a Mac, make your logins easier in the future by creating a key on your own computer, then placing it on the miner. Do this on your own computer, at the shell prompt:

ssh-keygen -t rsa -b 4096"ssh-copy-id user@server"

Type the password for the miner, and that should be it. Now you can login without using a password because your trusted key is installed.

Make things easier

Install some basics

sudo apt update
sudo apt install git screen vim nmap ncdu busybox inxi links unzip python

Change colors in the VIM editor. If you don’t like VIM, use nano instead.

vim .vimrc

Add in new file .vimrc

:color desert

Improve the bash shell

vim .bashrc

In the file .bashrc
change #force_color_prompt=yes


add this at the end:

LS_COLORS=$LS_COLORS:'di=0;36:' ; export LS_COLORS

Upgrade the operating systems in a screen:

screen -S upgrade
sudo apt dist-upgrade

ctrl-a d to get back

Fix the network so IP address can be changed from DHCP

Not sure why Ubuntu locks one IP address into itself when it first gets an IP address. But it does. So that needs to be changed.
Step 1: Disable the default Firmware inherited names.
Edit your /etc/default/grub

sudo vim /etc/default/grub

Change the line from


Change the line from

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

make it take effect

sudo update-grub

Step 2: Create the persistent file /etc/udev/rules.d/70-persistent-net.rules as root and fill them.

sudo vim /etc/udev/rules.d/70-persistent-net.rules

Paste this into the new file you just created:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
# # You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device lan Device
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:yy:XX:yy:XX:yy", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="ethX"
# PCI device Wlan Device
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:yy:XX:yy:XX:yy", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wlanX"

Edit the network interfaces:

sudo vim  /etc/network/interfaces

Change device names to eth0 so it reads:

# The primary network interface
auto eth0
iface eth0 inet dhcp

Look up your hardware device name (MAC address) with



HWaddr 4c:cc:6a:67:57:07

Go to your DHCP server and map your preferred IP address to the hardware address. You’re on your own for that one. Note that this is entirely optional! You can leave the IP address that was assigned and not change it if you prefer.

Check in the screen to make sure the update is finished

screen -r

When the update is finished REBOOT

sudo reboot

SSH to box using the new IP address you assigned in your DHCP server!
If you didn’t change it, then it should be at the same address as before. If you can’t find it, login to the terminal at the computer, type


if you only have a loopback address of then run the DHCP client to get an ip address you can ssh to

sudo dhclient

and redo the network fix.

Install AMD video driver and SDK

Copy 2 files from PC to server somehow. I like to use scp, but sftp works also.
AMD Linux Ubuntu Driver 16.50
AMD OpenCL SDK 3.0
Install AMD driver

tar xf amdgpu-pro-16.50-362463.tar.xz
cd amdgpu-pro-16.50-362463/
sudo ./amdgpu-pro-install

Install AMD SDK (optional — some application need this, others don’t)

tar xf AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
sudo ./

Add user to video group

sudo usermod -a -G video $LOGNAME

Check amdgpu driver status

sudo apt install clinfo
sudo clinfo
sudo clinfo | grep compute


sudo reboot

Install X server and Display Manager

Install xorg

sudo apt install xorg xserver-xorg-legacy xserver-xorg-video-dummy

Edit the config file for xorg-legacy:

sudo vim /etc/X11/Xwrapper.config

delete the last line:
insert at end of file:


Create a new file for operating without a monitor connected to box:

sudo vim /etc/X11/xorg.conf

create new file xorg.conf:

Section "ServerLayout"
Identifier " Configured"
Screen 0 "Screen8" 0 0

Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "built-ins"

Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "ShadowFB" # [<bool>]
#Option "DefaultRefresh" # [<bool>]
#Option "ModeSetClearScreen" # [<bool>]
Identifier "Card8"
Driver "dummy"
VideoRam 16384

Section "Monitor"
Identifier "Monitor8"
HorizSync 15.0-100.0
VertRefresh 15.0-200.0
Modeline "1600x900" 33.92 1600 1632 1760 1792 900 921 924 946

Section "Screen"
Identifier "Screen8"
Device "Card8"
Monitor "Monitor8"
SubSection "Display"
Viewport 0 0
Depth 24
Virtual 1600 900

Make sure X works for user on login

vim .bashrc

Add the following at end of .bashrc

export DISPLAY=:0

Change /etc/profile to make it work

sudo vim /etc/profile

# add the following at end of /etc/profile:

export XAUTHORITY=~/.Xauthority

Set variables when user calls X

vim .xinitrc

create new file .xinitrc:

DISPLAY=:0 && xterm -geometry +1+1 -n login

Install Optiminer Zcash GPU Miner

Download the file from the webpage at by typing


extract it:

tar xf optiminer-zcash-1.5.0.tar.gz

Set it up:

cd optiminer-zcash

change the file to make the first three lines look like this:

xinit &
sleep 5

Change the t address you are mining to in the file, and make sure you are connecting to your local flypool server, then start mining.

Enter a screen

screen -S mining

run the miner


Watch and see if anything breaks. This could be an error code, hardware freeze, or something else.

If it goes well, great! Go on to the next step. To exit the screen and keep the miner running when you log out of your session, type a Ctrl-a, followed by just the key d.

ctrl-a d

Then exit your ssh session with


If there is a problem, it is usually:

  • riser hardware problem

Get the entire rig Running

Add one riser and GPU at a time, boot, and make sure it works. First power 3 of the cards from the Antec power supply. Then power the other 3 cards with the HP power supply. Quick way to see if Ubuntu recognizes the board is with

lspci | grep VGA


sudo clinfo | grep compute

This box is going to pull 15 amps at 110 VAC. Be careful with your breakers. The power supplies run more efficiently at 200+ volts. If you have the option to supply your miner with more than 200VAC, do it.

Finally, if everything is working, turn up the intensity. In the file, add -i 7 to the optiminer start command, so it looks like this:

./optiminer-zcash -s $POOL -u $USER -p $PASSWORD -i 7 --watchdog-timeout 30 --watchdog-cmd "./"

Best of luck — let me know if you have comments or questions on this build.

Rolf Versluis

Originally published at Block Operations.

Block Operations

Making money with Bitcoin and Altcoin mining

Rolf Versluis

Written by

Techie, Sales Guy, Business Owner. Former US Navy Submarine Officer. Co-Founder and Executive Adviser for Horizen Cryptocurrency

Block Operations

Making money with Bitcoin and Altcoin mining

Rolf Versluis

Written by

Techie, Sales Guy, Business Owner. Former US Navy Submarine Officer. Co-Founder and Executive Adviser for Horizen Cryptocurrency

Block Operations

Making money with Bitcoin and Altcoin mining

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store