[SOLVED] Can I properly enable OpenCL on Windows 11 and Intel Iris Xe graphics in Darktable 4.0?

Hi all, I have been searching this forum and Googling and Github to no avail regarding properly enabling OpenCL in Darktable for the integrated Intel Iris Xe graphics (Alder lake i5 1240P processor with up to date drivers). I am unable to properly enable OpenCL in Darktable 4.0 on Windows, even though I believe this Iris Xe graphics is capable of OpenCL compute.

I found previous threads on this forum, such as this: New install on Windows 11 not working. However, the conclusion from that thread seems like it does not work with Iris Xe graphics? And the compatibility pack from the Windows Store is also not compatible, ironically enough (https://github.com/darktable-org/darktable/issues/10767). When I installed the compatibility pack from Windows Store, I think it ended up forcing all the OpenCL computation on the CPU rather than GPU, causing my CPU to nearly max out and make the whole thing slow.

I have the alder lake Intel i5-1240P CPU (with Intel Iris Xe graphics and 16 GB RAM). The graphics drivers are all up to date (30.0.101.1743). It is the latest Intel ARC Windows* DCH driver (also compatible with Alder lake CPUs). And the Intel Graphics Command Center says that the OpenCL Runtime Version is 3.0. So, as far as I can tell, this GPU is capable of OpenCL right? So, is it possible to enable it for Darktable or is it just not properly supported yet?

I would greatly appreciate any help, as I am a new user of Darktable (migrating from the last standalone Lightroom Classic version 6!)

Thanks!
-litetaker

SOLUTION: [SOLVED] Can I properly enable OpenCL on Windows 11 and Intel Iris Xe graphics in Darktable 4.0? - #11 by litetaker

I believe you can force GPU use in the case from the GPU device line in darktablerc config file…I am on my phone and busy with family stuff for the day so I don’t have time to look it up but @elstoc or @kofa or @hannoschwalm might be able to give you the correct parameter to change from disabled to enabled…

Don’t understand your exact issue, your device should be supported. Unfortunately there are Intel driver issues sometimes happening. So

  1. Your device has a buggy driver and thus might get disabled.
  2. Dt disabled it somehow, in that case you can check and work as in

There is the manual BTW, it’s all in there and will save your time later. :sunglasses:

I think this GPU is blacklisted… :frowning:

I ran darktable-cltest.exe and got the following output:

[opencl_init] opencl related configuration options:
[opencl_init] opencl: OFF
[opencl_init] opencl_scheduling_profile: 'default'
[opencl_init] opencl_library: 'default path'
[opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 400
[opencl_init] opencl_synch_cache: active module
[opencl_init] opencl library 'OpenCL.dll' found on your system and loaded
[opencl_init] found 2 platforms
[opencl_init] found 2 devices

[dt_opencl_device_init]
   DEVICE:                   0: 'Intel(R) Iris(R) Xe Graphics'
   CANONICAL NAME:           intelririsrxegraphics
   PLATFORM NAME & VENDOR:   Intel(R) OpenCL HD Graphics, Intel(R) Corporation
   DRIVER VERSION:           30.0.101.1743
   DEVICE VERSION:           OpenCL 3.0 NEO
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          6427 MB
   MAX MEM ALLOC:            3214 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      256
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 256 256 256 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   PERFORMANCE:              0.000000 (CPU 0.115721)
   DEFAULT DEVICE:           NO
   *** marked as disabled ***

[dt_opencl_device_init]
   DEVICE:                   1: '12th Gen Intel(R) Core(TM) i5-1240P'
   CANONICAL NAME:           12thgenintelrcoretmi51240p
   PLATFORM NAME & VENDOR:   Intel(R) OpenCL, Intel(R) Corporation
   DRIVER VERSION:           2022.13.3.0.16_160000
   DEVICE VERSION:           OpenCL 3.0 (Build 0)
   DEVICE_TYPE:              CPU
   GLOBAL MEM SIZE:          16069 MB
   MAX MEM ALLOC:            8034 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      8192
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 8192 8192 8192 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                1000
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   PERFORMANCE:              0.000000 (CPU 0.115721)
   DEFAULT DEVICE:           NO
   *** marked as disabled ***
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

Note the device version OPENCL 3.0 NEO. And this is blacklisted on Windows as per https://github.com/darktable-org/darktable/blob/master/src/common/opencl_drivers_blacklist.h#L38

Hmm, do I need to recompile darktable and remove that from the header file OR somehow override the blacklist?

The neo drivers are indeed blacklisted as not supported properly by Intel.

I am on my phone and don’t remember exactly the conf key in draktablerc to override the blacklisting.

Don’t know Intel stuff really well, there should be onother opencl driver for your device Anyway.

I got the same issue on older gpu

[opencl_init] opencl related configuration options:
[opencl_init] opencl: ON

[dt_opencl_device_init]
DEVICE: 0: 'Intel(R) HD Graphics 520’
CANONICAL NAME: intelrhdgraphics520
PLATFORM NAME & VENDOR: Intel(R) OpenCL HD Graphics, Intel(R) Corporation
DRIVER VERSION: 30.0.101.1994
DEVICE VERSION: OpenCL 3.0 NEO
DEVICE_TYPE: GPU
…
*** marked as disabled ***
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

If you can point me to the correct config option in darktablerc to override the blacklisting, that will be great. In the meantime, I plan to recompile darktable on my PC by modifying that blacklist header file to remove the blacklisting on Windows.

EDIT: The config option seems to be opencl_disable_drivers_blacklist=TRUE. But that still did nothing… hmmm…

There are good reasons for blacklisting. You can try the device conf key setting described in the link too but NEO ist just outdated.

You really should look for recent drivers, Intel definetly has docs…

I think you have outdated information. I think NEO is simply the code name for this driver but these are the latest drivers.

I have Intel UHD graphics (IceLake) on Linux. The device version is listed as OpenCL 3.0 NEO but OpenCL is available. I have the latest Intel drivers.

I think I got it to work! It looks like there is a bug in the code which makes it not fully respect the opencl_disable_drivers_blacklist=TRUE config parameter. And also I had to delete already registered configurations for my devices from the darktablerc file under the names cldevice_v4_intelririsrxegraphics etc. Then, re-run the darktable-cltest.exe two times for it to compile the kernel modules for my GPU. And now OpenCL works :slight_smile:

More detailed solution:

How to fix the issue with OpenCL not working on Windows with an Intel integrated graphics:
(As of Darktable version 4.0)

  • Go to C:\Users<Username>\AppData\Local\darktable
  • Open the darktablerc file. Search for already configured CL devices: these will have config keys starting with cldevice_
  • Delete all the lines starting with cldevice_ to essentially delete already configured devices for OpenCL.
  • Check if there is a already a line starting with opencl_disable_drivers_blacklist=. If so, add TRUE at the end or else, add a new line with opencl_disable_drivers_blacklist=TRUE
  • Go to the Darktable bin folder where you will find darktable_cltest.exe. At the moment, due to a bug, you will have to run the following command twice to properly setup your integrated GPU to use OpenCL: darktable-cltest.exe -d opencl (if they incorporate my bug fix, then you only need to run this command once)
    • You probably don’t have to run darktable-cltest.exe but perhaps just open darktable and it may also setup OpenCL devices
7 Likes

Yes, on Linux this driver is not blacklisted. On Windows it is still left blacklisted since 2019. I really don’t think it needs to be… Had to override it. Anyway got it to work now. But there is definitely a bug in their code and I will send a bug fix to make this flag work correctly the first time.

bravo, it works also for my older card.

Note that @wpferguson has been making weekly windows builds of master. It seems not enough windows users have been using them, as bugs are being found post release. Darktable does not have enough windows testers. If you want a better release version, start testing the master builds when we get close to release.

4 Likes

I have commented your pr https://github.com/darktable-org/darktable/pull/12155

explaining why i think it’s not correct.

In my case, I just had to delete the two lines in darktablerc file
cldevice_v4_intelrhdgraphics520=0 250 0 16 16 128 0 1 0.000000 cldevice_v4_intelrhdgraphics520_id0=400
then using darktable_cltest.exe, two new lines were written on that file
cldevice_v4_intelrhdgraphics520=0 250 0 16 16 128 0 0 0.118311 cldevice_v4_intelrhdgraphics520_building=-cl-fast-relaxed-math
any way thanks a lot for your quick answers

Just wondering - Is darktable’s availability on Windows an official aim of the project, or just because someone is available to port it (for whatever effort that requires)? I realize at some level obviously “someone’s availability” is a requirement for everything. I’m just curious if a Windows binary is a core goal or an added bonus. A minor point that triggered my question is the occasional assumption in the docs that it’s running on Linux. That may just be a by-product of DT’s roots.

Thanks.

The code is there on the repo and instructions are provided to compile it for WIn, MacOS and flavours of Linux…I think the focus on the code as it is developed is a working Linux version and then people assist with porting it to WIndows and Mac… and subsequently troubleshooting specific OS issues…

1 Like

@priort is correct, the code is there in the repo and changes to increase stability on any platform are generally accepted. Windows is a goal as long as someone is there to contribute to it. Most of the developers use Linux and so it runs best there.

The project is definely short on Windows developers and testers; you can see this as now that 4.0 is released, there are some (IMO) easy to spot bugs being reporter that only affect windows.

@wpferguson makes a weekly windows build I wish more people would use, then we would have less bugs at release time. But its only as good as people make it.

Before 4’s GA release I was using the weekly builds regularly. I’ve not updated since but will. My biggest problem right now is that I’m just not shooting much, hence little editing. I guess my workflow hasn’t hit too many of the bugs so far.