darktable-org / darktable-org/darktable

no OpenCL support under Debian forky/sid

Open
#20,084 33 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

AMD ROCm OpenCL no-issue-activity
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Is there an existing issue for this?
  • I checked and did not find my issue in the already reported ones
Describe the bug

I didn't get a suitable OpenCL support with an AMD gfx1200 device

Steps to reproduce

'darktable-cltest -d opencl -d verbose' gives this output:

darktable 5.4.0
Copyright (C) 2012-2025 Johannes Hanika and other contributors.

Compile options:
Bit depth -> 64 bit
Exiv2 -> 0.28.7
Lensfun -> 0.3.4
Debug -> DISABLED
SSE2 optimizations -> ENABLED
OpenMP -> ENABLED
OpenCL -> ENABLED
Lua -> ENABLED - API version 9.6.0
Colord -> ENABLED
gPhoto2 -> ENABLED
OSMGpsMap -> ENABLED - map view is available
GMIC -> DISABLED - Compressed LUTs are NOT supported
GraphicsMagick -> ENABLED
ImageMagick -> DISABLED
libavif -> ENABLED
libheif -> ENABLED
libjxl -> ENABLED
LibRaw -> ENABLED - Version 0.21.4-Release
OpenJPEG -> ENABLED
OpenEXR -> ENABLED
WebP -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

 0.4108 [opencl_init] opencl disabled via darktable preferences
 0.4109 [dt_dlopencl_init] found default opencl runtime library 'libOpenCL'
 0.4109 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
 0.5153 [opencl_init] found 2 platforms
 0.5153 [check platform] platform 'Portable Computing Language' with key 'clplatform_portablecomputinglanguage' is NOT active

[opencl_init] found 1 device

