OpenCL stopped functioning

Hi all,

Recently I’ve been having some performance issues with darktable (a RAW image processor).
Up until about a week ago it utilized OpenCL for certain operations just as it should on my Intel UHD 630 iGPU.
Whether or not it made any appreciable difference compared to normal CPU rendering I don’t know for sure but I liked having it as an option.
Unfortunately as of late darktable kept eating up all of my system’s memory (16GB DDR4) and would often crash as a result.

Not being able to resolve the issue, I just used zypper to remove darktable altogether and deleted all of it’s related configuration files in ~/.config and /usr/share and reinstalled it.
Still doesn’t run as smoothly as I’d like it to, but we’ll attribute that to this computer not being particularly modern.
At least darktable didn’t crash anymore, however when launching it from a console with debugging enabled I noticed that it wasn’t using OpenCL for GPU rendering anymore.

me@Tumbleweed:~> darktable -d opencl
darktable 5.0.0
Copyright (C) 2012-2024 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.4.0
Colord → ENABLED
gPhoto2 → ENABLED
GMIC → ENABLED - Compressed LUTs are supported
GraphicsMagick → DISABLED
ImageMagick → DISABLED
libavif → ENABLED
libheif → ENABLED
libjxl → ENABLED
LibRaw → ENABLED - Version 0.21.2-Release
OpenJPEG → ENABLED
OpenEXR → ENABLED
WebP → ENABLED

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

