How to enable OpenCl in Darktable

I use darktable in Zorin 17, and here is an option to run the programm with OpenCLSupport for faster rendering. I think all (opencl-)drivers are installed, but in darktable the opencl option is greyed out. How can I enable it?

Do you have file permissions on the file you are opening with Darktable?

On the photo-files, I want to edit, I have permissions to read/write

Which video card do you have? AFAIK you can only enable it with nvidia cards.

1 Like

I have an Intel Arc 770A, but in the darktable-settings seems a Intel Driver "installed"


But enabling OpenCL is greyed out

The intel driver for Linux is a bit lacking compared to its Windows counterparts, so it may be a reason it's grayed out.

Ah Okay! I hope the driver is getting better in near future!

I tried to install intel-opencl-drivers and I think that I come a little bit nearer to solve it.
"clinfo" gives following output:

$ clinfo
Number of platforms                               2
  Platform Name                                   Intel(R) OpenCL HD Graphics
  Platform Vendor                                 Intel(R) Corporation
  Platform Version                                OpenCL 3.0 
  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_command_queue_families 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_il_program cl_intel_mem_force_host_memory cl_khr_subgroup_extended_types cl_khr_subgroup_non_uniform_vote cl_khr_subgroup_ballot cl_khr_subgroup_non_uniform_arithmetic cl_khr_subgroup_shuffle cl_khr_subgroup_shuffle_relative cl_khr_subgroup_clustered_reduce cl_intel_device_attribute_query cl_khr_suggested_local_work_size cl_intel_spirv_media_block_io cl_intel_spirv_subgroups cl_khr_spirv_no_integer_wrap_decoration cl_intel_unified_shared_memory 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_khr_3d_image_writes cl_intel_media_block_io cl_intel_va_api_media_sharing cl_intel_sharing_format_query cl_khr_pci_bus_info cl_intel_create_buffer_with_properties cl_intel_dot_accumulate cl_intel_subgroup_local_block_io cl_intel_subgroup_matrix_multiply_accumulate 
  Platform Extensions with Version                cl_khr_byte_addressable_store                                    0x400000 (1.0.0)

......


and "darktable-cltest":

darktable-cltest
darktable 4.6.0
Copyright (C) 2012-2023 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.2.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> ENABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> DISABLED
  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,0159 [dt_get_sysresource_level] switched to 2 as `large'
     0,0159   total mem:       63875MB
     0,0159   mipmap cache:    7984MB
     0,0159   available mem:   43664MB
     0,0159   singlebuff:      998MB

     0.0220 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.0336 [opencl_init] found 2 platforms
     0.0337 [opencl_init] detected wrong OpenCL platforms setup
     0.0337 [opencl_init] FINALLY: opencl is NOT AVAILABLE and NOT ENABLED.
in my opinion, the only error is :
 0.0337 [opencl_init] detected wrong OpenCL platforms setup

But what is "wrong setup"?
Has anybody an idea?

What is your terminal output for

lshw -C video | grep driver

The output of "lshw -C video | grep driver" is:

Konfiguration: depth=32 driver=i915 latency=0 resolution=3840,6480
Konfiguration: driver=i915 latency=0

Must be a vertical monitor. That is an interesting resolution.

Have you checked the pointers here:

Thank you Aravisian for your link. I read an tried a lot. But I'm such a newbi in linux.

The output of some commands from the link:
sudo lshw -C video:
*-display
Beschreibung: VGA compatible controller
Produkt: Intel Corporation
Hersteller: Intel Corporation
Physische ID: 0
Bus-Informationen: pci@0000:03:00.0
Logischer Name: /dev/fb0
Version: 08
Breite: 64 bits
Takt: 33MHz
Fähigkeiten: pciexpress msi pm vga_controller bus_master cap_list rom fb
Konfiguration: depth=32 driver=i915 latency=0 resolution=3840,6480
Ressourcen: iomemory:600-5ff irq:207 memory:6b000000-6bffffff memory:6000000000-63ffffffff memory:6c000000-6c1fffff
*-display
Beschreibung: VGA compatible controller
Produkt: Alder Lake-P Integrated Graphics Controller
Hersteller: Intel Corporation
Physische ID: 2
Bus-Informationen: pci@0000:00:02.0
Version: 0c
Breite: 64 bits
Takt: 33MHz
Fähigkeiten: pciexpress msi pm vga_controller bus_master cap_list rom
Konfiguration: driver=i915 latency=0
Ressourcen: iomemory:640-63f iomemory:400-3ff irq:206 memory:644c000000-644cffffff memory:4000000000-400fffffff ioport:4000(Größe=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40ffffffff

Clinfo

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

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

I'm not good in understanding these messages, but I think the driver is installed?

The driver is right I think, but where can I change the resolution?
Do I have to edit a config-file?

The output of

lspci | grep VGA

00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P Integrated Graphics Controller (rev 0c)
03:00.0 VGA compatible controller: Intel Corporation Device 5690 (rev 08)

seems to be okay?

$ darktable-cltest

darktable 4.6.0
Copyright (C) 2012-2023 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.2.0
Colord -> ENABLED
gPhoto2 -> ENABLED
GMIC -> ENABLED - Compressed LUTs are supported
GraphicsMagick -> ENABLED
ImageMagick -> DISABLED
libavif -> ENABLED
libheif -> ENABLED
libjxl -> DISABLED
OpenJPEG -> ENABLED
OpenEXR -> ENABLED
WebP -> ENABLED

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

 0,0118 [dt_get_sysresource_level] switched to 2 as `large'
 0,0118   total mem:       63875MB
 0,0118   mipmap cache:    7984MB
 0,0118   available mem:   43664MB
 0,0118   singlebuff:      998MB
 0.0138 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
 0.0405 [opencl_init] found 2 platforms
 0.0405 [opencl_init] detected wrong OpenCL platforms setup
 0.0405 [opencl_init] FINALLY: opencl is NOT AVAILABLE and NOT ENABLED.

Darktable found opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
In my opinion that is good?
But how can I set the wrong platform setup to the right?

Clinfo: output

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

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

I have many "success" messages here, but "no device found on platform" ?

AravisianCommunity Leader

3d

What is your terminal output for

lshw -C video | grep driver

Timmy

3d

Meanwhile, I used now a Display-Port instead of HMDI-Port and that changed the resolution to:

The output of "lshw -C video | grep driver" is:

Konfiguration: depth=32 driver=i915 latency=0 resolution=3840,6480
Konfiguration: driver=i915 latency=0

Maybe I'm a little bit closer to the solution? What can I do else!

Can you clarify if you have more than one monitor? Or is your monitor one 4k monitor mounted vertically?
While Intel (Alder Lake) i915 is your integrated graphics, do you also have a dedicated graphics card like Nvidia?

Looking deeper into this issue, it seems a common one on Windows and GnuLinux OS which makes searching to see if there are solutions out in the wild a bit harder. I have not used Darktable very much and never ran into this issue personally, so I must learn alongside of you.

It does appear that OpenCl is a bit touchy about how it is installed in regards to how it will perform later. For example, if installing with older GPUY or GPU drivers, it must be installed with the =legacy parameter. Whereas on newer drivers, it must be installed with ROCr or ROCm. Both of the latter are unfamiliar to me since I have never been in this rabbit hole before.
Will need to look into it further.

Meanwhile, I used now a Display-Port instead of HMDI-Port and that changed the resolution to:

The output of "lshw -C video | grep driver" is:

Konfiguration: depth=32 driver=i915 latency=0 resolution=3840,2160
Konfiguration: driver=i915 latency=0

I have an onboard GPU and an Intel Arc 770