Ubuntu – How to get OpenCL support for navi10 GPUs from AMD

amd-graphicsamdgpu-prokernelopencl

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?

Best Answer

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.

Related Question