This guide will be focusing on a headless rig and all work will be done via the terminal.
Lets get straight into it, to start you need a fresh installation of Ubuntu Server 20.04 LTS. Download and install it to your rig. Once installed and rebooted we will be doing a couple of quick commands to install some apps that will help us complete the install with as little downtime as possible.
Let’s update and upgrade our installation which is typical on a fresh install, we are also installing
nano as our text editor.
Update & Upgrade
sudo apt update && sudo apt upgrade && sudo apt install nano clinfo -y
This will bring your installation up to date, we wont have to do it too much in the future and the rig can be kept online 24/7 without problems.
Install some elements we may need, this is really for compatibility more than anything else and if you know what you are doing you can leave them out, otherwise go ahead and install.
sudo apt install build-essential dkms amdgpu-dkms libdrm-amdgpu-amdgpu1 libdrm2-amdgpu opencl-amdgpu-pro opencl-amdgpu-pro-dev
This may take a few minutes to complete.
Download & Install Drivers
Next, download and install the drivers, we will be using a specific version that has been known to work well.
# Change to a directory to download the file cd Downloads # Download the tar file of AMD drivers wget https://drivers.amd.com/drivers/linux/amdgpu-pro-20.40-1147286-ubuntu-20.04.tar.xz --referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-40 # unzip the tar tar -xJpf amdgpu-pro-*.tar.xz # cd into the directory cd amdgpu-pro-20.40-1147286-ubuntu-20.04
The next command will install the driver with specific options to only install the OpenCL part of the driver.
./amdgpu-pro-install -y --opencl=pal,legacy,rocm --headless
Once complete the drivers will be installed and you can check with an app called
clinfo which we installed earlier. You can type
clinfo to see your attached graphics cards. but first add yourself to the
sudo usermod -a -G video $USER sudo usermod -a -G render $USER
Overclocking & Undervolting
If you want to control the power states in Linux, we need to make a couple of changes that will allow our system to control the power states of our graphics cards.
# Open grub sudo nano /etc/default/grub
Find the line that starts with
GRUB_CMDLINE_LINUX_DEFAULT= and add
amdgpu.ppfeaturemask=0xffffffff. the final line will look like below.
GRUB_CMDLINE_LINUX_DEFAULT="quick splash amdgpu.ppfeaturemask=0xffffffff"
Now update the grub using
After reboot you are finished setting up your rig and you can download your favourite mining software. We suggest TeamRedMiner.
Some great affiliate links give you free cash to spend on VPS. If you use these links I will get a small commission if you choose to sign up.
- Vultr.com – $100 free to spend on VPS
- DigitalOcean.com – £200 to spend on all services including VPS
- Atlantic.net – 1 Core 2GB RAM VPS FREE for 12 months from signup + $15
- Hetzner Cloud – $20 Free to use on all products
- GSuite – Google Workspace 10% off the first year
6AKCQG7CAFYCQWAto your Google Workspace Account