[dt_opencl_device_init]
0.5153 [dt_opencl_write_device_config] writing data '0 250 0 16 16 128 0 0 0.000 0.000 0.250' for 'cldevice_v5_amdacceleratedparallelprocessinggfx1200'
0.5153 [dt_opencl_write_device_config] writing data '600' for 'cldevice_v5_amdacceleratedparallelprocessinggfx1200_id0'
DEVICE: 0: 'gfx1200'
CONF KEY: cldevice_v5_amdacceleratedparallelprocessinggfx1200
PLATFORM, VENDOR & ID: AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc., ID=4098
CANONICAL NAME: amdacceleratedparallelprocessinggfx1200
DRIVER VERSION: 3649.0 (HSA1.1,LC)
DEVICE VERSION: OpenCL 2.0
DEVICE_TYPE: GPU, dedicated mem
GLOBAL MEM SIZE: 16304 MB
MAX MEM ALLOC: 13858 MB
MAX IMAGE SIZE: 16384 x 16384
MAX CONSTANT BUFFER: 14191002 KB
ADDRESS ALIGN: 256
MAX WORK GROUP SIZE: 256
MAX WORK ITEM DIMENSIONS: 3
MAX WORK ITEM SIZES: [ 1024 1024 1024 ]
ASYNC PIXELPIPE: NO
PINNED MEMORY TRANSFER: NO
AVOID ATOMICS: NO
MICRO NAP: 250
ROUNDUP WIDTH & HEIGHT 16x16
CHECK EVENT HANDLES: 128
TILING ADVANTAGE: 0.000
DEFAULT DEVICE: NO
KERNEL BUILD DIRECTORY: /usr/share/darktable/kernels
KERNEL DIRECTORY: /home/dieter/.var/cache/darktable-5.4.0/cached_v5_kernels_for_AMDAcceleratedParallelProcessinggfx1200_36490HSA11LC
CL COMPILER OPTION: -cl-fast-relaxed-math
CL COMPILER COMMAND: -w -cl-fast-relaxed-math -DAMD=1 -I"/usr/share/darktable/kernels"
0.6591 [dt_opencl_device_init] testing program demosaic_ppg.cl' .. 0.6591 [opencl_fopen_stat] could not open file /home/dieter/.var/cache/darktable-5.4.0/cached_v5_kernels_for_AMDAcceleratedParallelProcessinggfx1200_36490HSA11LC/demosaic_ppg.cl.bin'!
0.6591 [opencl_load_program] could not load cached binary program, trying to compile source

 0.6592 [opencl_load_program] successfully loaded program from '/usr/share/darktable/kernels/demosaic_ppg.cl' MD5: 'f2ef08727a39b61f973592b8047126c0'
 0.7123 [opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
 0.7123 [opencl_build_program] BUILD STATUS: -2
 0.7123 BUILD LOG:
 0.7123 /tmp/comgr-6514ef/input/CompileSource:77:22: error: use of undeclared identifier 'read_imagef'

77 | buffer[bufidx] = read_imagef(in, sampleri, (int2)(xx, yy)).x;
| ^~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:115:3: error: use of undeclared identifier 'write_imagef'
115 | write_imagef (out, (int2)(x, y), fmax(o, 0.0f));
| ^~~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:142:17: error: use of undeclared identifier 'read_imagef'
142 | float pixel = read_imagef(in, sampleri, (int2)(x, y)).x;
| ^~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:218:17: error: use of undeclared identifier 'read_imagef'
218 | float pixel = read_imagef(in, sampleri, (int2)(x, y)).x;
| ^~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:226:3: error: use of undeclared identifier 'write_imagef'
226 | write_imagef (out, (int2)(x, y), fmax(pixel, 0.0f));
| ^~~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:272:22: error: use of undeclared identifier 'read_imagef'
272 | buffer[bufidx] = read_imagef(in, sampleri, (int2)(xx, yy)).x;
| ^~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:310:3: error: use of undeclared identifier 'write_imagef'
310 | write_imagef (out, (int2)(x, y), fmax(color, 0.0f));
| ^~~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:355:22: error: use of undeclared identifier 'read_imagef'
355 | buffer[bufidx] = read_imagef(in, sampleri, (int2)(gx, gy));
| ^~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:434:3: error: use of undeclared identifier 'write_imagef'
434 | write_imagef(out, (int2) (x, y), fmax(o, 0.0f));
| ^~~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:462:23: error: use of undeclared identifier 'read_imagef'
462 | const float4 px = read_imagef(in, samplerf, (float2)(p.x+i, p.y+j));
| ^~~~~~~~~~~
/tmp/comgr-6514ef/input/CompileSource:466:3: error: use of undeclared identifier
0.7124 [dt_opencl_device_init] failed to compile program `demosaic_ppg.cl'!
0.7124 [dt_opencl_write_device_config] writing data '0 250 0 16 16 128 0 0 0.000 0.000 0.250' for 'cldevice_v5_amdacceleratedparallelprocessinggfx1200'
0.7124 [dt_opencl_write_device_config] writing data '600' for 'cldevice_v5_amdacceleratedparallelprocessinggfx1200_id0'
[opencl_init] no suitable devices found.
0.7124 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

Allthough, if I build it with './build.sh --skip-build', I see these lines:
...
-- Found LLVM 21.1.8
-- Found clang compiler - /usr/bin/clang-21
-- Found clang opencl-c.h header in /usr/lib/llvm-21/lib/clang/21/include
-- Will be able to test-compile OpenCL programs. Nice.
...

Any idea what I miss?

Expected behavior

No response

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

distro packaging

darktable version

5.4.0

What OS are you using?

Linux

What is the version of your OS?

Debian forky/sid

Describe your system

No response

Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the darktable-cltest entry point and the failing demosaic_ppg.cl kernel under /usr/share/darktable/kernels. Compare the distro build's OpenCL compiler and headers with the build.sh output, then reproduce the failure on Debian forky/sid. Done means identifying a concrete cause for the missing image functions and documenting or validating an actionable fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
computer-graphics, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.