Can't get OpenCL to work

Hope someone may advise…
Maybe where I could find info about how to handle this.
And I would very much like it to work as darkroom gets very slow when processing 3 instances of diffuse or sharpen.

Do I need to get AMD ROCm to work?

Darktable preferences shows:

darktable-cltest gives:
darktable 5.2.0
Copyright (C) 2012-2025 Johannes Hanika and other contributors.

Compile options:
Bit depth → 64 bit
Debug → DISABLED
SSE2 optimizations → ENABLED
OpenMP → ENABLED
OpenCL → ENABLED
Lua → ENABLED - API version 9.5.0
Colord → ENABLED
gPhoto2 → ENABLED
OSMGpsMap → ENABLED - map view is available
GMIC → ENABLED - Compressed LUTs are supported
GraphicsMagick → ENABLED
ImageMagick → DISABLED
libavif → ENABLED
libheif → ENABLED
libjxl → ENABLED
LibRaw → ENABLED - Version 0.22.0-Devel202502
OpenJPEG → ENABLED
OpenEXR → ENABLED
WebP → ENABLED

See resources | darktable for detailed documentation.
See Sign in to GitHub · GitHub to report bugs.

 0.5317 [opencl_init] opencl disabled via darktable preferences
 0.5318 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
 0.5319 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
 0.5320 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
 0.6260 [opencl_init] found 1 platform
 0.6260 [opencl_init] no devices found for Advanced Micro Devices, Inc. (vendor) - AMD Accelerated Parallel Processing (name)

[opencl_init] found 0 device
0.6260 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

sudo lshw -c video:
*-display
description: VGA compatible controller
product: Lexa XT [Radeon PRO WX 3100]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0
bus info: pci@0000:01:00.0
logical name: /dev/fb0
version: 00
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom fb
configuration: depth=32 driver=amdgpu latency=0 resolution=2560,1440
resources: irq:162 memory:c0000000-cfffffff memory:d0000000-d01fffff ioport:e000(size=256) memory:dfe00000-dfe3ffff memory:c0000-dffff

My system:

System Details Report


Report details

  • Date generated: 2025-07-21 22:46:37

Hardware Information:

  • Hardware Model: ASRock Z370 Extreme4
  • Memory: 32.0 GiB
  • Processor: Intel® Core™ i7-8700K × 12
  • Graphics: AMD Radeon™ Pro WX3100
  • Disk Capacity: 15.0 TB

Software Information:

  • Firmware Version: P4.20
  • OS Name: Ubuntu 24.04.2 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.14.0-24-generic

You need to install the opencl drivers for Ubuntu. Search the threads because other have posted the Ubuntu instructions. I would trust kofa advice.

1 Like

Thank you for your trust, but I’ve never owned an AMD card, so won’t be able to help with that. The search should work, we’ve had AMD topics lately.

1 Like

Thanks @g-man I will… and I did quite some searching around but failed to recognize what I needed… we may call this a blatant lack of knowledge. Making it very easy to ruin something when trying semi logical steps more or less in the blind. Lost my second screen yesterday when amdgpu became blackflagged. I will learn. :grimacing:

Again… I will :innocent:, only…

I do trust your advice though…

Kind regards, Jetze

Total noob here regarding drivers for linux, but I struggled with the same problem, so maybe this could be related: I had all drivers and opencl etc. installed (seemed to be by default on opensuse just by installing darktable), but I had to additionally disable safeboot (or secureboot?) in the bios. Apparently the gpu drivers would not load even though installed if safeboot was enabled. Just my 2c.

Harri

Easiest way to get opencl and amdgpu running on Ubuntu is using the rusticl drivers. I have mesa-opencl-icd-24.0.5-1ubuntu1 installed. Probably it’s enough to select this file and install it with its dependencies.
To start darktable with rusticl support, you need to set an environment variable. I am starting darktable with

RUSTICL_ENABLE=radeonsi /opt/darktable/bin/darktable -d perf -d opencl --configdir ~/.config/darktable

