How to install AMD drivers on ubuntu 20.

Getting AMD drivers installed without error on Ubuntu 20 is no easy task.  This is my attempt at giving back to the communiry.  But first here is my understanding of the problem.  If you download the latest release of Ubuntu you will get Ubuntu 20.4.2.  This release comes with the kernel 5.8.0-43.  This will not allow you to install AMD’s drivers.  What needs to happen is to install an older kernel 5.4.0-54 and then boot into that older kernel using the GRUB boot loader.  To do this reboot the PC and keep pressing the “esc” key.  It will launch an ascii screen and you will be able to see the kernels you have 5.8 and 5.4 most likely.  Select the 5.4 kernel and continue booting.  When the system comes up open a terminal window and “uname -a”.  You should see that the 5.4 kernel is in use.  This kernel will allow you to install the AMD GPU drivers.

What follows below is a more detailed process/procedure to do this.

install a new version of ubuntu.
I installed version

using uname -a this version was using kernel 5.8.0-43. This kernel would not
allow the AMD drivers to install so we used the 5.4.0-54 kernel

So here is what I did:

install the latest ubuntu onto a pc
sudo apt install openssh-erver
sudo apt install boinc-client boinc-manager

download the drivers from the amd website for your AMD GPU

create a directory called $HOME/Downloads/amd

mv the driver download tar file into $HOME/Downloads/amd and extract it using:
tar -Jxvf amdgpu-pro-20.40-1147287-ubuntu-18.04.tar.xz (your tar file name might be different based upon your amd driver selection)
this will create a directory with a name similar to the tar file.
cd into that directory but do not do anything except have a look

in order to install the AMD drivers you need to install a different kernel
and boot from it.
to show the current kernel do uname -a . for me I was running kernel 5.8.0-43
cd /usr/src
here you sould see two entries for the 5.8.0-43 kernel. you will delete these later in the procedure.

here is how to install a new kernel:
sudo apt install linux-image-5.4.0-54-generic linux-headers-5.4.0-54-generic linux-modules-extra-5.4.0-54-generic
this will install the 5.4.0-54 kernel

now boot into the 5.4.0-54 kernel by using grub. here is how
reboot the pc and keep pressing the “esc” key until the grub screen shows (skip down one line) and it will shou you
the installed kernels. The kernel that came with your installaion of ubuntu and the one you just installed, 5.4.0-54.
select the 5.4.0-54 option and hit enter. When the system comes up login to a terminal and uname -a. It should say
that your are running the kernel.

now we remove the 5.8.0-43 kernel:
sudo apt remove linux-image-5.8.0-43-generic linux-image-unsigned-5.8.0-43-generic

sudo apt autoremove

now install the drivers by “cd /$HOME/Downloads/amd/{driver_directory}
sudo ./amdgpu-install -y –opencl=pal,legacy

there should be no errors and there will be a moment where the script seems to hang but let it complete.

now you should be able to join Einstein@Home and download GPU work unites. Be sure to check you computer at E@H to be sure
that it is correctly identifying your GPU in the GPU column.