0.0001 [dt starting]
darktable -d opencl
0,1714 [dt_get_sysresource_level] switched to 1 as `default’
0,1714 total mem: 15735MB
0,1714 mipmap cache: 1966MB
0,1714 available mem: 7867MB
0,1714 singlebuff: 122MB
0.1909 [opencl_init] opencl disabled via darktable preferences
0.1912 [opencl_init] opencl library ‘libOpenCL’ found on your system and loaded, preference ‘default path’
0.2006 [opencl_init] 0 platforms detected, error: Unknown OpenCL error
0.2006 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

In “Compile options” it shows “OpenCL → ENABLED” yet further down we see “[opencl_init] opencl disabled via darktable preferences” which is odd because the option to enable OpenCL is grayed out in darktable’s settings.

Next I ran clinfo to verify OpenCL was correctly installed, and as it turned out, it wasn’t anymore.

Output of clinfo:

Number of platforms 0

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.3.1
ICD loader Profile OpenCL 3.0

It seems unlikely this had anything to do with reinstalling darktable and I didn’t touch any OpenCL related files. However if I remember correctly in between this and noticing the lack of OpenCL usage, the Intel graphics drivers got updated, so maybe that threw a wrench in the works?

I used YaST Software manager to reinstall the Intel graphics drivers (i915) and anything related to OpenCL that I could find, rebooted and tried again. Same result.

After searching the internet for a couple of hours a few things seemed amiss.
There should be a directory ‘/etc/OpenCL/vendors/’ with two files in it: ‘libigdrcl.so’ and ‘intel.icd’ or ‘intel64.icd’ depending on which website to believe.
None of these were there so I manually created the directory. I found the file ‘libigdrcl.so’ in /usr/lib64/intel-opencl/ and the file ‘intel.icd’ in /usr/share/OpenCL/vendors/ and copied both to the newly created directory.

“cat /etc/OpenCL/vendors/intel.icd” reveals that this file points to ‘/usr/lib64/intel-opencl/libigdrcl.so’ so I’m not sure ‘libigdrcl.so’ is required in ‘/etc/OpenCL/vendors’, some website suggested it and I suppose it doesn’t hurt.

Also it seems two environment variables are required which weren’t present in /etc/environment – also suggested by some website, I don’t remember which one. In fact the file ‘/etc/environment’ itself did not exist so I created that as well and added the following: ‘OCL_ICD_VENDORS=/etc/OpenCL/vendors/’
‘OCL_ICD_FILENAMES=/usr/lib64/intel-opencl/libigdrcl.so’
Not entirely sure that’s the correct way of doing it but the command ‘env | grep OCL_ICD’ now shows:
OCL_ICD_VENDORS=/etc/OpenCL/vendors/
OCL_ICD_FILENAMES=/usr/lib64/intel-opencl/libigdrcl.so

Rebooted again, but still no luck.
Further searching the internet hasn’t yielded anything conclusive, so I hope somebody here might have an idea as to what’s gone wrong.

I’ll do some more searching myself and let you guys chew on this.
Maybe the recent graphics driver doesn’t match with the installed version of OpenCL, or perhaps I’ve unwittingly borked something.
Even after having used Linux for a few years I’m still very much a novice with it comes to all things under the hood, so that’s not entirely unthinkable…

Some additional info:

inxi -xxx -G
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] vendor: Micro-Star MSI
    driver: i915 v: kernel arch: Gen-9.5 ports: active: HDMI-A-1,HDMI-A-2
    empty: DP-1,DP-2,HDMI-A-3 bus-ID: 00:02.0 chip-ID: 8086:3e92
    class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: vesa
    alternate: fbdev,intel dri: iris gpu: i915 d-rect: 3840x1080 display-ID: 0
  Monitor-1: HDMI-A-1 pos: primary,left model: Denon DENON-AVR
    serial: 16843009 res: mode: 1920x1080 hz: 100 scale: 100% (1) dpi: 61
    size: 1600x900mm (62.99x35.43") diag: 1836mm (72.3") modes: max: 4096x2160
    min: 720x400
  Monitor-2: HDMI-A-2 pos: right model: LG (GoldStar) IPS FULLHD
    serial: 611NTMX8L163 res: mode: 1920x1080 hz: 60 scale: 100% (1) dpi: 102
    size: 480x270mm (18.9x10.63") diag: 551mm (21.7") modes: max: 1920x1080
    min: 720x400
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
    device: 1 drv: swrast gbm: drv: iris surfaceless: drv: iris wayland:
    drv: iris x11: drv: iris
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.3.4 glx-v: 1.4
    direct-render: yes renderer: Mesa Intel UHD Graphics 630 (CFL GT2)
    device-ID: 8086:3e92 display-ID: :1.0
  API: Vulkan v: 1.4.304 layers: 5 surfaces: xcb,xlib,wayland device: 0
    type: integrated-gpu driver: N/A device-ID: 8086:3e92
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo de: kscreen-console,
    kscreen-doctor, xfce4-display-settings gpu: gputop, intel_gpu_top, lsgpu
    wl: wayland-info x11: xdpyinfo, xprop, xrandr
vainfo 
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.4.4 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
inxi -b
System:
  Host: Tumbleweed Kernel: 6.13.0-1-default arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.2.5 Distro: openSUSE Tumbleweed 20250130
Machine:
  Type: Desktop Mobo: Micro-Star model: Z370-A PRO (MS-7B48) v: 1.0
    serial: <superuser required> UEFI: American Megatrends v: 2.D3
    date: 11/18/2021
CPU:
  Info: 6-core Intel Core i5-8400 [MCP] speed (MHz): avg: 800
    min/max: 800/4000
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] driver: i915 v: kernel
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: vesa
    dri: iris gpu: i915 resolution: 1: 1920x1080~100Hz 2: 1920x1080~60Hz
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.3.4
    renderer: Mesa Intel UHD Graphics 630 (CFL GT2)
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo de: kscreen-console,
    kscreen-doctor, xfce4-display-settings gpu: gputop, intel_gpu_top, lsgpu
    wl: wayland-info x11: xdpyinfo, xprop, xrandr
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169
Drives:
  Local Storage: total: 5.33 TiB used: 3.6 TiB (67.5%)
Info:
  Memory: total: 16 GiB note: est. available: 15.37 GiB used: 6.12 GiB (39.8%)
  Processes: 298 Uptime: 2h 16m Shell: Bash inxi: 3.3.37

@Tumblebatch Until you get clinfo output it won’t work… Is intel-opencl installed?

darktable -d opencl
darktable 5.0.0
Copyright (C) 2012-2024 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.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> DISABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.21.2-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.0001 [dt starting]
 darktable -d opencl
     1.8610 [dt_get_sysresource_level] switched to 1 as `default'
     1.8610   total mem:       32043MB
     1.8610   mipmap cache:    4005MB
     1.8610   available mem:   16021MB
     1.8610   singlebuff:      250MB
     1.9788 [opencl_init] opencl disabled via darktable preferences
     1.9790 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     1.9791 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     1.9866 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     2.4283 [opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'Intel(R) Arc(TM) A310 LP Graphics'
   CONF KEY:                 cldevice_v5_intelropenclgraphicsintelrarctma310lpgraphics
   PLATFORM, VENDOR & ID:    Intel(R) OpenCL Graphics, Intel(R) Corporation, ID=32902
   CANONICAL NAME:           intelropenclgraphicsintelrarctma310lpgraphics
   DRIVER VERSION:           24.52.032224
   DEVICE VERSION:           OpenCL 3.0 NEO 
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          3846 MB
   MAX MEM ALLOC:            1923 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/username/.cache/darktable/cached_v5_kernels_for_IntelROpenCLGraphicsIntelRArcTMA310LPGraphics_2452032224
   CL COMPILER OPTION:       
   CL COMPILER COMMAND:      -w   -DINTEL=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       25.5937 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]		0	'Intel(R) OpenCL Graphics Intel(R) Arc(TM) A310 LP Graphics'
    28.0245 [opencl_init] FINALLY: opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED.
