How to Set Up Ubuntu Server 20.04 LTS for AMD Miners

This guide will get you set up mining with a fresh installation of Ubuntu Server 20.04 LTS.

Get Started

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.

Compatibility Software

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 video and render group.

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

sudo update-grub

Now reboot

sudo reboot

Complete!

After reboot you are finished setting up your rig and you can download your favourite mining software. We suggest TeamRedMiner.

Hello there! My name is Darren and i am a hobbyist/homelab/crypto enthusiast. If you liked this post please consider signing up for a Digital Ocean account using my link and you will receive $100 in free credit while at the same time helping me to cover the costs of my servers. Thank you!

XCH: xch1hrumdza9u6slw5hz343p3yh954wvjs4rqnqdkq6huanctf0vytzqqkahxk
BTC: 1BVwmPMt6kxRe88EKhThJviFp3M4MhubTA
ETH: 0xa958d40518d76168BB795947Bf96AafD6bccc177
LTC: MBJdCsnZXDuXBYme6Ur7VFAeYw4LTFM9CP
BAT: 0xab574A09fFf2aa391658D3D048265ad1401cA7AF
DOGE: DBCchyovcTXSioWM392kKydJxY5nyECYFB
SCP: 9f2feed9f29f3f8035e4ae2a33837ae4affa0a5b5773bcc5a33a4abb041e82e2cccb318c78ef