darktable icon indicating copy to clipboard operation
darktable copied to clipboard

local contrast doesn't change displayed image with OpenCL and Intel driver

Open lbilli opened this issue 1 month ago • 3 comments

Is there an existing issue for this?

  • [x] I checked and did not find my issue in the already reported ones

Describe the bug

In darkroom, activating local contrast does not change the display of the main image, though the histogram and the preview image are correctly updated.

This happens on a fresh installation and with any image (jpg or raw) when using opencl.

The issue disappears (i.e. the main image is updated correctly) when starting darktable with --disable-opencl.

Steps to reproduce

  • Go to darkroom with any image
  • activate local contrast and change parameters
  • main image does not change. Histogram and preview image update correctly.

Expected behavior

main image should update

Logfile | Screenshot | Screencast

Output of darktable-cltest:

darktable 5.3.0~git930.1c7eebfb-924.1
Copyright (C) 2012-2025 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Exiv2                  -> 0.28.3
  Lensfun                -> 0.3.4
  Debug                  -> DISABLED
  SSE2 optimizations     -> ENABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.6.0
  Colord                 -> ENABLED
  gPhoto2                -> DISABLED - tethering is NOT available
  OSMGpsMap              -> DISABLED - map view is NOT available
  GMIC                   -> DISABLED - Compressed LUTs are NOT supported
  GraphicsMagick         -> DISABLED
  ImageMagick            -> ENABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> DISABLED
  LibRaw                 -> ENABLED  - Version 0.21.4-Release
  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.6453 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.6453 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.6455 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     0.6692 [opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'Intel(R) HD Graphics 630'
   CONF KEY:                 cldevice_v5_intelropenclgraphicsintelrhdgraphics630
   PLATFORM, VENDOR & ID:    Intel(R) OpenCL Graphics, Intel(R) Corporation, ID=32902
   CANONICAL NAME:           intelropenclgraphicsintelrhdgraphics630
   DRIVER VERSION:           24.35.030872
   DEVICE VERSION:           OpenCL 3.0 NEO 
   DEVICE_TYPE:              GPU, unified mem
   GLOBAL MEM SIZE:          14465 MB
   MAX MEM ALLOC:            4096 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX CONSTANT BUFFER:      4194296 KB
   ADDRESS ALIGN:            128
   MAX WORK GROUP SIZE:      256
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 256 256 256 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH & HEIGHT    16x16
   CHECK EVENT HANDLES:      128
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /usr/share/darktable/kernels
   KERNEL DIRECTORY:         /home/user/.cache/darktable/cached_v5_kernels_for_IntelROpenCLGraphicsIntelRHDGraphics630_2435030872
   CL COMPILER OPTION:       
   CL COMPILER COMMAND:      -w  -DINTEL=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       0.0289 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]           0       'Intel(R) OpenCL Graphics Intel(R) HD Graphics 630'
     0.6984 [opencl_init] FINALLY: opencl PREFERENCE=ON is AVAILABLE and ENABLED.
[opencl_init] opencl_scheduling_profile: 'default'
[opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 1000
[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities]              image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       -1      0       0       -1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities]              image   preview export  thumbs  preview2
[opencl_update_priorities]              0       0       0       0       0
[opencl_synchronization_timeout] synchronization timeout set to 200
   UNIFIED MEM SIZE:         3966 MB reserved for 'intelropenclgraphicsintelrhdgraphics630' id=0[opencl_update_priorities] these are your device priorities:
[opencl_update_priorities]              image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       -1      0       0       -1
[opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[opencl_update_priorities]              image   preview export  thumbs  preview2
[opencl_update_priorities]              0       0       0       0       0
[opencl_synchronization_timeout] synchronization timeout set to 200

Commit

No response

Where did you obtain darktable from?

OBS build

darktable version

5.3.0~git930.1c7eebfb

What OS are you using?

Linux

What is the version of your OS?

openSUSE Tumbleweed

Describe your system

KDE with X11

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

lbilli avatar Nov 25 '25 14:11 lbilli

To analyse this further we would need a proper logfile with d pipe -d opencl including the part where you try to "apply" local contrast. Also xmp plus raw would be fine.

jenshannoschwalm avatar Nov 26 '25 11:11 jenshannoschwalm

Another observation: the issue disappears when activating High Quality processing.

Here's the log of a fresh session:

To summarize:

  • toggling local contrast produces hardly any change in the main image, whereas preview and histogram change drastically.
  • the problem disappears if High Quality processing is activated or OpenCL is disabled.

lbilli avatar Nov 26 '25 14:11 lbilli

I am not sure about this issue.

  1. you have the old and deprecated "clahe" module in your history - the latest master code will tell you better about this, is your issue related about that?
  2. At least on rusticl (amd) i can't reproduce.

The effect of local contrast depends a on the visible region in darkroom window (ROI), so it is expected that darkroom view differs from preview. That's what the HQ processing button is for.

jenshannoschwalm avatar Nov 29 '25 07:11 jenshannoschwalm