OpenCL Unstable - Darktable 4.4.2 - Black Image or Preview and Histogram

Certain modules result in one of two issues…

1 - Image Shows but Preview and Histogram are black
2 - Image is black but Preview and Histogram show

Windows 11
13th Gen Core i7 1360P
Intel Iris XE
ARC A350M (I downloaded the ARC driver directly from Intel website)

Currently, I’m trying to use the Multiple GPUs option

Modules in blue work fine, modules in red start causing the problems stated above. For this example, only scenario 1 is consistent, so let’s focus on that.

All blue modules will work fine when selected, red causes the Preview and Histogram to go black. This happens as I toggle between the Blue and Red Modules.

Disabling OpenCL results in Image + Preview + Histogram always visible (just painfully slow)

Blue Modules:

Red Modules:

darktablerc…

cldevice_v5_intelropencl13thgenintelrcoretmi71360p=0 1000 0 16 16 128 0 1 0.000000 0.000
cldevice_v5_intelropencl13thgenintelrcoretmi71360p_id0=400
cldevice_v5_intelropencl13thgenintelrcoretmi71360p_id2=400
cldevice_v5_intelropenclgraphicsintelrarctma350mgraphics=0 250 0 16 16 128 0 0 1000000.000000 0.000
cldevice_v5_intelropenclgraphicsintelrarctma350mgraphics_building=
cldevice_v5_intelropenclgraphicsintelrarctma350mgraphics_id0=400
cldevice_v5_intelropenclgraphicsintelrarctma350mgraphics_id1=400
cldevice_v5_intelropenclgraphicsintelririsrxegraphics=0 250 0 16 16 128 0 0 1000000.000000 0.000
cldevice_v5_intelropenclgraphicsintelririsrxegraphics_building=
cldevice_v5_intelropenclgraphicsintelririsrxegraphics_id0=400
opencl=TRUE
opencl_checksum=2693667376
opencl_device_priority=*/!0,*/*/*/!0,*
opencl_disable_drivers_blacklist=
opencl_library=
opencl_mandatory_timeout=400
opencl_scheduling_profile=multiple GPUs
opencl_tuning_mode=nothing

