OpenCL only in Darktable.git

I run Manjaro KDE with an AMD GPU running mesa, and when I have darktable.git installed I have access to OpenCL in the settings menu. But when I uninstall darktable.git to run darktable 3.6 from the official repository, OpenCL options are greyed out and unavailable. I’ve tried to purge darktable.git with pacman but still no lock. Would anyone know what I additionally need to delete, change, or uninstall to get opencl working on darktable official 3.6?

Many thanks for your help

Hi @Steven_Adler ,

Run this command from a terminal.

darktable-cltest | grep opencl_init

What does it report?

Have fun!
Claes in Lund, Sweden

you probably need to clear out ~/.cache/darktable/cached_kernels_*

$ darktable-cltest
0.013442 [opencl_init] opencl related configuration options:
0.013449 [opencl_init]
0.013450 [opencl_init] opencl: 1
0.013452 [opencl_init] opencl_scheduling_profile: ‘very fast GPU’
0.013454 [opencl_init] opencl_library: ‘’
0.013455 [opencl_init] opencl_memory_requirement: 768
0.013457 [opencl_init] opencl_memory_headroom: 400
0.013458 [opencl_init] opencl_device_priority: ‘/!0,///!0,*’
0.013460 [opencl_init] opencl_mandatory_timeout: 200
0.013462 [opencl_init] opencl_size_roundup: 16
0.013463 [opencl_init] opencl_async_pixelpipe: 0
0.013464 [opencl_init] opencl_synch_cache: active module
0.013465 [opencl_init] opencl_number_event_handles: 25
0.013467 [opencl_init] opencl_micro_nap: 1000
0.013468 [opencl_init] opencl_use_pinned_memory: 0
0.013470 [opencl_init] opencl_use_cpu_devices: 0
0.013471 [opencl_init] opencl_avoid_atomics: 0
0.013472 [opencl_init]
0.013539 [opencl_init] found opencl runtime library ‘libOpenCL’
0.013549 [opencl_init] opencl library ‘libOpenCL’ found on your system and loaded
0.114988 [opencl_init] found 2 platforms
0.114997 [opencl_init] found 2 devices
0.115014 [opencl_init] discarding device 0 AMD Radeon RX 5700 XT (NAVI10, DRM 3.41.0, 5.13.5-1-MANJARO, LLVM 12.0.1)' - The OpenCL driver doesn't provide image support. See also 'clinfo' output. 0.115022 [opencl_init] device 1 gfx1010:xnack-’ supports image sizes of 16384 x 16384
0.115024 [opencl_init] device 1 gfx1010:xnack-' allows GPU memory allocations of up to 6949MB [opencl_init] device 1: gfx1010:xnack- GLOBAL_MEM_SIZE: 8176MB MAX_WORK_GROUP_SIZE: 256 MAX_WORK_ITEM_DIMENSIONS: 3 MAX_WORK_ITEM_SIZES: [ 1024 1024 1024 ] DRIVER_VERSION: 3261.0 (HSA1.1,LC) DEVICE_VERSION: OpenCL 2.0 0.277333 [opencl_init] options for OpenCL compiler: -w -cl-fast-relaxed-math -DAMD=1 -I"/usr/share/darktable/kernels" 0.280675 [opencl_init] compiling program demosaic_ppg.cl’ …
0.281228 [opencl_load_program] loaded cached binary program from file ‘/home/steve/.cache/darktable/cached_kernels_for_gfx1010xnack_32610HSA11LC/demosaic_ppg.cl.bin’ MD5: ‘7bd0bb8e42db27fbd7b2247b9c7243a2’
0.281232 [opencl_load_program] successfully loaded program from ‘/usr/share/darktable/kernels/demosaic_ppg.cl’ MD5: ‘7bd0bb8e42db27fbd7b2247b9c7243a2’
0.281908 [opencl_build_program] successfully built program
0.281912 [opencl_build_program] BUILD STATUS: 0
0.281914 BUILD LOG:
0.281915
0.281918 [opencl_init] compiling program atrous.cl' .. 0.282106 [opencl_load_program] loaded cached binary program from file '/home/steve/.cache/darktable/cached_kernels_for_gfx1010xnack_32610HSA11LC/atrous.cl.bin' MD5: '03010eae88840256f08caf4148cc99de' 0.282110 [opencl_load_program] successfully loaded program from '/usr/share/darktable/kernels/atrous.cl' MD5: '03010eae88840256f08caf4148cc99de' 0.282372 [opencl_build_program] successfully built program 0.282376 [opencl_build_program] BUILD STATUS: 0 0.282377 BUILD LOG: 0.282378 0.282381 [opencl_init] compiling program basic.cl’ …
0.283603 [opencl_load_program] loaded cached binary program from file ‘/home/steve/.cache/darktable/cached_kernels_for_gfx1010xnack_32610HSA11LC/basic.cl.bin’ MD5: ‘06bed41b26faa5d9c010dfa4232863ae’
0.283607 [opencl_load_program] successfully loaded program from ‘/usr/share/darktable/kernels/basic.cl’ MD5: ‘06bed41b26faa5d9c010dfa4232863ae’
0.286053 [opencl_build_program] successfully built program
0.286058 [opencl_build_program] BUILD STATUS: 0
0.286062 BUILD LOG:
0.286064
0.286068 [opencl_init] compiling program blendop.cl' .. 0.286345 [opencl_fopen_stat] could not open file /home/steve/.cache/darktable/cached_kernels_for_gfx1010xnack_32610HSA11LC/blendop.cl.bin’!
0.286350 [opencl_load_program] could not load cached binary program, trying to compile source
0.286372 [opencl_load_program] successfully loaded program from ‘/usr/share/darktable/kernels/blendop.cl’ MD5: ‘12fda7537d9ccceccb6fe5b2b6372438’
0.976808 [opencl_build_program] could not build program: -11
0.976819 [opencl_build_program] BUILD STATUS: -2
0.976821 BUILD LOG:
0.976821 lld: error: undefined hidden symbol: rgb_to_JzCzhz

