OpenCL not working with RX 6700 XT

Card: RX 6700 XT

Ubuntu version: 20.04.2 LTS

Amdgpu version: 21.10

Problem: Running clinfo or sudo clinfo returns 1 platform, 0 devices. This problem is the same as the one mentioned here.

Installation method:

  1. Download and extract file from https://drivers.amd.com/drivers/linux/amdgpu-pro-21.10-1247438-ubuntu-20.04.tar.xz
  2. Run: ./amdgpu-pro-install -y --opencl=rocr --headless (also tried --opencl=legacy,rocr)
  3. Add user to render and video group
  4. Reboot
  5. clinfo or sudo clinfo returns this

I have also tested:

  • The regular amdgpu (./amdgpu-install), no luck.

  • EDIT: Also tried this: ./amdgpu-install -y --opencl=rocr --no-dkms, has this error when installing

  • EDIT: Tried downgrading kernel then installing with and without --headless option

  • At one point I added mesa-opencl-icd and clinfo worked but it didn't seem like it was even using the amdgpu drivers so I got rid of it (sorry because when I tried adding it again it didn't work for some reason). It shouldn't need that package anyway though...

  • Amdgpu pro + ROCm installed (EDIT: Just tested ROCm only, doesn't work)

  • The clinfo that comes with amdgpu-pro (/opt/amdgpu-pro/bin/clinfo)

  • Contacting AMD support (hehe)

Extra notes:

  • sudo radeontop cannot identify the device as an RX 6700 XT (i.e. "Unknown Radeon card. <= R500 won't work, new cards might.")
  • Interesting: in /opt/amdgpu/share/libdrm/amdgpu.ids there is a list of cards, ids and revision ids. However, there is no RX 6700 XT listed there. lspci shows that my card has the id of 73df (rev c5) and that is not listed in the file either. Maybe I should add it manually? Also all of the other 6000 series cards are there, just not the 6700 and 6700 XT.
  • Edit: Sometimes on kernel 5.8 dkms installs properly and other times it doesn't. Downgrading to 5.4 seems to install it consistently though, but then again OpenCL still doesn't work as mentioned above.

Solution 1:

I had the same problem (same card/os, clinfo returns 1 platform, 0 devices) with amdgpu-pro drivers installed, and in my case installing `mesa-opencl-icd` did fix the problem. I'd just reinstalled my OS, so had just the default mesa drivers (20.2.6) and amdgpu-pro (21.10) on it. Now it recognizes the card correctly, and seems to be using it. Might be worth another shot!

EDIT: Nope! It seemed to be working, but was using the mesa opencl drivers which didn't work for what I needed (no image support).

Through an awful lot more hair-tearing I found installing ROCm directly worked, alongside the kisak mesa drivers ppa.

See: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html

Solution 2:

Solved! Credit to Oisin Carroll.

UPDATE: This problem has now been fixed by AMD. ROCm now supports kernel 5.8.0-48-generic.

Fix:

  1. Boot into kernel 5.6-oem (any one will do, I used 5.6.0-1056-oem).
  2. Follow guide here

If you get an error saying dependencies not met when following the guide:

  1. sudo apt install aptitude
  2. sudo aptitude install rocm-dkms
  3. Choose the 'N' option when it asks for it.
  4. Reboot