A quick guide: How to install OpenCL for AMD GPUs on Linux Kubuntu 18.04 (and similar distro)

Gary Roberts
Gary Roberts
Moderator
Joined: 9 Feb 05
Posts: 5845
Credit: 109922204920
RAC: 31199258

cecht wrote:... only for the

cecht wrote:
... only for the new RX 5700 Navi cards).

When I first read that, I thought, "Surely that can't be right!!!" ...  I should have known better :-).  Yes, indeed, that's exactly what it says on the box :-).  I was momentarily tempted to 'correct' you until I decided that it would be much more sensible to check for myself :-)

However, when you look at the download size of 19.30 compared to 19.20 (for Ubuntu) it seems very likely that all the previous stuff (plus a bit more) is still there.  I imagine a package just for RX 5700 Navi would be rather smaller if the support for all the other models had been culled.  Based on your experiences, the support for (at least some) older models must be there but I suspect AMD are trying to protect the users from potential problems (and themselves from the bad publicity) in the event that some of the new stuff has 'unintended consequences' for older hardware:-).

So it's good to know there didn't seem to be anything of that nature in your case :-).

Cheers,
Gary.

QuantumHelos
QuantumHelos
Joined: 5 Nov 17
Posts: 190
Credit: 64239858
RAC: 0

cecht wrote:Koschi

cecht wrote:
Koschi wrote:
Being on Ubuntu 18.04. is not enough, the driver only compiles against kernel 4.15. 4.18/4.19/4.20 didn't work, so I had to revert back to 4.15.

Yes. On my new host, I first installed Lubuntu 18.04, since that what I'm running on my other host with a couple AMD cards. But that new install loaded the Linux 4.18 kernel and so I couldn't load amdgpu 18.5 drivers (when I tried, the install had warnings and the system would freeze at boot with a blank screen). I then realized on that other host, I had first installed Lubuntu 16.04, which loads the Linux 4.15 kernel, and when I upgraded to 18.04, it retained the 4.15 kernel, which works with the amdgpu 18.5 drivers. Up until then, being a newbie, I had no idea that kernels were distinct from the rest of the system.

On the new host I couldn't change the GRUB_DEFAULT boot sequence to grab the 4.15 kernel instead of the default 4.18 kernel because I had mindlessly clicked the Lubuntu 18.04 install option for LVM, which prevented changing the default kernel in GRUB. (I could manually select the 4.15 kernel at boot, but I didn't want to go that route for every reboot/restart.) So I started over and installed Lubuntu 16.04 to get the right default kernel, then installed amdgpu 18.4 (not 18.5), which is the most recent version for Ubuntu 16.04, and OpenCL. I was planning to just stick with that 16.04 configuration, but a utility that I use to control my RX 570 cards requires Python 3.6, which is not part of the 16.04 package. So *sigh*, I upgraded to Lubuntu 18.04, which does include Python 3.6, but stuck with the amdgpu 18.4 drivers, and everything now works fine.

 

The thing with AMD drivers is that you need to uninstall the previous driver completely first before installing the new one.. ROCm sounds promisingly likely to improve with the laboratories promising to improve ROCm with cray ...

https://www.phoronix.com/scan.php?page=news_item&px=Radeon-ROCm-2.3-Released

https://rocm.github.io/blog.html

https://github.com/RadeonOpenCompute/ROCm

ROCm & Vulkan Drivers

run this after downloading file (google drive): https://is.gd/Install_gpl_ROCm_amd_drv_sh

sudo chmod 774 Install-gpl-ROCm-amd-drivers.sh
sudo ./Install-gpl-ROCm-amd-drivers.sh

RS

cecht
cecht
Joined: 7 Mar 18
Posts: 1432
Credit: 2468131931
RAC: 897108

Here's an update from a prior

Here's an update from a prior posting on this forum. That AMDGPU 19.3 driver stack worked well on my hosts with Ubuntu 18.04 and a Linux 4.5 kernel, until it didn't. Short story: I could get everything working again with 19.2 drivers on a Linux 5.0 kernel.

The AMDGPU 19.3 drivers actually knocked a few seconds off task times and ran fine for weeks, but a few days ago I noticed that amdgpu-utils could no longer adjust certain GPU settings. I knew that the problem wasn't with amdgpu-utils because it persisted in older versions. I thought it would be wise to first try reinstalling the AMDGPU drivers, but use the most recent supported driver, 19.2, for my RX460s & RX570s. I'll skip the sordid details of my bumbling around and dealing with various snafus and just summarize what I think were the relevant steps that I did on two hosts.

For uninstalling drivers, I used the command amdgpu-uninstall from within the downloaded amdgpu-pro-19.2-812932-Ubuntu-18.04 driver directory; for installing All-Open drivers, I used ./amdgpu-install; for installing OpenCL, ./amdgpu-pro-install --opencl=legacy --headless.

What I did: Uninstalled AMDGPU 19.3 driver, installed 19.2, rebooted, installed OpenCL, rebooted. At this stage the drivers weren't working and I still had the 14.5 kernel. So I uninstalled 19.2, reinstalled it, rebooted, installed OpenCL, rebooted, et voila!, the drivers now worked and the system was running a Linux 5.0 kernel. During the 19.2 uninstallation, I noticed in the verbose terminal output that kernel 5.0 components were being unpacked, but did not notice anything about 5.0 kernel components during the first 19.2 installation.