[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[dt_opencl_update_priorities]		0	-1	0	0	-1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[opencl_update_priorities]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[dt_opencl_update_priorities]		0	-1	0	0	-1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[opencl_update_priorities]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
 [opencl_summary_statistics] device 'Intel(R) OpenCL Graphics Intel(R) Arc(TM) A310 LP Graphics' (0): NOT utilized

@Tumblebatch Also is your user in the video and render groups

Ah yes, forgot to mention that.
Prior to posting here I checked and my user account was not in the video and render groups, so I added them.

groups
users vboxusers colord video render
zypper se intel-opencl
Loading repository data...
Reading installed packages...

S  | Name               | Summary                                                      | Type
---+--------------------+--------------------------------------------------------------+--------
i+ | intel-opencl       | Intel Graphics Compute Runtime for OpenCL                    | package
i+ | intel-opencl-devel | Headers for the Intel Graphics Compute Runtime OpenCL Driver | package
zypper se -s opencl
Loading repository data...
Reading installed packages...

S  | Name                            | Type    | Version           | Arch   | Repository
---+---------------------------------+---------+-------------------+--------+-----------
   | armnn-opencl                    | package | 24.11-1.3         | x86_64 | repo-oss
   | armnn-opencl-devel              | package | 24.11-1.3         | x86_64 | repo-oss
i+ | intel-opencl                    | package | 24.52.32224.5-1.1 | x86_64 | repo-oss
i+ | intel-opencl-devel              | package | 24.52.32224.5-1.1 | x86_64 | repo-oss
   | libarmnn34-opencl               | package | 24.11-1.3         | x86_64 | repo-oss
   | libarmnnBasePipeServer34-opencl | package | 24.11-1.3         | x86_64 | repo-oss
   | libarmnnSerializer34-opencl     | package | 24.11-1.3         | x86_64 | repo-oss
   | libarmnnTestUtils3-opencl       | package | 24.11-1.3         | x86_64 | repo-oss
   | libarmnnTfLiteParser24-opencl   | package | 24.11-1.3         | x86_64 | repo-oss
   | libggml-opencl                  | package | 4501-1.1          | x86_64 | repo-oss
i  | libopencl-clang14               | package | 2.5.6-1.1         | x86_64 | repo-oss
i  | libOpenCL1                      | package | 2.3.1-4.2         | x86_64 | repo-oss
   | libOpenCL1-32bit                | package | 2.3.1-4.2         | x86_64 | repo-oss
   | libtimelineDecoder34-opencl     | package | 24.11-1.3         | x86_64 | repo-oss
   | libtimelineDecoderJson34-opencl | package | 24.11-1.3         | x86_64 | repo-oss
   | libur_adapter_opencl0           | package | 0.11.4-1.1        | x86_64 | repo-oss
   | Mesa-libOpenCL                  | package | 24.3.4-401.1      | x86_64 | repo-oss
   | Mesa-libRusticlOpenCL           | package | 24.3.4-401.1      | x86_64 | repo-oss
   | opencl-cpp-headers              | package | 2024.10.24-2.1    | noarch | repo-oss
i+ | opencl-headers                  | package | 2024.10.24-1.1    | noarch | repo-oss

zypper se -s intel
Loading repository data...
Reading installed packages...

S  | Name                      | Type    | Version                            | Arch   | Repository
---+---------------------------+---------+------------------------------------+--------+-----------
   | fence-agents-intelmodular | package | 4.16.0+git.1738070632.02141bfa-1.1 | noarch | repo-oss
   | intel-cmt-cat             | package | 24.05.12.git+c5f4492-1.2           | x86_64 | repo-oss
i+ | intel-gpu-tools           | package | 1.30-2.1                           | x86_64 | repo-oss
   | intel-gpu-tools-devel     | package | 1.30-2.1                           | x86_64 | repo-oss
   | intel-hybrid-driver       | package | 2.0.0-1.1                          | x86_64 | repo-oss
   | intel-ipsec-mb-devel      | package | 2.0.0-1.1                          | x86_64 | repo-oss
   | intel-lpmd                | package | 0.0.8-1.2                          | x86_64 | repo-oss
i+ | intel-media-driver        | package | 24.4.4-1.1                         | x86_64 | repo-oss
   | intel-one-mono-fonts      | package | 1.4.0-1.2                          | noarch | repo-oss
i+ | intel-opencl              | package | 24.52.32224.5-1.1                  | x86_64 | repo-oss
i+ | intel-opencl-devel        | package | 24.52.32224.5-1.1                  | x86_64 | repo-oss
i+ | intel-vaapi-driver        | package | 2.4.1-7.1                          | x86_64 | repo-oss
   | intelhex                  | package | 2.3.0-1.7                          | noarch | repo-oss
i+ | kernel-firmware-intel     | package | 20250122-1.1                       | noarch | repo-oss
i+ | libdrm_intel1             | package | 2.4.124-2.1                        | x86_64 | repo-oss
i+ | libdrm_intel1-32bit       | package | 2.4.124-2.1                        | x86_64 | repo-oss
i+ | libvulkan_intel           | package | 24.3.4-401.1                       | x86_64 | repo-oss
i+ | libvulkan_intel-32bit     | package | 24.3.4-401.1                       | x86_64 | repo-oss
   | libze_intel_gpu1          | package | 24.52.32224.5-1.1                  | x86_64 | repo-oss
   | openvino-intel-cpu-plugin | package | 2024.6.0-1.1                       | x86_64 | repo-oss
   | openvino-intel-npu-plugin | package | 2024.6.0-1.1                       | x86_64 | repo-oss
   | python311-intelhex        | package | 2.3.0-1.3                          | noarch | repo-oss
   | python312-intelhex        | package | 2.3.0-1.3                          | noarch | repo-oss
   | python313-intelhex        | package | 2.3.0-1.3                          | noarch | repo-oss
i+ | ucode-intel               | package | 20241112-1.1                       | x86_64 | repo-oss
   | xf86-video-intel          | package | 2.99.917.916_g31486f40-6.3         | x86_64 | repo-oss
   | xf86-video-intel-32bit    | package | 2.99.917.916_g31486f40-6.3         | x86_64 | repo-oss

I hope with all my messing about I haven’t installed something unnecessary or removed some crucial component. Maybe the above output will tell you something I’ve missed.

Did you logout and login after adding those groups? What is the output from lsgpu

Certainly did. A full reboot actually.

lsgpu
card1                    Intel Coffeelake (Gen9)           drm:/dev/dri/card1
└─renderD128                                               drm:/dev/dri/renderD128

And… Ooooops! I just tried to

sudo zypper in xdriinfo
[sudo] password for root: 
Refreshing service 'openSUSE'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  xdriinfo

1 new package to install.

Package download size:
            |      19,4 KiB  overall package size
       0 B  |  -   19,4 KiB  already in cache

Package install size change:
              |      32,5 KiB  required by packages that will be installed
    32,5 KiB  |  -      0 B    released by packages that will be removed

which failed with the following message:

Backend:  classic_rpmtrans
Continue? [y/n/v/...? shows all options] (y): y
In cache xdriinfo-1.0.7-1.7.x86_64.rpm                                                                                                                                    (1/1),  19,4 KiB    

Checking for file conflicts: ...........................................................................................................................................................[done]
(1/1) Installing: xdriinfo-1.0.7-1.7.x86_64 ...........................................................................................................................................[error]
Installation of xdriinfo-1.0.7-1.7.x86_64 failed:
Error: Subprocess failed. Error: RPM failed: Command exited with status 129.
Abort, retry, ignore? [a/r/i] (a): 

So it appears I’ve now managed to destroy Zypper as well.
I suppose my best friend may be right after all - I have a knack for breaking Linux. :person_facepalming:

Rebooted but the Zypper issue hasn’t resolved itself so that’ll need looking into first… sighs :unamused:

OK, nevermind the Zypper issue. My bad, messed something up regarding PATH in /etc/environment. Fixed now.

Just removed all OpenCL related packages with Zypper, rebooted and then with the help of ChatGPT attempted to reinstall everything step by step.

Now ChatGPT suggested I install a package called ocl-icd but this can’t be found in the OpenSUSE repos on my system.
It then suggested installing opencl-icd-loader as an alternative, which also seems unavailable in the default repos.

I’m not entirely sure but this loader component sounds like it might just be required to make OpenCL work…

Copied from https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc:

OpenCL on Linux usually works in one of two ways:

  1. Installable Client Drivers (ICDs)
  2. Direct Linking

These two methods are described in detail below.

OpenCL Installable Client Drivers on Linux

The Installable Client Driver (ICD) method is common on desktop installations. When using the Installable Client Driver method, applications link against an Installable Client Driver loader (ICD loader), instead of linking directly to a specific OpenCL implementation. The ICD loader is responsible for enumerating all of the OpenCL implementations that are installed on the system. The application may then choose to run on any of the OpenCL implementations on the system, or may fail gracefully if no suitable implementation is found.

And

There are two commonly used ICD loaders. Both ICD loaders are open source:

  1. ocl-icd: GitHub - OCL-dev/ocl-icd: OpenCL ICD Loader (free software)
  2. Khronos OpenCL-ICD-Loader: GitHub - KhronosGroup/OpenCL-ICD-Loader: The OpenCL ICD Loader project.

The ICD loader is almost always named libOpenCL.so . libOpenCL.so is most likely a symbolic link to another file, which may itself be a symbolic link to yet another file. The reasons for this are described here. Note that the final ICD loader may be named libOpenCL.so.1.X , though the 1.X is the ICD loader version, and is unrelated to the version of the OpenCL APIs supported by the ICD loader.

I’m unable to install either of the aforementioned loaders from the OpenSUSE repos but I do have the following files:
/usr/lib64/libOpenCL.so.1 and
/usr/lib64/libOpenCL.so.1.0.0, so suppose one of these is this loader component? It’s all a bit unclear to me really.

In any case, after having reinstalled all required packages the result remains the same.

clinfo 
Number of platforms                               0

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

Guess I’ll leave it for now and see if anybody else has any idea.

I have a working darktable and opencl and this is what i have installed.
You dont have mesa-libOpenCL, Mesa-libRusticlOpenCL.

mesa-libOpenCL
Mesa-libRusticlOpenCL
intel-libOpenCL
libOpenCL1
libclc
libopencl-clang
intel-media-driver
kernel-firmware-i915
libvulkan_intel
mesa

Thanks for replying @FreddyFH.

Last night I’ve spent a good few hours trying all sorts of things with the assistance of AI powered DuckDuckGo, which was quite entertaining even though it didn’t fix anything.

At the moment all OpenCL related stuff is removed from my system so later today I’ll have a go at installing the packages that you mentioned.

Meanwhile I’ve been considering assembling a largely new computer with an Intel ARC graphics card. Seems like a sensible option since Intel’s drivers are generally pretty decent on Linux systems if I’m not mistaken.
Haven’t had any luck trying to get older Nvidia or AMD cards to work with OpenCL or working at all, always ended in a broken or crippled Tumbleweed installation…

Maybe it’s not such a bad idea to do a fresh install of Tumbleweed while I’m at it, as this installation has seen it’s fair share of “tinkering” (read: me messing it up and having to repair it…)

I’ll update here after trying your setup. Thanks! :slightly_smiling_face:

  • edit

@FreddyFH,
I forgot to ask - did you add anything to your environment variables such as OCL_ICD_VENDORS=/etc/OpenCL/vendors,
OCL_ICD_FILENAMES=/usr/lib64/intel-opencl and/or LD_LIBRARY_PATH=/usr/lib64/intel-opencl ?

This was recommended on a different website if I remember correctly, although I’ve never had to do so in the past to get OpenCL working correctly.
Just installed a few packages, enabled OpenCL in darktable and that was it.

No i have never touch my environment variables. Only enable it in darktable settings thats it. :slight_smile:

Alright, thanks.

Guess I’ll have another go at it then, and if it doesn’t work then I’ve wasted more than enough time and will leave it at that.
The difference this integrated GPU makes probably isn’t all that impressive anyway.

Maybe it’s time to bite the bullet and splurge on a new modern computer so this one can finally retire.

Installed the packages mentioned above with roughly the same result as before.

clinfo 
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 24.3.4
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No devices found in platform [Clover?]
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.3.1
  ICD loader Profile                              OpenCL 3.0

1 platform, 0 devices. Which is no surprise after installing Mesa-libOpenCL (Clover) since to the best of my knowledge that package is meant for AMD/ATI GPUs and my system has an Intel iGPU.

I skipped the Mesa-libRusticlOpenCL package for now as it’s an experimental / unstable implementation according to the darktable devs.

If I’m not mistaken, after the installation of libOpenCL1 there should be a file named libOpenCL.so in /usr/lib64/ which would be the ICD loader. Instead I’m seeing the following:

libOpenCL.so.1.0.0
libOpenCL.so.1
libopencl-clang.so.14
libMesaOpenCL.so.1.0.0
libMesaOpenCL.so.1
libMesaOpenCL.so

I’m starting to suspect my Tumbleweed installation has some underlying issues anyway. A few other minor annoyances have started to surface recently, so it may just be time to start fresh. :slight_smile:

Thanks for taking the time, and if anybody has more suggestions up their sleeve I don’t mind some experimentation.

@Tumblebatch There does seem to be some other underlying cause (maybe GPU age?) Take small steps if you re-install and take notes of what you install additionally or config changes etc!!!

I’m afraid I’m well past the point of keeping track of what gets installed and deleted. My patience with this pesky problem has just about run out. :yum:

For now I’ll leave it and instead try to come up with a suitable new PC-build.

@Tumblebatch These are the only items I have installed on a test ARC setup (GNOME [Wayland] and Tumbleweed)

S  | Name                            | Summary                                                                 | Type
---+---------------------------------+-------------------------------------------------------------------------+--------
i+ | intel-gpu-tools                 | Collection of tools for development and testing of the Intel DRM driver | package
i+ | intel-level-zero-gpu-raytracing | Level Zero Ray Tracing Support                                          | package
i  | intel-media-driver              | Intel Media Driver for VAAPI                                            | package
i+ | intel-opencl                    | Intel Graphics Compute Runtime for OpenCL                               | package
i+ | intel-vaapi-driver              | Intel Driver for Video Acceleration (VA) API for Linux                  | package
i  | kernel-firmware-intel           | Kernel firmware files for Intel-platform device drivers                 | package
i+ | level-zero                      | oneAPI Level Zero Specification Headers and Loader                      | package
i  | libdrm_intel1                   | Userspace interface for Kernel DRM services for Intel chips             | package
i  | libvulkan_intel                 | Mesa vulkan driver for Intel GPU                                        | package
i+ | libze_intel_gpu1                | Intel GPU support for oneAPI level zero                                 | package
i  | ucode-intel                     | Microcode Updates for Intel x86/x86-64 CPUs                             | package

Graphics:
  Device-1: Intel DG2 [Arc A310] driver: i915 v: kernel arch: Xe-HPG pcie:
    speed: 2.5 GT/s lanes: 1 ports: active: HDMI-A-2 empty: DP-1, DP-2,
    HDMI-A-1, HDMI-A-3 bus-ID: 03:00.0 chip-ID: 8086:56a6
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.4
    compositor: gnome-shell v: 47.3 driver: X: loaded: modesetting
    unloaded: vesa alternate: fbdev,intel dri: iris gpu: i915 display-ID: 0
  Monitor-1: HDMI-A-2 model: AAA res: 1920x1080 dpi: 85 diag: 660mm (25.96")
  API: EGL v: 1.5 platforms: device: 0 drv: iris device: 1 drv: swrast gbm:
    drv: iris surfaceless: drv: iris wayland: drv: iris x11: drv: iris
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.3.4 glx-v: 1.4
    direct-render: yes renderer: Mesa Intel Arc A310 Graphics (DG2)
    device-ID: 8086:56a6 display-ID: :0.0
  API: Vulkan v: 1.4.304 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: N/A device-ID: 8086:56a6
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo gpu: gputop,
    intel_gpu_top, lsgpu x11: xprop,xrandr

@Tumblebatch Did a further quick test on Aeon (I do have openAPI installed here), but is running those few intel packages…

darktable -d opencl

darktable 5.0.0
Copyright (C) 2012-2024 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.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> DISABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.21.2-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.0001 [dt starting]
 darktable -d opencl
     0.1863 [dt_get_sysresource_level] switched to 1 as `default'
     0.1863   total mem:       15771MB
     0.1863   mipmap cache:    1971MB
     0.1863   available mem:   7885MB
     0.1863   singlebuff:      123MB
     0.2320 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.2725 [opencl_init] found 2 platforms
     0.2725 [check platform] platform 'Intel(R) OpenCL' with key 'clplatform_intelropencl' is NOT active
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'Intel(R) UHD Graphics'
   CONF KEY:                 cldevice_v5_intelropenclgraphicsintelruhdgraphics
   PLATFORM, VENDOR & ID:    Intel(R) OpenCL Graphics, Intel(R) Corporation, ID=32902
   CANONICAL NAME:           intelropenclgraphicsintelruhdgraphics
   DRIVER VERSION:           24.52.032224
   DEVICE VERSION:           OpenCL 3.0 NEO 
   DEVICE_TYPE:              GPU, unified mem
   GLOBAL MEM SIZE:          14375 MB
   MAX MEM ALLOC:            4096 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      512
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 512 512 512 ]
   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/username/.cache/darktable/cached_v5_kernels_for_IntelROpenCLGraphicsIntelRUHDGraphics_2452032224
   CL COMPILER OPTION:       
   CL COMPILER COMMAND:      -w   -DINTEL=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       0.0281 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]		0	'Intel(R) OpenCL Graphics Intel(R) UHD Graphics'
     0.3010 [opencl_init] FINALLY: opencl PREFERENCE=ON is AVAILABLE and ENABLED.
[opencl_init] opencl_scheduling_profile: 'default'
[opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 1000
[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[dt_opencl_update_priorities]		0	-1	0	0	-1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[opencl_update_priorities]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
   UNIFIED MEM SIZE:         3943 MB reserved for 'intelropenclgraphicsintelruhdgraphics'[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[dt_opencl_update_priorities]		0	-1	0	0	-1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities] 		image	preview	export	thumbs	preview2
[opencl_update_priorities]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
 [opencl_summary_statistics] device 'Intel(R) OpenCL Graphics Intel(R) UHD Graphics' (0): NOT utilized

Graphics:
  Device-1: Intel Alder Lake-N [UHD Graphics] driver: i915 v: kernel
    arch: Gen-12.1 ports: active: HDMI-A-1 empty: HDMI-A-2 bus-ID: 00:02.0
    chip-ID: 8086:46d1
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.4
    compositor: gnome-shell v: 47.3 driver: gpu: i915 display-ID: 0
  Monitor-1: HDMI-A-1 model: AAA res: 1920x1080 dpi: 85 diag: 660mm (25.96")
  API: EGL v: 1.5 platforms: device: 0 drv: iris device: 1 drv: swrast gbm:
    drv: iris surfaceless: drv: iris wayland: drv: iris x11: drv: iris
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.3.4 glx-v: 1.4
    direct-render: yes renderer: Mesa Intel Graphics (ADL-N)
    device-ID: 8086:46d1 display-ID: :0.0
  API: Vulkan v: 1.4.304 surfaces: xcb,xlib,wayland device: 0
    type: integrated-gpu driver: N/A device-ID: 8086:46d1 device: 1 type: cpu
    driver: N/A device-ID: 10005:0000

Removed all previously installed packages related to OpenCL, left the

intel-media-driver, kernel-firmware-intel, intel-gpu-tools, intel-vaapi-driver and ucode-intel packages as they were.

Rebooted and installed the packages you listed, rebooted again and checked with clinfo. Still no platforms detected.

Checked /etc/OpenCL/vendors/intel.icd which was pointing to /usr/lib64/intel-opencl/libigdrcl.so as I believe it should.

In /usr/lib64 the following files are present: libopencl-clang.so.14, libOpenCL.so.1.0.0, libOpenCL.so.1 as well as /usr/lib64/intel-opencl/libigdrcl.so.

The part I’m not entirely sure about is libOpenCL.so.1 as I’ve seen it referenced as libOpenCL.so without the 1 at the end. But I’ve been staring at this issue for hours on end now so this may be completely irrelevant. I probably don’t know what I’m looking at anymore. :roll_eyes:

Had a quick glance at dmesg and journalctl but nothing really stood out far as I could see.

As for now my best guess would be that I inadvertently butchered something under the hood. Wouldn’t the the first time… :face_with_hand_over_mouth:

Thanks again for testing at your end. I wish I knew what to do with the results but with my limited understanding of the inner workings of Linux, chances are even more things will break, lol.

@Tumblebatch there should be no /etc/OpenCL/vendors/intel.icd as a softlink to anywhere. In Tumbleweed it lives as/in /usr/share/OpenCL/vendors/intel.icd

@malcolmlewis

Aha. Then the instructions I read somewhere earlier clearly weren’t meant for the Tumbleweed flavour of Linux. I sometimes forget that different distributions can have subtle differences in directory structure and where certain files are located.

To this day I still haven’t figured out which PipeWire / Wireplumber config files need to be edited to output 5.1 and 24bits/96Khz sound, which took all of 10 minutes in Ubuntu. Oh well.

I’ll see if it makes a difference when the files in /etc/OpenCL/vendors are deleted, even if it seems pretty inconsequential. But Linux works in mysterious ways, so who knows… :cowboy_hat_face:

@Tumblebatch It’s easy to find what provides library X with the --provides zypper option…

zypper se --provides libOpenCL.so.1
i  | libOpenCL1       | OpenCL ICD Bindings | package

zypper se --provides libOpenCL.so
i  | libOpenCL1       | OpenCL ICD Bindings | package

zypper se --provides libigdrcl.so
i+ | intel-opencl | Intel Graphics Compute Runtime for OpenCL | package

Sometimes you need the full pasth... eg
zypper se --provides /usr/share/OpenCL/vendors/intel.icd
i+ | intel-opencl | Intel Graphics Compute Runtime for OpenCL | package