I think i’ve made a small step, darktable-cltest says:
0.5057 [opencl_init] opencl disabled via darktable preferences
0.5059 [opencl_init] opencl library ‘libOpenCL’ found on your system and loaded, preference ‘default path’
0.5444 [opencl_init] found 1 platform
0.5444 [opencl_init] no devices found for Advanced Micro Devices, Inc. (vendor) - AMD Accelerated Parallel Processing (name)
[opencl_init] found 0 device
0.5445 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

I found another thingy, do not know if it matters actually. In /etc/modprobe.d
there is a file blacklist-radeon.conf which contains the phrase “blacklist radeon”.

Should I simply remove this file? It is generated a bit over two month ago. Don’t know why and how.

Somehow the last step in the chain to activate OpenCL is still blocked.

Thanks @dirksagwitz I may try your route when I will not be successful otherwise. Kind regards, Jetze

As I said, I don’t use AMD, but if I remember correctly, radeon is a legacy driver. Please double-check that.

Thanks Harri, it did not help, it was already disabled.
Kind regards, Jetze

Check whether your user is a member in render and video groups.

Thanks @sugarbravo, I am, but does that mean automatically that darktable has the proper memberships?

Yes, when run by your user.

1 Like

It is surely run by me…
image

Just to verify—

There is amdgpu kernel module loaded. This should happen automatically, but just in case:

lsmod|grep amdgpu

If not loaded, try:

sudo modprobe -v amdgpu

There also is rocm-opencl-runtime installed.

apt policy rocm-opencl-runtime

If not, instructions at rocm.docs.amd.com.

clinfo -l should list found/supported OpenCL platfoms and devices. If it shows AMD platform, but no device, then unfortunately the GPU may not be supported (anymore?)… The latest driver here seems to be from 2023.

$ lsmod|grep amdgpu
amdgpu 19718144 37
amddrm_ttm_helper 12288 1 amdgpu
amdttm 114688 2 amdgpu,amddrm_ttm_helper
amddrm_buddy 24576 1 amdgpu
amdxcp 12288 1 amdgpu
drm_exec 12288 1 amdgpu
drm_suballoc_helper 20480 1 amdgpu
amd_sched 61440 1 amdgpu
amdkcl 28672 3 amd_sched,amdttm,amdgpu
drm_display_helper 278528 1 amdgpu
cec 94208 2 drm_display_helper,amdgpu
i2c_algo_bit 16384 1 amdgpu
drm_ttm_helper 16384 1 amdgpu
video 77824 1 amdgpu

So yes amdgpu is there.

Positive as well:
apt policy rocm-opencl-runtime
rocm-opencl-runtime:
Installed: 6.4.1.60401-83~24.04
Candidate: 6.4.1.60401-83~24.04
Version table:
*** 6.4.1.60401-83~24.04 100
100 /var/lib/dpkg/status
5.2.3.50203-109 600
600 Index of /rocm/apt/5.2.3/ ubuntu/main amd64 Packages

And here it fails me:
$ clinfo -l
Platform #0: AMD Accelerated Parallel Processing

Does this mean that my Radeon Pro WX3100 is not supported?

Thanks for helping!

Kind regards, Jetze

Have you tried it already with rusticl?

Is there support for your graphic card?

If you want to try, install
ocl-icd-libopencl1 and mesa-opencl-icd

set system variables

export RUSTICL_ENABLE=radeonsi
export OCL_ICD_VENDORS=rusticl.icd

and have a look if that works. ROCm worked always a bit faster for me but on the downside not very stable. With rusticl dt runs rock solid and I’m happy.

I’m running Debian and have a RX 5700XT.

Thanks for supporting me, not yet have I tried, @dirksagwitz also advised doing so, So if I will not progress I will surely do. I’m a bit conservative here as I’m a relative noob on linux… and not always know what I do and sometimes run into trouble I have no idea how to get out again.

Sorry, I have overseen that @dirksagwitz already suggested this.

I would see rusticl as a more conservative option, as it is a free implementation. Rocm is unfree even though you can use it together with the free driver.
I had more problems with proprietary graphic drivers in the past compared to the free ones. There are as well less changes to your system with rusticl. So I see less danger for running into some trouble.