OpenCL on the 6900 XT in Linux

Anyone get OpenCL working on the 6900 XT in Linux? If so, can you please share how? I know I’m not the only one having trouble.

Which thing do you want to work right? :wink:

Namely, ethminer. I’m experiencing the same core issue referenced in that thread. clinfo will correctly identify the device, but then it hangs, and when attempting to run ethminer, hashrate is 0.00 and it has to be force-killed to close it.

➜  ~  ls /opt/amdgpu-pro/lib/x86_64-linux-gnu/           [/code]
➜  ~ ls -go /lib/firmware/amdgpu | grep sienna*
-rw-r--r-- 1 263296 Apr  4 07:25 sienna_cichlid_ce.bin
-rw-r--r-- 1  97908 Apr  4 07:25 sienna_cichlid_dmcub.bin
-rw-r--r-- 1 263424 Apr  4 07:25 sienna_cichlid_me.bin
-rw-r--r-- 1 268592 Apr  4 07:25 sienna_cichlid_mec2.bin
-rw-r--r-- 1 268592 Apr  4 07:25 sienna_cichlid_mec.bin
-rw-r--r-- 1 263424 Apr  4 07:25 sienna_cichlid_pfp.bin
-rw-r--r-- 1 128608 Apr  4 07:25 sienna_cichlid_rlc.bin
-rw-r--r-- 1  34048 Apr  4 07:25 sienna_cichlid_sdma.bin
-rw-r--r-- 1 247396 Apr  4 07:25 sienna_cichlid_smc.bin
-rw-r--r-- 1 215152 Apr  4 07:25 sienna_cichlid_sos.bin
-rw-r--r-- 1 317184 Apr  4 07:25 sienna_cichlid_ta.bin
-rw-r--r-- 1 526912 Apr  4 07:25 sienna_cichlid_vcn.bin

I tried this with [email protected] and the rocm and rocm-opencl libraries. I reported bugs to the rocm project and they just closed it saying RDNA2 is not being implemented yet.

It does sort of work. I could run hashcat OK.

Edit: I was not using the amdgpu-pro stuff.

That being said I couldn’t even get FAH to use OpenCL on a Vega card (also F33).
Probably would need the amdgpu-pro stuff which I don’t want to use because I’m also gaming on it.

I wish they would apply the same streamlining they did with the AMD graphics stack to the compute stack…

I ended up creating a Manjaro VM and using the PKGBUILD file in this post to use OpenCL with my 6900XT. Worked great.

1 Like

Now I’m getting the itch to rewrite this for an RPM but I don’t think I got the time or motivation for it :eyes:

Attempts at overclocking using amdgpu-clocks has resulted in full system lockup requiring a hard reset. It doesn’t require any extreme overclocking either. Just running it a few times seems to crash everything, and doesn’t appear to actually change the clocks.

Something else I found interesting is that if I attempt to ssh into the system and start nsfminer, it doesn’t detect any usable devices, but if I start it directly from within a tmux session in XFCE it runs fine and I’m able to ssh and connect to the session.

Some discussion on 6900XT usage here

This configuration worked, but unfortunately, 1075MHz is the maximum allowed value for OC_MCLK.

0: 500MHz
1: 2400MHz
1: 1075MHz

edit Changed OD_VDDGFX_OFFSET because mining was throttling. Optimal value is probably somewhere between -25mV and -50mV.

I was able to get opencl “working” on debian bullseye with an rx6900xt.

The new AMD rocm software is a little fresh, and I think it was recent “unified” starting in 21.40.1. They have switched to an distro/repository style updater, rather than tarring up all the packages into one file.

As far as I can tell, the new version really doesn’t do anything without the DKMS kernel modules, which aren’t easily built out of the box on debian bullseye kernels (5.10 and 5.14). Ubuntu is using 5.11 and maybe an earlier, LTS kernel.

Things seems to work well in Ubuntu with the kernel modules, but not so much in debian. I ended up doing some unspeakable things to get it to work. It’s not the best solution and I don’t intend to use this as a daily driver. I don’t work with openCL; I was just curious if it was possible…

In a nutshell, I built the DKMS kernel modules in ubuntu and then transplanted the kernel, modules, and firmware into my debian system. It’s all the files in /boot /lib/modules/5.11 /usr/src/<5.11 stuff> and /lib/firmware/updates/amdgpu. I don’t know if this last one does anything in debian, but I included it anyway.

From there, I was able to download and install the 21.40.1 amdgpu-install deb and use that to install opencl support amdgpu-install --opencl=rocm --no-dkms --no-32.

There is a build dependancy for libstdc+±5 or -7?, so I made a fake debian package that provides those and installs libstd+±10-dev, which is in the debian repos.

There were a few incantations of update-grub and update-initramfs -vuk all to get crypto mounts and other things squared away.

Overall, it’s not recommended. Things work on the 5.11 kernel on ubuntu, but if I boot into a debian stock kernel, I lose my second screen. This is probably not a problem if you are using a headless server and actually use openCL for work or blender benchmarks. Let me know if you want more details, although I suspect that most people would prefer a more stable solution. I do expect the rocm drivers will improve with time, although it’s anyone’s guess on how long it would take.

AMD just released ROCM 5.0(.1).

This should work on debian Bullseye with the 5.10 kernel now, with a few caveats. The backports kernel is still too fresh and not supported with the kernel modules.

The caveats are that you will need a fake package so that the installer thinks that libstdc-7 is installed. libstdc-10 is installed in Bullseye and doesn’t seem to cause any problems.

I haven’t tested this extensively, so YMMV. I do expect better ROCM support in debian soon since it looks like there are debian developers/packagers working on it. There are some rocm packages popping up in Sid.