referenced by /tmp/comgr-891454/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-891454/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-891454/input/linked.bc.o:(blendop_display_channel)
referenced 9 more times

lld: error: undefined hidden symbol: get_rgb_matrix_luminance

referenced by /tmp/comgr-891454/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-891454/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-891454/input/linked.bc.o:(blendop_display_channel)
referenced 1 more times
Error: Creating the executable from LLVM IRs failed.

0.976825 [opencl_init] failed to compile program `blendop.cl’!
0.976830 [opencl_init] no suitable devices found.
0.976836 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.976837 [opencl_init] initial status of opencl enabled flag is OFF.

Exactly the same issue here. Installed OpenCL for a AMD RX 6700 XT and clean install of Darktable 3.6 under Ubuntu 20.04.
The error message "failed to compile program ‘blendop.cl’ with reference to a ‘undefined hidden symbol: rgb_to_JzCzhz’ is the same.
Any help would be appreciated.

[defaults] found a 64-bit system with 32865492 kb ram and 16 cores (0 atom based)
[defaults] setting very high quality defaults
0.315552 [opencl_init] opencl related configuration options:
0.315558 [opencl_init]
0.315560 [opencl_init] opencl: 1
0.315561 [opencl_init] opencl_scheduling_profile: ‘default’
0.315563 [opencl_init] opencl_library: ‘’
0.315565 [opencl_init] opencl_memory_requirement: 768
0.315566 [opencl_init] opencl_memory_headroom: 400
0.315567 [opencl_init] opencl_device_priority: ‘/!0,///!0,*’
0.315569 [opencl_init] opencl_mandatory_timeout: 200
0.315570 [opencl_init] opencl_size_roundup: 16
0.315571 [opencl_init] opencl_async_pixelpipe: 0
0.315572 [opencl_init] opencl_synch_cache: active module
0.315573 [opencl_init] opencl_number_event_handles: 25
0.315574 [opencl_init] opencl_micro_nap: 1000
0.315574 [opencl_init] opencl_use_pinned_memory: 0
0.315575 [opencl_init] opencl_use_cpu_devices: 0
0.315576 [opencl_init] opencl_avoid_atomics: 0
0.315577 [opencl_init]
0.315823 [opencl_init] found opencl runtime library ‘libOpenCL’
0.315834 [opencl_init] opencl library ‘libOpenCL’ found on your system and loaded
0.368334 [opencl_init] found 1 platform
0.368343 [opencl_init] found 1 device
0.368363 [opencl_init] device 0 gfx1031' supports image sizes of 16384 x 16384 0.368366 [opencl_init] device 0 gfx1031’ allows GPU memory allocations of up to 10431MB
[opencl_init] device 0: gfx1031
GLOBAL_MEM_SIZE: 12272MB
MAX_WORK_GROUP_SIZE: 256
MAX_WORK_ITEM_DIMENSIONS: 3
MAX_WORK_ITEM_SIZES: [ 1024 1024 1024 ]
DRIVER_VERSION: 3261.0 (HSA1.1,LC)
DEVICE_VERSION: OpenCL 2.0
0.597254 [opencl_init] options for OpenCL compiler: -w -cl-fast-relaxed-math -DAMD=1 -I"/usr/share/darktable/kernels"
0.598276 [opencl_init] compiling program demosaic_ppg.cl' .. 0.624166 [opencl_load_program] loaded cached binary program from file '/home/gerd/.cache/darktable/cached_kernels_for_gfx1031_32610HSA11LC/demosaic_ppg.cl.bin' MD5: '7bd0bb8e42db27fbd7b2247b9c7243a2' 0.624175 [opencl_load_program] successfully loaded program from '/usr/share/darktable/kernels/demosaic_ppg.cl' MD5: '7bd0bb8e42db27fbd7b2247b9c7243a2' 0.625348 [opencl_build_program] successfully built program 0.625357 [opencl_build_program] BUILD STATUS: 0 0.625360 BUILD LOG: 0.625361 0.625368 [opencl_init] compiling program atrous.cl’ …
0.638752 [opencl_load_program] loaded cached binary program from file ‘/home/gerd/.cache/darktable/cached_kernels_for_gfx1031_32610HSA11LC/atrous.cl.bin’ MD5: ‘03010eae88840256f08caf4148cc99de’
0.638758 [opencl_load_program] successfully loaded program from ‘/usr/share/darktable/kernels/atrous.cl’ MD5: ‘03010eae88840256f08caf4148cc99de’
0.639251 [opencl_build_program] successfully built program
0.639257 [opencl_build_program] BUILD STATUS: 0
0.639259 BUILD LOG:
0.639260
0.639265 [opencl_init] compiling program basic.cl' .. 0.666473 [opencl_load_program] loaded cached binary program from file '/home/gerd/.cache/darktable/cached_kernels_for_gfx1031_32610HSA11LC/basic.cl.bin' MD5: '06bed41b26faa5d9c010dfa4232863ae' 0.666483 [opencl_load_program] successfully loaded program from '/usr/share/darktable/kernels/basic.cl' MD5: '06bed41b26faa5d9c010dfa4232863ae' 0.671203 [opencl_build_program] successfully built program 0.671213 [opencl_build_program] BUILD STATUS: 0 0.671215 BUILD LOG: 0.671217 0.671224 [opencl_init] compiling program blendop.cl’ …
0.671526 [opencl_fopen_stat] could not open file `/home/gerd/.cache/darktable/cached_kernels_for_gfx1031_32610HSA11LC/blendop.cl.bin’!
0.671534 [opencl_load_program] could not load cached binary program, trying to compile source
0.671562 [opencl_load_program] successfully loaded program from ‘/usr/share/darktable/kernels/blendop.cl’ MD5: ‘12fda7537d9ccceccb6fe5b2b6372438’
1.325225 [opencl_build_program] could not build program: -11
1.325236 [opencl_build_program] BUILD STATUS: -2
1.325238 BUILD LOG:
1.325239 lld: error: undefined hidden symbol: rgb_to_JzCzhz

