I have a AMD grahpics card and use the great Open Source driver which comes with my Linux distribution. However for image processing I want the OpenCL support of my graphics card. Currently that’s only provided by the amdgpu-pro driver. However it is possible to just extract the files needed for OpenCL and use them. Here is how to do this:
Choose a platform, SLED or RHEL and download the package
Extracting
For extracting the required libraries, I use Midnight Commander (mc). You can use them to browse the RPMs. From the following RPM you need to copy the mentioned libraries to /opt/amdgpu-pro/lib64/
I’m running Kernel 4.15.6 on openSUSE Tumbleweed. I’m running the AMD Kernel Open Source driver shipped with that Kernel.
However there is no AMD OpenCL implementation in Mesa (clover) with the imaging support needed by darktable and others. So instead of the Mesa OpenCL driver you need to use just the OpenCL bits from the proprietary driver.
@asn is ROCm any better than AMDGPU PRO 18.20 for darktable (and Gimp)? I’ve just upgraded my hardware and bought used Radeon RX 480 8GB. I have Ubuntu 18.04.2 with kernel 4.18. I have a dilemma what to use. Have you got those steps wrote done anywhere? Thanks.
@asn
I tried last night both ROCm and AMPGPU PRO 18.50 and have the same issue with kernel driver for Ubuntu 18.04.2 (4.18). I was able to compile the driver amdgpu but after that darktable or clinfo segfaults.
Now I see that you don’t use rock-dkms at all. You use opensource kernel driver?
I tried to install amdgpu-pro with options --headless and --opencl=legacy,pal.
I did a similar thing on Fedora and Debian. The opencl-amdgpu-pro, libopencl-amdgpu-pro and clinfo-amdgpu pro RPMs were the only ones needed on F29 for OpenCL. You no longer need the dkms RPMs with the newer drivers. I tried to update it on Debian and it still needed the dkms for some reason and didn’t like the 4.19 kernel in Buster/Testing for some reason. The older Testing kernel it didn’t complain about. Put and nVidia card back in that machine for now but the main workstation is running Vega 56, amdgpu mesa and amdgpu-pro OpenCL just fine.
It doesn’t like the 4.18 in Ubuntu either. Clinfo and darktable-cltest crashes with the kernel amdgpu driver.
I figured out what it the problem with dkms and was able to compile the pro kernel driver but I’m not sure if this is sufficient. Haven’t tried the compiled driver yet.
Kernel 4.18 should be supported in next ROCm release from what I learnt.
It looks like opencl is working. clinfo returns proper data.
However first launch of darkatble-cltest showed something like this in logs:
5.113568 [opencl_init] benchmarking results: 0.080698 seconds for fastest GPU versus 0.085221 seconds for CPU.
5.113582 [opencl_init] due to a slow GPU the opencl flag has been set to OFF.
After re-enabling the OpenCL support everything is fine.
Well almost fine. The issue with the Local contrast module is really turning images into kind of mosaic. Had to disable this cl file.
Thank you @asn for your support!
@asn I tried to extract the OpenCL library from the 19.10 driver like you described in the original post, but Darktable crashes for me with a segfault in libamdocl-orca64.so. ROCm is not yet an option for me, since my Vega M is not yet supported by ROCm.
Could you give me a hint for how to debug my problem? I think I might be missing another binary, possibly.
I’m trying to move to ROCm as the latest amdgpu-pro drivers now have some pretty strict OS checks and only install on RHEL/Cent for RPM based distros. Looks like they went back to requiring the kernel modules too.
At any rate I installed those four RPMs on Fedora and clinfo/rocminfo sees my devices but Darktable still reports OpenCL is not available.
Hi @ash,
I just installed RX590 and I tried to follow your steps on Ubuntu 19.10. Unfortunately not all expected files are in the files as described neither in amdgpu-pro-19.50-967960-sle-15.tar.xz nor in amdgpu-pro-19.50-967956-rhel-8.1.tar.xz.
The Ubuntu installation insists to install only on Ubuntu 18.04 which is on not much help.
I was just wandering if I can try the files you already have extracted on Ubuntu 19.10, if you don’t mind sharing there files.
Script is simple enough to read what’s it doing but read all comments first (and ignore those that say “The Absolute Perfect Guide for Installing Opencl on Ubuntu/Linux Mint/Debian buster”).