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

Millenium
Millenium
Joined: 8 Oct 14
Posts: 21
Credit: 33102476
RAC: 0
Topic 216488

You installed Linux on you computer, you run BOINC and you notice it does not download any GPU WU. You have a recent AMD graphic card, you already know that this Linux version already have the open source drivers called AMDGPU so why it does not work? Easy: you still have to install the OpenCL drivers.

To do that you just have to go on the official AMD website and look for your drivers https://www.amd.com/en/support and download the correct Linux one, right now the recent version is 18.30, so get it and extract the content in a folder.

Now use the terminal, move inside that folder, and just run ./amdgpu-pro-install --opencl=legacy,pal --headless

It will install only the OpenCL part of the AMDGPU-PRO drivers and preserve the open AMDGPU drivers already installed. Just restart and BOINC should now recognize your graphic card.

koschi
koschi
Joined: 17 Mar 05
Posts: 86
Credit: 1711040292
RAC: 525861

Small side note, this also

Small side note, this also works for the AMDs Ryzen APUs. I convinced an R5 2400G under Ubuntu 18.04 to chew some GPU WUs, good stuff!

Millenium
Millenium
Joined: 8 Oct 14
Posts: 21
Credit: 33102476
RAC: 0

That's great, I suppose that

That's great, I suppose that these Ryzen APUs are pretty fast!

Anonymous

I too would like to add

I too would like to add support to this effort.  Today I reinstalled Ubuntu 18 on a PC that had been running on Ubuntu 16.

The following link lists other links for various flavors of Linux software/drivers (Downloads):

the entire install procedure can be read here:

https://support.amd.com/en-us/kb-articles/Pages/Installation-Instructions-for-amdgpu-Graphics-Stacks.aspx

I will now try to shorten this procedure

I assume that the download will be in $HOME/Downloads

  • cd ~/Downloads
  • tar -Jxvf amdgpu-pro-18.10-NNNNNN.tar.xz
  • Enter the directory where the downloaded archive was extracted (this is expected to be the same name as the archive file).
  • cd ~/Downloads/amdgpu-pro-18.10-NNNN
  • ./amdgpu-install -y
  • reboot
  • ./amdgpu-pro-install -y --opencl=legacy
  • reboot

If you want to remove all of this you can:  "amdgpu-pro-uninstall" and start again
 
For me what got this to work was the line with the "opencl=legacy".
Millenium
Millenium
Joined: 8 Oct 14
Posts: 21
Credit: 33102476
RAC: 0

I have a doubt about your

I have a doubt about your procedure, the purpose of running ./amdgpu-install -y is doubtful to me, AMDGPU is already installed in the kernel and there is no need to somehow modify it. 

Anonymous

Millenium wrote:I have a

Millenium wrote:
I have a doubt about your procedure, the purpose of running ./amdgpu-install -y is doubtful to me, AMDGPU is already installed in the kernel and there is no need to somehow modify it. 

This was a new/clean install of Ubu18.  It is quite possible that I did fail to notice that "amdgpu-install -y" was installed. But i do know that "amdgpu-pro-install -y --opencl=legacy" was an absolute requirement for me to get Ubu 18 to recognize my GPU

Millenium
Millenium
Joined: 8 Oct 14
Posts: 21
Credit: 33102476
RAC: 0

AMDGPU is already installed

AMDGPU is already installed in the kernel so no need to modify it (actually if you install the one in amdgpu-pro you end up with a different one, that is exactly the point of this thread: how to install OpenCL without modifying the already installed open source AMDGPU wich we want to keep) but as you rightly said, OpenCL is not and must be installed manually. So you only need to run "amdgpu-pro-install -y --opencl=legacy" to install OpenCL and you are fine.

./amdgpu-pro-install --opencl=legacy,pal --headless  (I prefer to also use the --headless option)

Anonymous

Millenium wrote:AMDGPU is

Millenium wrote:

AMDGPU is already installed in the kernel so no need to modify it (actually if you install the one in amdgpu-pro you end up with a different one, that is exactly the point of this thread: how to install OpenCL without modifying the already installed open source AMDGPU wich we want to keep) but as you rightly said, OpenCL is not and must be installed manually. So you only need to run "amdgpu-pro-install -y --opencl=legacy" to install OpenCL and you are fine.

./amdgpu-pro-install --opencl=legacy,pal --headless  (I prefer to also use the --headless option)

thanks for clarifying.

Millenium
Millenium
Joined: 8 Oct 14
Posts: 21
Credit: 33102476
RAC: 0

As of now the most recent

As of now the most recent version is 18.50

koschi
koschi
Joined: 17 Mar 05
Posts: 86
Credit: 1711040292
RAC: 525861

I have now added an RX580 to

I have now added an RX580 to my desktop (previously GTX 1060 3GB) and installed OpenCL from AMDGPU 18.50. Lessons learned so far:

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. Ubuntu 18.10 should hence not be able to use the AMD provided driver.

With GTX 1060 as primary card (monitor connected, displaying desktop) and the RX580 in another slot, X doesn't come up.  "Error: Unable to find display on any available system". From what I found that might be connected to Kernel Mode Setting, which the Nvidia driver requires for X / desktop usage, while the AMD driver works without. I have yet to try it the other way around, AMD as primary, Nvidia just for compute. People wrote somewhere on the web that in that case the Nvidia might not need KMS and it "could" work.

Driver 18.20 worked as well, but gave me a flicker every now and then, when I moved the mouse while being on bright web pages or backgrounds. This disappeared once I upgraded to 18.50 again.

I started with 2 parallel WUs straight away. Without any tuning 2 WUs finished in ~1050 seconds, power cap was at 175W, using just 150W of that though. 120W caused almost no impact on the run time. 100W pulled the run time down to 1080 seconds. That way GPU temps are at just 64°C with the fans spinning at 800rpm. 

Will try to put in the GTX 1060 as secondary card, maybe later play with GPU voltages, memory clock etc...

 

edit:

I hope I'll find the time to try Ubuntu 18.10/19.04 in next weeks, going the fully open source way with recent MESA, ROCm and what not, I still need to wrap my head around all that though. 

 

edit2:

AMD and Nvidia in the same computer works, as long as the Nvidia is the secondary / compute only card:

https://einsteinathome.org/host/4012091

Millenium
Millenium
Joined: 8 Oct 14
Posts: 21
Credit: 33102476
RAC: 0

Confirming that the current

Confirming that the current AMDGPU 18.50 driver only work for Ubuntu 18.04.1 and its kernel (and of course kubuntu and others), if you update the 18.04 kernel or if you install Ubuntu 18.10 or 19.04 it does not work.

I am currently trying Kubuntu 19.04 (wich btw works very well) and the driver does not install, so no OpenCL at all for now. I hope an update will come soon after 19.04 is officially released in April.

Comment viewing options

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