GPU not detected on a Surface 7 Tablet (Linux)

Hi

I have a Microsoft Surface 7 tablet PC which is currently running Darktable fairly well but I wonder if getting GPU support working might improve performance further. The GPU hardware inside of a Surface 7 is a “Intel Iris Plus Graphics G4 (Ice Lake)” though with no dedicated GPU RAM, it shares the devices 8GB of RAM with the CPU. Will getting Darktable to use the GPU offer much noticeable performance increase?

The OS installed on this Surface in Mint Linux 22. Initially Darktable didn’t detect anything, and even going back a stage and running clinfo found nothing. But after installing libOpenCL and the package ‘intel-opencl-icd’ from Intel clinfo now finds a platform and a device. But Darktable seems still unable to use the GPU.

I’m running Darktable from the Flatpak package, currently using version 5.0.1. If I run it manually with the openCL switch I get the following output…

$ /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/darktable --file-forwarding org.darktable.Darktable -d opencl 
darktable 5.0.1
Copyright (C) 2012-2025 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         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Devel202403
  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]
 /app/bin/darktable -d opencl
Gtk-Message: 10:13:04.776: Failed to load module "xapp-gtk3-module"
     0.1662 [dt_get_sysresource_level] switched to 1 as `default'
     0.1662   total mem:       7530MB
     0.1662   mipmap cache:    941MB
     0.1663   available mem:   3765MB
     0.1663   singlebuff:      58MB
     0.1849 [opencl_init] opencl disabled via darktable preferences
     0.1850 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.1851 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.1852 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     0.2327 [opencl_init] found 1 platform
     0.2327 [check platform] platform 'rusticl' with key 'clplatform_rusticl' is NOT active
[opencl_init] found 0 device
     0.2327 [opencl_init] FINALLY: opencl PREFERENCE=OFF is NOT AVAILABLE and NOT ENABLED.

I read this output as say as OpenCL_Init is happy the LibOpenCL library is available but dt_dlopencl_init can’t see this library and hence why Darktable greys out the options for OpenCL GPU acceleration support?

Sorry this message if this message is more of a brain dump than coherent question – but any ideas on where to troubleshoot this next?

The flatpak won’t work on Intel GPUs as far as I know. nVidia only, and possibly rusticl soon-ish.

1 Like

Ha - if only I’d known this before! Oh well I think I still needed to do some of this work to get the GPU recognised by the OS.

I’ve now removed the Flatpak install, then installed from the Darktable produced .deb package using the instructions for Ubuntu 24.04 here: https://software.opensuse.org/download.html?project=graphics:darktable&package=darktable and I happy to say it’s recognising the GPU using the Intel drivers now.

Is it any faster than before? I’m not sure but at least I know the GPU is being used.

Thanks.

1 Like

Using the same image and same export settings, use darktable -d perf to compare with and without opencl. I think it might be minimal improvement.

1 Like

It seams strange to me that ‘mainstream’ operating systems are automatically detecting and installing graphic processors, yet Linux is unable, or unwilling, to do the same.

Windows is auto detecting and installing GPU drivers?

You know it is totally fine not to say something if you have no clue about it?

  1. linux does install drivers for you. but the driver is not all you need. you also need the user space libraries.
  2. as you have seen with the native package format darktable actually finds the gpu driver.
  3. flatpak is a 3rd party packaging format which bypasses the distro and ships all the libraries again. the darktable flatpak and its dependencies do not include the user space support libraries for non nvidia GPUs. nothing that the linux distro can do about that. the flatpak stack needs to be fixed.

or you know just install the native package.

1 Like

@g-man - well I think it made a slightly noticeable difference, not huge (though maybe I should have used a really large source image) but between GPU and no GPU the export time was slightly noticeable:

With OpenCL enabled:
[dev_process_export] pixel pipeline processing took 0.568 secs (0.453 CPU)

Without (–disable-opencl):
[dev_process_export] pixel pipeline processing took 0.264 secs (1.474 CPU)

and also the other steps of processing the image also appear to have been completed quicker. Still not hugely noticeable but may overtime it’ll save me time?

As for all the questions about does Linux have the drivers installed for you already - it might have though I have a feeling I would have needed to install the libOpenCL library installed whatever. Of course I might have made a further mess whilst trying to get acceleration to work before I knew it was impossible with the Flatpak package - maybe this should be noted somewhere in the documentation?

The reason I was using the Flatpak package rather than a native package was because my distribution’s software library only has Darktable 4.6 available and I wanted to be on 5 and Flatpak seemed the simplest path forward at the time.

Plenty of Linux leanings from this!

1 Like