OpenCL and Darktable and Iris Xe?

I have a new laptop with Linux (System76 Galago with Iris Xe). Based on clinfo it looks like OpenCL is working but in darktable the OpenCL option is grayed out. Is there a way to make this work and is it really worth it?

Here is the clinfo output:

Number of platforms 1
Platform Name Intel® OpenCL HD Graphics
Platform Vendor Intel® Corporation
Platform Version OpenCL 2.1
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator cl_intel_driver_diagnostics cl_khr_priority_hints cl_khr_throttle_hints cl_khr_create_command_queue cl_intel_subgroups_char cl_intel_subgroups_long cl_khr_subgroups cl_khr_il_program cl_intel_spirv_media_block_io cl_intel_spirv_subgroups cl_khr_spirv_no_integer_wrap_decoration cl_intel_unified_shared_memory_preview cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_intel_planar_yuv cl_intel_packed_yuv cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_image2d_from_buffer cl_khr_depth_images cl_intel_media_block_io cl_khr_3d_image_writes cl_intel_va_api_media_sharing cl_intel_subgroup_local_block_io
Platform Host timer resolution 1ns
Platform Extensions function suffix INTEL

Platform Name Intel® OpenCL HD Graphics
Number of devices 1
Device Name Intel® Gen12LP HD Graphics NEO
Device Vendor Intel® Corporation
Device Vendor ID 0x8086
Device Version OpenCL 2.1 NEO
Driver Version 1.0.0
Device OpenCL C Version OpenCL C 2.0
Device Type GPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Linker Available Yes
Max compute units 80
Max clock frequency 1300MHz
Device Partition (core)
Max number of sub-devices 0
Supported partition types None, None
Supported affinity domains (n/a)
Max work item dimensions 3
Max work item sizes 512x512x512
Max work group size 512
Preferred work group size multiple 64
Max sub-groups per work group 64
Sub-group sizes (Intel) 8, 16, 32
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 1 / 1
half 8 / 8 (cl_khr_fp16)
float 1 / 1
double 1 / 1 (n/a)
Half-precision Floating-point support (cl_khr_fp16)
Denormals Yes
Infinity and NANs Yes
Round to nearest Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add Yes
Support is emulated in software No
Single-precision Floating-point support (core)
Denormals Yes
Infinity and NANs Yes
Round to nearest Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add Yes
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (n/a)
Address bits 64, Little-Endian
Global memory size 33531228160 (31.23GiB)
Error Correction support No
Max memory allocation 4294959104 (4GiB)
Unified memory for Host and Device Yes
Shared Virtual Memory (SVM) capabilities (core)
Coarse-grained buffer sharing Yes
Fine-grained buffer sharing No
Fine-grained system sharing No
Atomics No
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Preferred alignment for atomics
SVM 64 bytes
Global 64 bytes
Local 64 bytes
Max size for global variable 65536 (64KiB)
Preferred total size of global vars 4294959104 (4GiB)
Global Memory cache type Read/Write
Global Memory cache size 1048576 (1024KiB)
Global Memory cache line size 64 bytes
Image support Yes
Max number of samplers per kernel 16
Max size for 1D images from buffer 268434944 pixels
Max 1D or 2D image array size 2048 images
Base address alignment for 2D image buffers 4 bytes
Pitch alignment for 2D image buffers 4 pixels
Max 2D image size 16384x16384 pixels
Max planar YUV image size 16384x16352 pixels
Max 3D image size 2048x2048x2048 pixels
Max number of read image args 128
Max number of write image args 128
Max number of read/write image args 128
Max number of pipe args 16
Max active pipe reservations 1
Max pipe packet size 1024
Local memory type Local
Local memory size 65536 (64KiB)
Max number of constant args 8
Max constant buffer size 4294959104 (4GiB)
Max size of kernel argument 1024
Queue properties (on host)
Out-of-order execution Yes
Profiling Yes
Queue properties (on device)
Out-of-order execution Yes
Profiling Yes
Preferred size 131072 (128KiB)
Max size 67108864 (64MiB)
Max queues on device 1
Max events on device 1024
Prefer user sync for interop Yes
Profiling timer resolution 52ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels No
Sub-group independent forward progress Yes
IL version SPIR-V_1.2
SPIR versions 1.2
printf() buffer size 4194304 (4MiB)
Built-in kernels (n/a)
Device Extensions cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator cl_intel_driver_diagnostics cl_khr_priority_hints cl_khr_throttle_hints cl_khr_create_command_queue cl_intel_subgroups_char cl_intel_subgroups_long cl_khr_subgroups cl_khr_il_program cl_intel_spirv_media_block_io cl_intel_spirv_subgroups cl_khr_spirv_no_integer_wrap_decoration cl_intel_unified_shared_memory_preview cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_intel_planar_yuv cl_intel_packed_yuv cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_image2d_from_buffer cl_khr_depth_images cl_intel_media_block_io cl_khr_3d_image_writes cl_intel_va_api_media_sharing cl_intel_subgroup_local_block_io

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, …) Intel® OpenCL HD Graphics
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, …) Success [INTEL]
clCreateContext(NULL, …) [default] Success [INTEL]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1)
Platform Name Intel® OpenCL HD Graphics
Device Name Intel® Gen12LP HD Graphics NEO
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Intel® OpenCL HD Graphics
Device Name Intel® Gen12LP HD Graphics NEO
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) Success (1)
Platform Name Intel® OpenCL HD Graphics
Device Name Intel® Gen12LP HD Graphics NEO

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.12
ICD loader Profile OpenCL 2.2

I believe the Intel Neo driver is blacklisted because it doesn’t work well.

