6

For my AMD Radeon RX 5700XT I tried amdgpu-pro drivers (v19.50) installation on modern (kernel 5.3) Ubuntu 18.04.3 as driver claims it's supported but compilation failed with C++ errors. Tried the same on 5.0 and 5.5.2 kernels with same results (on 5.5.2 kernel it was different error though: <drm/drmP.h>: No such file or directory).

Currently I'm on kernel 5.5.2 with mesa 19.3 installed. clinfo prints a lot of satisfying information seeming it's all cool, but with such tiny little line in-between:

fatal error: cannot open file '/usr/lib/clc/gfx1010-amdgcn-mesa-mesa3d.bc': No such file or directory

which causes kernels compilation to fail (with the same error).

Anyone having any luck getting navi10 GPU OpenCL working on Ubuntu any distro?

Slaus
  • 137

3 Answers3

3

So, I couldn't manage amdgpu/amdgpu-pro driver to install on Ubuntu 18.04 with all permutations of:

kernels 5.0,5.2,5.3,5.4,5.5

gcc 7,8,9 (every version was giving different errors which I was fixing to just get other errors)

amdgpu and amdgpu-pro versions 19.30,19.50

But I did manage to get OpenCL working ;) What eventually succeeded for me:

  • fresh Ubuntu 18.04.3 installation
  • update kernel to version 5.4 with ukuu (next (mesa) step fails on kernel version 5.5)
  • reboot
  • install mesa 19.3:

    sudo add-apt-repository ppa:kisak/kisak-mesa

    sudo apt-get dist-upgrade

    sudo apt-get update

  • reboot
  • install OpenCL:

    sudo apt install opencl-headers ocl-icd-libopencl1 clinfo

    sudo ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/libOpenCL.so

P.S. Exploring and learning about amdgpu-pro sources while trying to fix compilation errors I discovered that AMD devs implement forthcoming GPUs directly within mesa open-source drivers and Linux kernel - months before GPUs even released. So, to jusfify AMD devs a bit, that's where the development focus is - not on amdgpu-pro.

Slaus
  • 137
1

Glad you got it working, I saw your inquiry on a few other forums while trying to find a solution. I managed to get a somewhat working solution.

I also have the RX 5700XT, and I'm running Pop!_OS 19.10 on 5.5.5-050505-generic. For my PPA's, I have cappelikan, kisak, and oibaf; I suspect this is reproducible without them as I mainly have [a few of] them for general drivers (other than OpenCL).

I downloaded the amdgpu-pro drivers 19.50, and installed the following (in order):

Setting up amdgpu-core (19.50-967956) ...
Setting up amdgpu-pro-core (19.50-967956) ...
Setting up opencl-amdgpu-pro-comgr (19.50-967956) ...
Setting up opencl-amdgpu-pro-icd (19.50-967956) ...
Setting up libdrm2-amdgpu:amd64 (1:2.4.99-967956) ...
Setting up libdrm-amdgpu-amdgpu1:amd64 (1:2.4.99-967956) ...
Setting up libopencl1-amdgpu-pro:amd64 (19.50-967956) ...
Setting up clinfo-amdgpu-pro (19.50-967956) ...

To test if OpenCL works, I ran darktable-cltest and looked for successful outputs when loading the opencl kernel.

There is a big 'but' in all this: I cannot boot successfully (black screen, flashing lines). I'd have to CTRL+ALT+F2 and run ./amdgpu-pro-install --uninstall from the amdgpu-pro drivers directory, and then repeat the same steps above. I've tested this with the 5.3 and 5.5 kernel so far.

mikkeyboi
  • 63
  • 4
0

Just for the sake of completeness it should be added here that libclc was finally updated in January 2024.

Support for newer class Radeon hardware was added to libclc with LLVM MR #78884 which will be regularly available in LLVM 18. Check this topic here for more details.

So there should exist now some clover OpenCL support also for latest RDNA class hardware. But it should be regarded that this scenario is not really tested and the clover OpenCL API is overall not in a really good condition. There might exist especially problems with newer LLVM features like the "new" LLVM pass manager.

And by the way. There exist since quite some time no longer any support for GCN5 hardware in ROCm. But at least RDNA based GPUs should be supported.

Clemens
  • 541