referenced by /tmp/comgr-7db6b9/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-7db6b9/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-7db6b9/input/linked.bc.o:(blendop_display_channel)
referenced 9 more times

lld: error: undefined hidden symbol: get_rgb_matrix_luminance

referenced by /tmp/comgr-7db6b9/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-7db6b9/input/linked.bc.o:(blendop_display_channel)
referenced by /tmp/comgr-7db6b9/input/linked.bc.o:(blendop_display_channel)
referenced 1 more times
Error: Creating the executable from LLVM IRs failed.

1.325244 [opencl_init] failed to compile program `blendop.cl’!
1.325250 [opencl_init] no suitable devices found.
1.325251 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
1.325252 [opencl_init] initial status of opencl enabled flag is OFF.

I believe this is an issue with the latest opencl-amd version 21.20.1271047-1. At least this is true for me on Arch Linux. A fix is needed for darktable to be able to use that new opencl-amd version. This fix is already available in darktable-git but not in darktable 3.6. The fix has been added as a milestone for darktable 3.8

For darktable 3.6 you need to downgrade opencl-amd. For me opencl-amd version 20.50.1234664-5 is the last one working with darktable 3.6.

Reference:

Thanks a lot. I’m using now DT 3.7.0. So far it works without issues.

1 Like

I went with that solution as well.