Edit: I was wrong, its the other Intel driver that is bad.

The Intel Beignet driver (old OpenCL support, which was buggy and discontinued) was added to a list, the Intel NEO driver (new as-of-years-ago OpenCL support) has not been (AFAIK). It works well with darktable, at least on my laptop.

I’ve been using the NEO one for a while now with darktable and it does speed things up, even on my older laptop with Intel HD Graphics 620 on Kaby Lake (XPS 13 9360, late 2016).

I’d suggest running darktable-cltest and see what happens.

For reference, here’s the output of both clinfo and darktable-cltest on my system:
clinfo.txt (12.5 KB) darktable-cltest.txt (43.6 KB)

The official page for Intel NEO OpenCL is @ https://github.com/intel/compute-runtime

Note: At least on Fedora, I need to install packages that Intel has built in a Copr. It’s not included in Fedora by default. The official Intel Compute Runtime project has information on how to install it other distros (and Fedora too):

OpenCL works for me on darktable 5.3.something, Asus zenbook, linux mint 20.1. Speeds things up nicely.

jon@jon-UX393JA:~$ clinfo
Number of platforms 1
Platform Name Intel® OpenCL HD Graphics
Platform Vendor Intel® Corporation
Platform Version OpenCL 2.1
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator cl_intel_driver_diagnostics cl_khr_priority_hints cl_khr_throttle_hints cl_khr_create_command_queue cl_intel_subgroups_char cl_intel_subgroups_long cl_khr_subgroups cl_khr_il_program cl_intel_spirv_device_side_avc_motion_estimation cl_intel_spirv_media_block_io cl_intel_spirv_subgroups cl_khr_spirv_no_integer_wrap_decoration cl_intel_unified_shared_memory_preview cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_intel_planar_yuv cl_intel_packed_yuv cl_intel_motion_estimation cl_intel_device_side_avc_motion_estimation cl_intel_advanced_motion_estimation cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_image2d_from_buffer cl_khr_depth_images cl_intel_media_block_io cl_khr_3d_image_writes cl_intel_va_api_media_sharing cl_intel_subgroup_local_block_io
Platform Host timer resolution 1ns
Platform Extensions function suffix INTEL

Platform Name Intel® OpenCL HD Graphics
Number of devices 1
Device Name Intel® Gen11 HD Graphics NEO
Device Vendor Intel® Corporation
Device Vendor ID 0x8086
Device Version OpenCL 2.1 NEO
Driver Version 1.0.0
Device OpenCL C Version OpenCL C 2.0
Device Type GPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Linker Available Yes
Max compute units 64
Max clock frequency 1100MHz

Here is my output. Seems it’s not finding a device

0.050567 [opencl_init] opencl related configuration options:
0.050575 [opencl_init]
0.050578 [opencl_init] opencl: 1
0.050581 [opencl_init] opencl_scheduling_profile: ‘default’
0.050584 [opencl_init] opencl_library: ‘’
0.050587 [opencl_init] opencl_memory_requirement: 768
0.050590 [opencl_init] opencl_memory_headroom: 400
0.050592 [opencl_init] opencl_device_priority: ‘/!0,///!0,*’
0.050596 [opencl_init] opencl_mandatory_timeout: 200
0.050599 [opencl_init] opencl_size_roundup: 16
0.050602 [opencl_init] opencl_async_pixelpipe: 0
0.050604 [opencl_init] opencl_synch_cache: active module
0.050607 [opencl_init] opencl_number_event_handles: 25
0.050610 [opencl_init] opencl_micro_nap: 1000
0.050613 [opencl_init] opencl_use_pinned_memory: 0
0.050615 [opencl_init] opencl_use_cpu_devices: 0
0.050618 [opencl_init] opencl_avoid_atomics: 0
0.050620 [opencl_init]
0.050679 [opencl_init] could not find opencl runtime library ‘libOpenCL’
0.050699 [opencl_init] could not find opencl runtime library ‘libOpenCL.so’
0.050806 [opencl_init] found opencl runtime library ‘libOpenCL.so.1’
0.050823 [opencl_init] opencl library ‘libOpenCL.so.1’ found on your system and loaded
0.138065 [opencl_init] found 1 platform
0.138080 [opencl_init] could not get device id size: -1
0.138085 [opencl_init] found 0 device
0.138088 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.138090 [opencl_init] initial status of opencl enabled flag is OFF.

I assume you’re running Pop OS, how did.you install darktable and what version?

1 Like

Yes, it’s PopOS. I have 3.4.1. I got it from the PopStore as flatpak.

You can install the support flatpak for nvidia:

flatpak install flathub org.freedesktop.Platform.GL.nvidia-<something>

Not sure if there is one for AMD cards or Intel, you’ll need to search flathub.

I think I’m about to buy a system76 so i’m following this thread with interest. please excuse the maybe noob question but why would @pdvpjepj need to install nvidia driver for an Iris Xe issue which I believe is from intel?

1 Like

The point wasn’t to install the nvidia driver, but that flatpak has its own driver and won’t use your system’s driver.

1 Like

I

I am pretty new to Linux so maybe I am not getting things right. It seems flatpak is doing some kind of sandboxing which then doesn’t allow the system drivers to be used.

What’s the best way to get around this? What’s the usual way to install darktable? The PopStore has darktable 3.0.1 as deb and 3.4.1 as flatpak. Is there a direct download for darktable on the website? I couldn’t find anything.

The 3rd party repo might be the easiest? install | darktable

That did it. The OpenCL checkbox is checked now. It’s a very good thing to know about flatpak! I have decades of Windows experience but with Linux I am new and don’t know all of the pitfalls (yet hopefull).

1 Like