ubuntu 26.04: OpenCL with native ROCm

Hi, ubuntu 26.04 now natively provides ROCm without amdgpu-pro driver or the amd repository. I thought this would be a good option for OpenCL in darktable (as well as some of the new AI features) - especially as I struggle to install and use the amdgpu-pro driver on my system (RX 6700 XT).
Does anyone already have experiences with the native ROCm setup in conjunction with darktable?
I installed most of the provided packages (rocm) together with rocm-opencl-icd, but darktable isn’t able to use it. Am I missing something?

(gfx1031: graphics card / gfx1036: iGPU)

clinfo | grep -E "Image support|Device Name"

  Device Name                                     gfx1031
  Image support                                   Yes
  Device Name                                     gfx1036
  Image support                                   Yes
darktable-cltest 

darktable 5.5.0+1254~g280248edfc
Copyright (C) 2012-2026 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Exiv2                  -> 0.28.8
  Lensfun                -> 0.3.4
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.7.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED  - Camera tethering is available
  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-Release
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED
  AI                     -> ENABLED

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

[opencl_init] opencl disabled via darktable preferences
[opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
[opencl_init] found 1 platform
[opencl_init] found 2 devices

   DEVICE:                   0: 'gfx1031'
   CONF KEY:                 cldevice_v6_amdacceleratedparallelprocessinggfx1031
   PLATFORM, VENDOR & ID:    AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc., ID=4098
   CANONICAL NAME:           amdacceleratedparallelprocessinggfx1031
   DRIVER VERSION:           3581.0 (HSA1.1,LC)
   DEVICE VERSION:           OpenCL 2.0  API=300
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          12272 MB
   MAX MEM ALLOC:            10431 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX CONSTANT BUFFER:      10681549 KB
   LOCAL MEM SIZE:           64 KB
   ADDRESS ALIGN:            256 B
   COMPUTE UNITS:            20
   MAX WORK GROUP SIZE:      256 (32)
   MAX WORK ITEM DIMENSIONS: 3 [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   SUPPORTED ATOMICS:        INT32 
   EVENTS HANDLED:           YES
   OPENCL FAST MODE:         YES
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /home/gunar/Programme/darktable/share/darktable/kernels
   KERNEL DIRECTORY:         /home/gunar/.cache/darktable/cached_v6_kernels_for_AMDAcceleratedParallelProcessinggfx1031_35810HSA11LC
   CL COMPILER COMMAND:      -w -cl-fast-relaxed-math -DAMD=1 -I"/home/gunar/Programme/darktable/share/darktable/kernels"
[opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
[dt_opencl_device_init] failed to compile program `demosaic_ppg.cl'

   DEVICE:                   1: 'gfx1036'
   CONF KEY:                 cldevice_v6_amdacceleratedparallelprocessinggfx1036
   PLATFORM, VENDOR & ID:    AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc., ID=4098
   CANONICAL NAME:           amdacceleratedparallelprocessinggfx1036
   DRIVER VERSION:           3581.0 (HSA1.1,LC)
   DEVICE VERSION:           OpenCL 2.0  API=300
   DEVICE_TYPE:              GPU, unified mem
   GLOBAL MEM SIZE:          15597 MB
   MAX MEM ALLOC:            13258 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX CONSTANT BUFFER:      13575806 KB
   LOCAL MEM SIZE:           64 KB
   ADDRESS ALIGN:            256 B
   COMPUTE UNITS:            1
   MAX WORK GROUP SIZE:      256 (32)
   MAX WORK ITEM DIMENSIONS: 3 [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   SUPPORTED ATOMICS:        INT32 
   EVENTS HANDLED:           YES
   OPENCL FAST MODE:         YES
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /home/gunar/Programme/darktable/share/darktable/kernels
   KERNEL DIRECTORY:         /home/gunar/.cache/darktable/cached_v6_kernels_for_AMDAcceleratedParallelProcessinggfx1036_35810HSA11LC
   CL COMPILER COMMAND:      -w -cl-fast-relaxed-math -DAMD=1 -I"/home/gunar/Programme/darktable/share/darktable/kernels"
[opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
[dt_opencl_device_init] failed to compile program `demosaic_ppg.cl'
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl PREFERENCE=NO is NOT AVAILABLE and NOT ENABLED

I do see this message in your log:

probably you need to enable it in the settings?

true, but this was done by dt in a previous attempt starting it with rocm.
results with a fresh darktablerc are the same (minus the settings statement).

darktable-cltest

darktable 5.5.0+1258~g377b50674e
Copyright (C) 2012-2026 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Exiv2                  -> 0.28.8
  Lensfun                -> 0.3.4
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.7.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED  - Camera tethering is available
  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-Release
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED
  AI                     -> ENABLED

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

[opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
[opencl_init] found 1 platform
[opencl_init] found 2 devices

   DEVICE:                   0: 'gfx1031', NEW
   CONF KEY:                 cldevice_v6_amdacceleratedparallelprocessinggfx1031
   PLATFORM, VENDOR & ID:    AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc., ID=4098
   CANONICAL NAME:           amdacceleratedparallelprocessinggfx1031
   DRIVER VERSION:           3581.0 (HSA1.1,LC)
   DEVICE VERSION:           OpenCL 2.0  API=300
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          12272 MB
   MAX MEM ALLOC:            10431 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX CONSTANT BUFFER:      10681549 KB
   LOCAL MEM SIZE:           64 KB
   ADDRESS ALIGN:            256 B
   COMPUTE UNITS:            20
   MAX WORK GROUP SIZE:      256 (32)
   MAX WORK ITEM DIMENSIONS: 3 [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   SUPPORTED ATOMICS:        INT32 
   EVENTS HANDLED:           YES
   OPENCL FAST MODE:         NO
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /home/gunar/Programme/darktable/share/darktable/kernels
   KERNEL DIRECTORY:         /home/gunar/.cache/darktable/cached_v6_kernels_for_AMDAcceleratedParallelProcessinggfx1031_35810HSA11LC
   CL COMPILER COMMAND:      -w  -DAMD=1 -I"/home/gunar/Programme/darktable/share/darktable/kernels"
[opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
[dt_opencl_device_init] failed to compile program `demosaic_ppg.cl'

   DEVICE:                   1: 'gfx1036', NEW
   CONF KEY:                 cldevice_v6_amdacceleratedparallelprocessinggfx1036
   PLATFORM, VENDOR & ID:    AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc., ID=4098
   CANONICAL NAME:           amdacceleratedparallelprocessinggfx1036
   DRIVER VERSION:           3581.0 (HSA1.1,LC)
   DEVICE VERSION:           OpenCL 2.0  API=300
   DEVICE_TYPE:              GPU, unified mem
   GLOBAL MEM SIZE:          15597 MB
   MAX MEM ALLOC:            13258 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX CONSTANT BUFFER:      13575806 KB
   LOCAL MEM SIZE:           64 KB
   ADDRESS ALIGN:            256 B
   COMPUTE UNITS:            1
   MAX WORK GROUP SIZE:      256 (32)
   MAX WORK ITEM DIMENSIONS: 3 [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   SUPPORTED ATOMICS:        INT32 
   EVENTS HANDLED:           YES
   OPENCL FAST MODE:         NO
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /home/gunar/Programme/darktable/share/darktable/kernels
   KERNEL DIRECTORY:         /home/gunar/.cache/darktable/cached_v6_kernels_for_AMDAcceleratedParallelProcessinggfx1036_35810HSA11LC
   CL COMPILER COMMAND:      -w  -DAMD=1 -I"/home/gunar/Programme/darktable/share/darktable/kernels"
[opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
[dt_opencl_device_init] failed to compile program `demosaic_ppg.cl'
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl PREFERENCE=YES is NOT AVAILABLE and NOT ENABLED

For me this looks like a driver issue.

hmmm, I’ve biult after installing rocm dev packages - in case they are required. feedback from build looks good to me…

grep -i "opencl" dt_build.txt 

-- Found clang opencl-c.h header in /usr/lib/llvm-21/lib/clang/21/include
-- Will be able to test-compile OpenCL programs. Nice.
[ 15%] Test-compiling OpenCL program soften.cl
[ 15%] Test-compiling OpenCL program agx.cl
[ 15%] Built target opencl-program-soften.cl
[ 15%] Built target opencl-program-agx.cl
[ 15%] Test-compiling OpenCL program atrous.cl
[ 15%] Built target opencl-program-atrous.cl
[ 16%] Test-compiling OpenCL program basecurve.cl
[ 16%] Built target opencl-program-basecurve.cl
[ 17%] Test-compiling OpenCL program basic.cl
[ 17%] Built target opencl-program-basic.cl
[ 17%] Test-compiling OpenCL program basicadj.cl
[ 17%] Built target opencl-program-basicadj.cl
[ 17%] Test-compiling OpenCL program bilateral.cl
[ 17%] Built target opencl-program-bilateral.cl
[ 18%] Test-compiling OpenCL program blendop.cl
[ 18%] Built target opencl-program-blendop.cl
[ 18%] Test-compiling OpenCL program bloom.cl
[ 18%] Built target opencl-program-bloom.cl
[ 18%] Test-compiling OpenCL program blurs.cl
[ 19%] Test-compiling OpenCL program bspline.cl
[ 19%] Built target opencl-program-blurs.cl
[ 20%] Built target opencl-program-bspline.cl
[ 20%] Test-compiling OpenCL program capture.cl
[ 20%] Built target opencl-program-capture.cl
[ 20%] Test-compiling OpenCL program channelmixer.cl
[ 20%] Built target opencl-program-channelmixer.cl
[ 20%] Test-compiling OpenCL program colorequal.cl
[ 20%] Test-compiling OpenCL program colorharmonizer.cl
[ 20%] Built target opencl-program-colorequal.cl
[ 20%] Built target opencl-program-colorharmonizer.cl
[ 20%] Test-compiling OpenCL program colorreconstruction.cl
[ 20%] Built target opencl-program-colorreconstruction.cl
[ 20%] Test-compiling OpenCL program colorspaces.cl
[ 20%] Built target opencl-program-colorspaces.cl
[ 20%] Test-compiling OpenCL program demosaic_markesteijn.cl
[ 20%] Built target opencl-program-demosaic_markesteijn.cl
[ 20%] Test-compiling OpenCL program demosaic_other.cl
[ 20%] Built target opencl-program-demosaic_other.cl
[ 21%] Test-compiling OpenCL program demosaic_ppg.cl
[ 21%] Built target opencl-program-demosaic_ppg.cl
[ 22%] Test-compiling OpenCL program demosaic_rcd.cl
[ 22%] Built target opencl-program-demosaic_rcd.cl
[ 23%] Test-compiling OpenCL program demosaic_vng.cl
[ 23%] Built target opencl-program-demosaic_vng.cl
[ 23%] Test-compiling OpenCL program denoiseprofile.cl
[ 23%] Built target opencl-program-denoiseprofile.cl
[ 23%] Test-compiling OpenCL program diffuse.cl
[ 23%] Test-compiling OpenCL program dwt.cl
[ 23%] Test-compiling OpenCL program extended.cl
[ 23%] Built target opencl-program-diffuse.cl
[ 23%] Built target opencl-program-dwt.cl
[ 23%] Built target opencl-program-extended.cl
[ 23%] Test-compiling OpenCL program filmic.cl
[ 23%] Built target opencl-program-filmic.cl
[ 23%] Test-compiling OpenCL program gaussian.cl
[ 23%] Built target opencl-program-gaussian.cl
[ 23%] Test-compiling OpenCL program guided_filter.cl
[ 24%] Test-compiling OpenCL program hazeremoval.cl
[ 24%] Built target opencl-program-guided_filter.cl
[ 25%] Built target opencl-program-hazeremoval.cl
[ 25%] Test-compiling OpenCL program highpass.cl
[ 25%] Built target opencl-program-highpass.cl
[ 26%] Test-compiling OpenCL program liquify.cl
[ 26%] Test-compiling OpenCL program locallaplacian.cl
[ 26%] Built target opencl-program-liquify.cl
[ 26%] Built target opencl-program-locallaplacian.cl
[ 26%] Test-compiling OpenCL program lut3d.cl
[ 26%] Test-compiling OpenCL program negadoctor.cl
[ 26%] Built target opencl-program-lut3d.cl
[ 26%] Built target opencl-program-negadoctor.cl
[ 26%] Test-compiling OpenCL program nlmeans.cl
[ 26%] Built target opencl-program-nlmeans.cl
[ 26%] Test-compiling OpenCL program overlay.cl
[ 26%] Built target opencl-program-overlay.cl
[ 26%] Test-compiling OpenCL program retouch.cl
[ 26%] Built target opencl-program-retouch.cl
[ 26%] Test-compiling OpenCL program rgbcurve.cl
[ 27%] Built target opencl-program-rgbcurve.cl
[ 28%] Test-compiling OpenCL program rgblevels.cl
[ 28%] Built target opencl-program-rgblevels.cl
[ 28%] Test-compiling OpenCL program sharpen.cl
[ 28%] Built target opencl-program-sharpen.cl
[ 29%] Test-compiling OpenCL program sigmoid.cl
[ 29%] Built target opencl-program-sigmoid.cl
[ 31%] Built target testcompile_opencl_kernels
[ 36%] Building C object bin/CMakeFiles/lib_darktable.dir/common/dlopencl.c.o
[ 40%] Building C object bin/CMakeFiles/lib_darktable.dir/common/opencl.c.o
[ 13%] Built target opencl-program-soften.cl
[ 13%] Built target opencl-program-agx.cl
[ 13%] Built target opencl-program-atrous.cl
[ 13%] Built target opencl-program-basecurve.cl
[ 13%] Built target opencl-program-basic.cl
[ 13%] Built target opencl-program-basicadj.cl
[ 13%] Built target opencl-program-blendop.cl
[ 13%] Built target opencl-program-bilateral.cl
[ 13%] Built target opencl-program-blurs.cl
[ 13%] Built target opencl-program-bloom.cl
[ 14%] Built target opencl-program-bspline.cl
[ 14%] Built target opencl-program-capture.cl
[ 21%] Built target opencl-program-channelmixer.cl
[ 21%] Built target opencl-program-colorequal.cl
[ 21%] Built target opencl-program-colorharmonizer.cl
[ 21%] Built target opencl-program-colorreconstruction.cl
[ 21%] Built target opencl-program-colorspaces.cl
[ 21%] Built target opencl-program-demosaic_markesteijn.cl
[ 21%] Built target opencl-program-demosaic_other.cl
[ 21%] Built target opencl-program-demosaic_ppg.cl
[ 22%] Built target opencl-program-demosaic_rcd.cl
[ 22%] Built target opencl-program-denoiseprofile.cl
[ 22%] Built target opencl-program-demosaic_vng.cl
[ 22%] Built target opencl-program-dwt.cl
[ 22%] Built target opencl-program-extended.cl
[ 22%] Built target opencl-program-diffuse.cl
[ 22%] Built target opencl-program-filmic.cl
[ 22%] Built target opencl-program-gaussian.cl
[ 22%] Built target opencl-program-hazeremoval.cl
[ 22%] Built target opencl-program-guided_filter.cl
[ 22%] Built target opencl-program-highpass.cl
[ 23%] Built target opencl-program-liquify.cl
[ 23%] Built target opencl-program-locallaplacian.cl
[ 23%] Built target opencl-program-lut3d.cl
[ 23%] Built target opencl-program-negadoctor.cl
[ 23%] Built target opencl-program-nlmeans.cl
[ 23%] Built target opencl-program-overlay.cl
[ 23%] Built target opencl-program-retouch.cl
[ 23%] Built target opencl-program-rgbcurve.cl
[ 23%] Built target opencl-program-rgblevels.cl
[ 23%] Built target opencl-program-sharpen.cl
[ 24%] Built target opencl-program-sigmoid.cl
[ 32%] Built target testcompile_opencl_kernels

Darktable seems quite picky with OpenCL and AMD. Perhaps you are missing libclang-common-1x-dev? I don’t know, how different Ubuntu is from Debian with ROCm, but with Debian rocm-opencl-icd and libclang-common-1x-dev is all you need.

I think, the exact version of the clang-library depends on which version was used to build darktable. A later version may substitute the used version (e. g., 19 instead of 17), but I’m not sure.

For what it’s worth, I found rusticl faster than rocm for Darktable (on the 8060s). And much easier to set up.

2 Likes