darktable opencl on TigerLake-LP GT2

I just switched laptops (back to a smaller one, for travel), which as an integrated GPU

$ lspci -v
00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Device 3f18
        Flags: bus master, fast devsel, latency 0, IRQ 161, IOMMU group 0
        Memory at 6000000000 (64-bit, non-prefetchable) [size=16M]
        Memory at 4000000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 3000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915, xe

Can darktable use this for acceleration? Currently -d opencl gives me

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

Compile options:
  Bit depth              -> 64 bit
  Exiv2                  -> 0.28.5
  Lensfun                -> 0.3.4
  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 https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.0001 [dt starting]
 darktable --configdir /home/tamas/.config/darktable -d opencl
     0.3039 [opencl_init] opencl disabled via darktable preferences
     0.3040 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.3041 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.3048 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     0.3513 [opencl_init] found 1 platform
     0.3513 [opencl_init] no devices found for Mesa/X.org (vendor) - rusticl (name)
[opencl_init] found 0 device
     0.3513 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

even though I have it enabled. But I would only bother trying to make this work if it is theoretically possible.

Running Ubuntu 25.04, wayland (sway).

AFAIK the RustiCL OpenCL driver does not enable hardware devices by default. For Intel, you need to set the RUSTICL_ENABLE variable this way: RUSTICL_ENABLE=iris

This command should then show activated OpenCL support:

RUSTICL_ENABLE=iris darktable-cltest

Or start darktable with enabled RustiCL:

RUSTICL_ENABLE=iris darktable -d opencl

However, I don’t know if the RustiCL driver supports your GPU. Intel also provides an intel-compute-runtime with OpenCL support. The package to install would be intel-opencl-icd.

You might have to tweak the darktable settings for supported OpenCL drivers to use this Intel driver. See the “OpenCL drivers” section of the manual. darktable user manual - processing

1 Like

Thanks, with

RUSTICL_ENABLE=iris

I get

[dt_opencl_device_init]
OpenCL Mesa platform `Mesa/X.org' --> `Mesa Intel'
   DEVICE:                   0: 'Mesa Intel(R) Iris(R) Xe Graphics (TGL GT2)'
   CONF KEY:                 cldevice_v5_rusticlmesaintel
   PLATFORM, VENDOR & ID:    rusticl, Mesa:Mesa/X.org, ID=32902
   CANONICAL NAME:           rusticlmesaintel
   DRIVER VERSION:           25.1.7 (git-581a4f7e70)
   DEVICE VERSION:           OpenCL 3.0 
   DEVICE_TYPE:              GPU, unified mem
   GLOBAL MEM SIZE:          15776 MB
   MAX MEM ALLOC:            1024 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      1024
   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:   /app/share/darktable/kernels
   KERNEL DIRECTORY:         /home/tamas/.var/app/org.darktable.Darktable/cache/darktable/cached_v5_kernels_for_rusticlMesaIntel_2517git581a4f7e70
   CL COMPILER OPTION:       
   CL COMPILER COMMAND:      -w  -DINTEL=1 -I"/app/share/darktable/kernels"
     0.3087 [opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
     0.3087 [dt_opencl_device_init] failed to compile program `demosaic_ppg.cl'!
[opencl_init] no suitable devices found.
     0.3088 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

Should I install anything else on Ubuntu for the compiler part to work?

I don’t know what exactly goes wrong in the above log file.

As already mentioned, you might install the package intel-opencl-icd in your Ubuntu to get the OpenCL driver from the GPU vendor (Intel). In darktable, make sure to enable support for the “Intel GPU” OpenCL driver in the OpenCL settings (and disable RustiCL to avoid conflicts).

1 Like

I have

$ dpkg -l '*icd*'                  
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                     Version                 Architecture Description
+++-========================-=======================-============-=============================================================
un  beignet-opencl-icd       <none>                  <none>       (no description available)
ii  intel-opencl-icd         24.52.32224.13-0ubuntu3 amd64        Intel graphics compute runtime for OpenCL
ii  intel-opencl-icd-legacy  24.35.30872.32-0ubuntu1 amd64        Intel graphics compute runtime for OpenCL -- legacy platforms
un  mesa-opencl-icd          <none>                  <none>       (no description available)
un  nvidia-vulkan-icd        <none>                  <none>       (no description available)
ii  ocl-icd-libopencl1:amd64 2.3.2-1build1           amd64        Generic OpenCL ICD Loader
ii  ocl-icd-libopencl1:i386  2.3.2-1build1           i386         Generic OpenCL ICD Loader
ii  ocl-icd-opencl-dev:amd64 2.3.2-1build1           amd64        OpenCL development files
un  opencl-icd               <none>                  <none>       (no description available)
un  vulkan-icd               <none>                  <none>       (no description available)

What is the output of clinfo?

clinfo.txt (34.0 KB)

Looks good.

This might be an issue:

        Kernel driver in use: i915
        Kernel modules: i915, xe

I think xe should be taking over from i915 now.

You can also use some generic OpenCL utilities, like clpeak, to see whether OpenCL is working.

It seems that darktable is unable to compile its kernels. Just in case it helps, these are the opencl packages I have installed in Arch:

$ pacman -Qs opencl
local/clinfo 3.0.23.01.25-1
    Simple OpenCL application that enumerates all available platform and device properties
local/intel-compute-runtime 25.27.34303.5-1
    Intel(R) Graphics Compute Runtime for oneAPI Level Zero and OpenCL(TM) Driver
local/intel-graphics-compiler 1:2.14.1-1
    Intel Graphics Compiler for OpenCL
local/libclc 20.1.6-1
    Library requirements of the OpenCL C programming language
local/ocl-icd 2.3.3-1
    OpenCL ICD Bindings
local/opencl-mesa 1:25.1.7-1
    Open-source OpenCL drivers

In particular, the compiler and libraries must be present in order to compile CL programs. This is the relevant output from
$ RUSTICL_ENABLE=iris darktable-cltest:

[dt_opencl_device_init]
OpenCL Mesa platform `Mesa/X.org' --> `Mesa Intel'
   DEVICE:                   0: 'Mesa Intel(R) UHD Graphics 630 (CFL GT2)', NEW
   CONF KEY:                 cldevice_v5_rusticlmesaintel
   PLATFORM, VENDOR & ID:    rusticl, Mesa:Mesa/X.org, ID=32902
   CANONICAL NAME:           rusticlmesaintel
   DRIVER VERSION:           25.1.7-arch1.1
   DEVICE VERSION:           OpenCL 3.0
   DEVICE_TYPE:              GPU, unified mem
   GLOBAL MEM SIZE:          31886 MB
   MAX MEM ALLOC:            1024 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      1024
   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/miguel/.cache/darktable/cached_v5_kernels_for_rusticlMesaIntel_2517arch11
   CL COMPILER OPTION:
   CL COMPILER COMMAND:      -w  -DINTEL=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       40.2047 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]           0       'rusticl Mesa Intel'

Note that

   CL COMPILER COMMAND:      -w  -DINTEL=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       40.2047 sec

indicates that the kernels were successfully compiled.

1 Like

I think I am running into

I’d try compiling from source. Should not be too difficult.

1 Like

Thanks, just did that and it fixed the issue.

1 Like