Mining on Linux with AMD graphics cards has always been a pain, especially since their AMDGPU-Pro drivers typically cause black screens! A lot of people end up having to resort to mining on Windows or using the outdated Ubuntu version that AMDGPU-Pro is supposedly compatible with. This guide takes AMD’s poorly designed installer and so much frustration out of the picture!
I’ve tested these instructions on Ubuntu 18.04, Debian Buster, and Fedora Rawhide, and Arch. I highly recommend these versions of these distributions if you use Vega. Also, you might want to be on a fresh installation of your OS. There are some complications you may have otherwise.
This guide has three sections, in order of difficulty:
Yes, the Arch section really is easier than Fedora.
I’ve also thrown in steps for installing basic miner libraries in all the sections of my guide. Hopefully that will make setting up miners a little easier for you guys. 😃
Debian/Ubuntu Guide:
(Debian only) I’m assuming you already have sudo installed and have also enable the contrib and non-free repositories. https://serverfault.com/questions/240920/how-do-i-enable-non-free-packages-on-debian
(Debian only) Install firmware-linux-nonfree.
sudo apt install fimware-linux-nonfree
Download amdgpu-pro-18.20-579836.tar.xz from https://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-18.20-Early-Preview-Release-Notes.aspx.
You’ll need to click the link that says “Radeon™ Software for Linux® EPR version 18.20 for Ubuntu 18.04.”
Extract the archive and put amdgpu-pro-18.20-579836 directory under your home directory.
Whatever you do, DO NOT run the installer script that AMD includes!
Install the AMDGPU-Pro OpenCL libraries:
cd into the amdgpu-pro-18.20-579836 directory and run:
sudo dpkg -i opencl-amdgpu-pro-icd_18.20-579836_amd64.deb clinfo-amdgpu-pro_18.20-579836_amd64.deb libopencl1-amdgpu-pro_18.20-579836_amd64.deb amdgpu-pro-core_18.20-579836_all.deb amdgpu-core_18.20-579836_all.deb
(Ubuntu only) Install libcurl3.
sudo apt install libcurl3
Reboot your computer.
See if OpenCL works by running clinfo.
/opt/amdgpu-pro/bin/clinfo
If the clinfo output looks something like this, you are ready to go.
Arch Guide:
First, let’s get some important OpenCL and miner-related libraries installed.
sudo pacman -S ocl-icd librtmp0 libldap libsasl
yaourt -S opencl-amd ncurses5-compat-libs libcurl-openssl-1.0
You should also install clinfo to check if OpenCL actually is working.
sudo pacman -S clinfo
Run clinfo and look at the output.
clinfo
If the clinfo output looks something like this, you are ready to go.
If you are mining, add this line to the top your Avermore Miner or Claymore Dual Miner startup script:
export LD_PRELOAD="/usr/lib/libcurl-openssl-1.0.so.4.5.0"
If you don’t want to install libcurl-openssl-1.0, get libcurl.so.4.2.0 from the libcurl3 package on the Debian wheezy (oldstable) repository. Use this line in your startup script instead.
export LD_PRELOAD="/your-miner-directory/libcurl.so.4.2.0"
Fedora Guide:
This is going to be a bit more difficult than the other sections. If you run Fedora, you’re probably experienced enough with the Linux terminal to handle it. ;)
I’ve boiled this down to a reasonable number of steps after a lot of trial, error, and Google-fu. You can thank AMD for these extra steps. ::)
You’ll want to have rpmrebuild and nano installed before continuing.
First, let’s get some important miner-related libraries installed.
sudo dnf install ncurses-libs ncurses-compat-libs
Download amdgpu-pro-18.20-579836.tar.xz from https://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-18.20-Early-Preview-Release-Notes.aspx.
You’ll need to click the link that says “Radeon™ Software for Linux® EPR version 18.20 for RHEL 7.5 .”
Extract the archive and put amdgpu-pro-18.20-579836 directory under your home directory.
Whatever you do, DO NOT run the installer script that AMD includes!
Next, let’s get rid of some code AMD threw into one of their packages that will prevent installation on Fedora.
CD into the amdgpu-pro-18.20-579836 directory.
Run this command on the amdgpu-core package.
EDITOR=nano rpmrebuild --edit-pre -p RPMS/noarch/amdgpu-core-18.20-579836.el7.noarch.rpm
An editor should come up, showing you the pre-install script in the rpm package.
Delete everything. Press control-o and then enter to save. Press control-x to exit the editor.
Type “y” to continue and press enter.
Copy the location of the rpm file this tool spits out.
Now paste this long command into your terminal and press enter to install a few required packages. Make sure to use the location of the rpm file made by rpmrebuild! For me, rpmrebuild stuck it under ~/rpmbuild/noarch.
|
|
Run
sudo ldconfig
and then restart your computer.
Now run
opt/amdgpu-pro/bin/clinfo
If the clinfo output looks something like this, you are ready to go.