test…

     0.0722 [dt_get_sysresource_level] switched to 2 as `large'
     0.0738   total mem:       16067MB
     0.0751   mipmap cache:    2008MB
     0.0762   available mem:   10983MB
     0.0774   singlebuff:      251MB
     0.0783   OpenCL tune mem: OFF
     0.0793   OpenCL pinned:   OFF
[opencl_init] opencl related configuration options:
[opencl_init] opencl: ON
[opencl_init] opencl_scheduling_profile: 'multiple GPUs'
[opencl_init] opencl_library: 'default path'
[opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 400
[opencl_init] opencl library 'OpenCL.dll' found on your system and loaded
[opencl_init] found 3 platforms
[opencl_init] found 3 devices

[dt_opencl_device_init]
   DEVICE:                   0: 'Intel(R) Iris(R) Xe Graphics'
   PLATFORM NAME & VENDOR:   Intel(R) OpenCL Graphics, Intel(R) Corporation
   CANONICAL NAME:           intelropenclgraphicsintelririsrxegraphics
   DRIVER VERSION:           31.0.101.4824
   DEVICE VERSION:           OpenCL 3.0 NEO
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          6427 MB
   MAX MEM ALLOC:            3213 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
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   PERFORMANCE:              0.000
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   C:\Program Files\darktable\share\darktable\kernels
   KERNEL DIRECTORY:         C:\Users\joeys\AppData\Local\Microsoft\Windows\INetCache\darktable\cached_v1_kernels_for_IntelROpenCLGraphicsIntelRIrisRXeGraphics_3101014824
   CL COMPILER OPTION:
   KERNEL LOADING TIME:       0.0246 sec

[dt_opencl_device_init]
   DEVICE:                   1: 'Intel(R) Arc(TM) A350M Graphics'
   PLATFORM NAME & VENDOR:   Intel(R) OpenCL Graphics, Intel(R) Corporation
   CANONICAL NAME:           intelropenclgraphicsintelrarctma350mgraphics
   DRIVER VERSION:           31.0.101.4824
   DEVICE VERSION:           OpenCL 3.0 NEO
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          3938 MB
   MAX MEM ALLOC:            1969 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
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   PERFORMANCE:              0.000
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   C:\Program Files\darktable\share\darktable\kernels
   KERNEL DIRECTORY:         C:\Users\joeys\AppData\Local\Microsoft\Windows\INetCache\darktable\cached_v1_kernels_for_IntelROpenCLGraphicsIntelRArcTMA350MGraphics_3101014824
   CL COMPILER OPTION:
   KERNEL LOADING TIME:       0.0865 sec

[dt_opencl_device_init]
   DEVICE:                   2: '13th Gen Intel(R) Core(TM) i7-1360P'
   PLATFORM NAME & VENDOR:   Intel(R) OpenCL, Intel(R) Corporation
   CANONICAL NAME:           intelropencl13thgenintelrcoretmi71360p
   DRIVER VERSION:           2023.16.6.0.28_042959
   DEVICE VERSION:           OpenCL 3.0 (Build 0)
   DEVICE_TYPE:              CPU
   GLOBAL MEM SIZE:          16067 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
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   *** marked as disabled ***
[opencl_init] OpenCL successfully initialized. Internal numbers and names of available devices:
[opencl_init]           0       'Intel(R) OpenCL Graphics Intel(R) Iris(R) Xe Graphics'
[opencl_init]           1       'Intel(R) OpenCL Graphics Intel(R) Arc(TM) A350M Graphics'
[opencl_init] FINALLY: opencl is AVAILABLE and ENABLED.
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[dt_opencl_update_priorities]           1       1       1       1       1
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[opencl_synchronization_timeout] synchronization timeout set to 20
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[dt_opencl_update_priorities]           1       1       1       1       1
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[opencl_synchronization_timeout] synchronization timeout set to 20

How much system memory do you have… only 16 GB?? You could try to set things to default for resources and also you could try to make everything use your many GPU not the integrated one…

Modify this line…

opencl_device_priority=/!0,///!0,*

set them all to your GPU… see how that behaves…

Others will read those results better than me but I think you have too many entries… I would back up your config file and delete all the open cl lines and then rerun DT and let it re create the settings and see how they compare…

Can you post a log file of when the black image happens? I think -d opencl should be enough. This looks similar to an issue that was raised in github two weeks ago and fixed in master.

Hi Todd Thank you so much for your support.

I should have mentioned memory… 16GB

I will try to edit the file and change the setting to default. To clarify, should I copy your string exactly, or fill out each parameter like this?

opencl_device_priority=!0/!0/!0/!0/!0

Apologies for my lack of knowledge, new to all this. I have tinkered with the settings after reading the manual, but my edits never reflect in the test log. I haven’t tried completely ignoring device 0 yet.

I’ll try backing up the file as you suggested if the code change doesn’t work.

Hi g-man, thank you for your support! About that… I attempted to run the log file but I’m falling short. I’ve never used command prompt before today. I think I finally got it to work, but the log file was nowhere to be found and the internet didn’t return any results on where to find it (or the file wasn’t where people said it would be).

Unfortunately, I would need step by step instructions on how to run the log file (student being someone who’s never used command prompt before). I’ll keep learning about it and post a log file asap.

It’s encouraging that somebody might have already looked into this issue!

The log goes into a super hidden folder of windows. You can’t click into it. You have to type the location

One way to get logging on windows that doesn’t involve the command prompt is to create desktop shortcut, then in the target field add the required argument.
image
In this case I have -d perf as that was what I wanted, not -d opencl but it works the same. You can’t see all the text so here it is:

"C:\Program Files\darktable-4.5.0+524\bin\darktable.exe" -d perf"

It’s been a while since I used it but I think that’s correct. (except the address to your darktable will be different - just leave what you have)

The log file will end up here… at least in my case.

C:\Users\USER\AppData\Local\Microsoft\Windows\INetCache\darktable

You can copy paste into the explorer address bar, don’t forget to change ‘USER’ to whatever your user folder is called (your username normally).
That folder will have a few things in it…

I think your arc was device 1?? so edit so that all the previews use that device in the priority line… The other thing I suggested was to delete the opencl lines in your darktablerc file and then run DT and it should recreate them… backup fist …

While in DT, I clicked on the modules to see the black areas appear. Nothing was writing to the log file, so I triggered a bug I’ve encountered - this DID write to the log file. So, I’m thinking the missing Image/Preview/Histogram isn’t being logged.

This is all I got…

Magick: caught exception 0xC0000005 "Access violation"...

Worked like a charm! Thank you!

1 Like

Ok, we’re getting somewhere. I changed the configuration file to ignore 0, and only use ARC with this code. And then I changed the OpenCL setting in DT from Multiple GPUs to Default…

opencl_device_priority=!0,*/!0,*/!0,*/!0,*/!0,*

DT test registered in nicely, but the bug persisted

So, I got curious and swapped it with this code to ignore ARC

opencl_device_priority=!1,*/!1,*/!1,*/!1,*/!1,*

Wouldn’t you know it finally worked. Here’s the test output.

[opencl_init] OpenCL successfully initialized. Internal numbers and names of available devices:
[opencl_init]           0       'Intel(R) OpenCL Graphics Intel(R) Iris(R) Xe Graphics'
[opencl_init]           1       'Intel(R) OpenCL Graphics Intel(R) Arc(TM) A350M Graphics'
[opencl_init] FINALLY: opencl is AVAILABLE and ENABLED.
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[dt_opencl_update_priorities]           -1      -1      -1      -1      -1
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[opencl_synchronization_timeout] synchronization timeout set to 200
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[dt_opencl_update_priorities]           -1      -1      -1      -1      -1
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[opencl_synchronization_timeout] synchronization timeout set to 200

The culprit must be ARC, which is a bummer because I thought it was supposed to be some fancy upgrade and I REALLY want to be able to process with Multiple GPUs to get the performance.

In summary, OpenCL is technically working, but it won’t work with ARC A350M (for now).

I should mention that I reset everything to original settings & configuration before I ran the bug report for g-man.

1 Like

What about if you just check to be sure you have the very latest drivers… you likely have…

Intel’s version came with a handy control panel. Definitely the first place to start, though. I’ll keep looking into this and post any revelations.

Maybe this PR could explain the issue you had with the ARC card.

You will see this fix in the 4.6 release around winter solstice or current master (development version).