So, any ideas why a kernel update happened during the uninstallation process? Should I have gone about this differently? I'm not sure whether the 5.0 kernel would have been installed, and everything work as it should, with an uninstall/reinstall of the AMDGPU 19.3 driver.

EDIT: Fixed typos of kernel versions (14.5 -> 4.5; 15.0 -> 5.0)

Ideas are not fixed, nor should they be; we live in model-dependent reality.

Matt White
Matt White
Joined: 9 Jul 19
Posts: 120
Credit: 280798376
RAC: 0

I just added an RX560 to my

I just added an RX560 to my LINUX box. The information on this thread was quite helpful.

Thank you all!

Clear skies,
Matt
Matt White
Matt White
Joined: 9 Jul 19
Posts: 120
Credit: 280798376
RAC: 0

koschi wrote:I did try ROCm,

koschi wrote:

I did try ROCm, it was almost double the speed of Mesa/Clover OpenCL here at Einstein. However, OpenCL from 18.50 still outperformed ROCm by a few percent.

 

 

I did have a question; what exactly are the ROCm drivers? Are they used for different applications other than opencl? In my setup, I installed the opencl using the legacy,pal and headless options which appears to be working fine.

Clear skies,
Matt
Rolf
Rolf
Joined: 7 Aug 17
Posts: 27
Credit: 135377187
RAC: 0

What exactly are the Rocm

What exactly are the Rocm drivers. I haven't dug into the details but it used to be based on amdgpu-pro drivers, so when you installed Rocm you got amdgpu-pro as well. They are moving away from amdgpu-pro but are still using some of the AMD proprietary binaries, from what I understand.

They are developping opencl so it can be run on more platforms, such as on the CPU and on APUs. They are also developing monitoring- and analysis tools, profilers. I think the main goal though is to develop alternatives to opencl because it has big entry barriers knowledge-wise but also when you run opencl there is a lot of overhead to start the program and feed the data. With Rocm you can make compute calls to the GPU inline in c or python, and the GPU will read and write directly in the memory.

In this process they have had to do changes to drivers and make small improvements to them.

Matt White
Matt White
Joined: 9 Jul 19
Posts: 120
Credit: 280798376
RAC: 0

Thanks. I did some digging

Thanks.

I did some digging and came up with the gist of what you said. I guess if E@H begins coding applications which are specifically geared for ROCm, I'll need to install it. For now, I'm leaving well enough alone.

Clear skies,
Matt
cecht
cecht
Joined: 7 Mar 18
Posts: 1432
Credit: 2468131931
RAC: 897108

Matt White wrote:I did some

Matt White wrote:
I did some digging and came up with the gist of what you said. I guess if E@H begins coding applications which are specifically geared for ROCm, I'll need to install it. For now, I'm leaving well enough alone.

There is more in-depth discussion on ROCm among Quantumhelos, Rolf, and Gary Roberts, beginning at this message on the "A very long standing issue I work on sporadically makes some progress ..." forum. It's worth a read through before diving into ROCm. There is also a ton of other interesting technical info in that forum.

Ideas are not fixed, nor should they be; we live in model-dependent reality.

cecht
cecht
Joined: 7 Mar 18
Posts: 1432
Credit: 2468131931
RAC: 897108

cecht wrote:So, any ideas why

cecht wrote:
So, any ideas why a kernel update happened during the uninstallation process? Should I have gone about this differently?

A: I could have waited a few days for the Ubuntu 18.04.3 update, which includes the Linux 5.0 kernel, https://www.omgubuntu.co.uk/2019/08/ubuntu-18-04-3-point-release

Ideas are not fixed, nor should they be; we live in model-dependent reality.

robl
robl
Joined: 2 Jan 13
Posts: 1709
Credit: 1454549971
RAC: 3893

Today I noted that an Ubuntu

Today I noted that an Ubuntu PC was offering to upgrade to the newest release so I opted to do this.  Got all the way through the process and encountered total failure on the reboot.  Could not get passed the Gnome Display manager.  No matter what I did I was stuck so I loaded up a USB thumb drive and reloaded a new release of Ubuntu.  I then "rejoined" einstein@home but could not get any gpu work.  I forgot that I had a Radeon RX 550 card.  This card would need AMD driver support so here is what I did in a cut and paste format:

  1. download amd drivers for card
  2. to find out what card you have on ubuntu: lspci | grep VGA
  3. 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 550 640SP / RX 560/560X] (rev cf)
  4. go to amd website and download the drivers for the Radeon RX 550.
  5. place the driver file ending in xz in the $HOME/Download directory 
  6. unwindit it: tar -xf amdgpu-pro-19.20-812932-ubuntu-18.04.tar.xz
  7. run the following script in the "xz" file:
  8. ./amdgpu-pro-install -y --opencl=pal,legacy
  9. reboot the pc when the script finishes. you should now be ready to
  10. crunch on einstein@home i.e. download gpu Work Units.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.