DT 5.0.1, the nvidia saga

DT 5.0.1 on Tumbleweed current with an Nvidia 4060 card. DT is “slow”. So I ran darktable-cltest and it says that:

opencl disabled via darktable preferences

When I looked in DT it’s all greyed out. Here’s the output:

$ darktable-cltest
darktable 5.0.1
Copyright (C) 2012-2025 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.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> DISABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.21.3-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.3131 [dt_get_sysresource_level] switched to 1 as `default'
     0.3132   total mem:       31600MB
     0.3132   mipmap cache:    3950MB
     0.3132   available mem:   15800MB
     0.3132   singlebuff:      246MB
     0.3231 [opencl_init] opencl disabled via darktable preferences
     0.3231 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL' <<<<
     0.3231 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so' <<<<
     0.3232 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path' <<<<
     0.4420 [opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'NVIDIA GeForce RTX 4060 Laptop GPU'
   CONF KEY:                 cldevice_v5_nvidiacudanvidiageforcertx4060laptopgpu
   PLATFORM, VENDOR & ID:    NVIDIA CUDA, NVIDIA Corporation, ID=4318
   CANONICAL NAME:           nvidiacudanvidiageforcertx4060laptopgpu
   DRIVER VERSION:           570.144
   DEVICE VERSION:           OpenCL 3.0 CUDA, SM_20 SUPPORT
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          7808 MB
   MAX MEM ALLOC:            1952 MB
   MAX IMAGE SIZE:           32768 x 32768
   MAX WORK GROUP SIZE:      1024
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 1024 1024 64 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   USE HEADROOM:             600Mb
   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/froggy/.cache/darktable/cached_v5_kernels_for_NVIDIACUDANVIDIAGeForceRTX4060LaptopGPU_570144
   CL COMPILER OPTION:       -cl-fast-relaxed-math
   CL COMPILER COMMAND:      -w -cl-fast-relaxed-math -DNVIDIA_SM_20=1 -DNVIDIA=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       0.0518 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]		0	'NVIDIA CUDA NVIDIA GeForce RTX 4060 Laptop GPU'
     0.6356 [opencl_init] FINALLY: opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED.
[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
[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

But libOpenCL1 is installed:

Information for package libOpenCL1:
-----------------------------------
Repository     : repo-non-free
Name           : libOpenCL1
Version        : 2.3.1-60.3
Arch           : x86_64
Vendor         : obs://build.suse.de/Proprietary:X11:Drivers
Installed Size : 189.0 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : ocl-icd-2.3.1-60.3.src
Upstream URL   : https://github.com/OCL-dev/ocl-icd
Summary        : OpenCL ICD Bindings
Description    : 
    OpenCL is a royalty-free standard for cross-platform, parallel programming
    of modern processors found in personal computers, servers and
    handheld/embedded devices.

    This package provides an Installable Client Driver Bindings (ICD Bindings).
    The provided libOpenCL library is able to load any free or non-free installed
    ICD (driver backend).

What am I missing?

Thanks

Go into your darktable preferences and make sure openCL and nvidia are enabled.

2 Likes

Erm, you do have the proprietary drivers installed? I’m running tumbleweed with an (older) NVidia card, darktable runs rather well with openCL iff I install the proprietary drivers (through the NVidia repostory)

You mean everything is grey, all checkboxes are disabled in preferences/processing, most importantly, activate OpenCL support, too? Because opencl disabled via darktable preferences normally means that checkbox is unchecked.

There is no contradiction or disagreement between darktable-cltest and your evidence for OpenCL being installed; it was also found by darktable:

opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
found 1 platform

Might be this: https://github.com/darktable-org/darktable/issues/18373

2 Likes

Can’t: everything in opencl gpu acceleration is greyed out

Some people have had problems because they had a mixture of packages installed (e.g. launched the application via a FlatPak/AppImage icon, but also had a native package).
In the darktable-cltest output, we see opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED:

[opencl_init]		0	'NVIDIA CUDA NVIDIA GeForce RTX 4060 Laptop GPU'
     0.6356 [opencl_init] FINALLY: opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED.

Yet, your GUI shows it as unavailable.

  • Any chance you could have such a mixture of packages?
  • If you run darktable from the command-line, with darktable -d opencl, what do you get?

But somehow DT is not using it and now DT is quite slow.

I have monitored with nvidia-smi and DT is not even listed. Every thing is done by the cpu.

See:

  1. I only have DT installed, no appimage nor flatpak.
  2. Here’s the darktable -d opencl
$ darktable -d opencl
darktable 5.0.1
Copyright (C) 2012-2025 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.4.0
  Colord                 -> ENABLED
  gPhoto2                -> ENABLED
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> DISABLED
  ImageMagick            -> DISABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.21.3-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.0001 [dt starting]
 darktable -d opencl
     0.1716 [dt_get_sysresource_level] switched to 1 as `default'
     0.1716   total mem:       31600MB
     0.1716   mipmap cache:    3950MB
     0.1716   available mem:   15800MB
     0.1716   singlebuff:      246MB
     0.1991 [opencl_init] opencl disabled via darktable preferences
     0.1992 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.1992 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.1993 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
     0.4271 [opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'NVIDIA GeForce RTX 4060 Laptop GPU'
   CONF KEY:                 cldevice_v5_nvidiacudanvidiageforcertx4060laptopgpu
   PLATFORM, VENDOR & ID:    NVIDIA CUDA, NVIDIA Corporation, ID=4318
   CANONICAL NAME:           nvidiacudanvidiageforcertx4060laptopgpu
   DRIVER VERSION:           570.144
   DEVICE VERSION:           OpenCL 3.0 CUDA, SM_20 SUPPORT
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          7808 MB
   MAX MEM ALLOC:            1952 MB
   MAX IMAGE SIZE:           32768 x 32768
   MAX WORK GROUP SIZE:      1024
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 1024 1024 64 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   USE HEADROOM:             600Mb
   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/froggy/.cache/darktable/cached_v5_kernels_for_NVIDIACUDANVIDIAGeForceRTX4060LaptopGPU_570144
   CL COMPILER OPTION:       -cl-fast-relaxed-math
   CL COMPILER COMMAND:      -w -cl-fast-relaxed-math -DNVIDIA_SM_20=1 -DNVIDIA=1 -I"/usr/share/darktable/kernels"
   KERNEL LOADING TIME:       0.0459 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init]		0	'NVIDIA CUDA NVIDIA GeForce RTX 4060 Laptop GPU'
     0.5641 [opencl_init] FINALLY: opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED.
[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
[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
 [opencl_summary_statistics] device 'NVIDIA CUDA NVIDIA GeForce RTX 4060 Laptop GPU' (0): NOT utilized

So how do I enable opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED. The screenshot says not available.

Is the a config in darktablerc?

cldevice_v5_nvidiacudanvidiageforcertx4060laptopgpu=0 250 0 16 16 128 0 0 0.000 0.000 0.250
cldevice_v5_nvidiacudanvidiageforcertx4060laptopgpu_building=-cl-fast-relaxed-math
cldevice_v5_nvidiacudanvidiageforcertx4060laptopgpu_id0=600
clplatform_amdacceleratedparallelprocessing=FALSE
clplatform_apple=FALSE
clplatform_intelropenclhdgraphics=TRUE
clplatform_nvidiacuda=TRUE
clplatform_openclon12=FALSE
clplatform_other=FALSE
clplatform_rusticl=FALSE

opencl=TRUE
in darktablerc, but should be configurable via GUI if your installation is correct.

1 Like

Yes, but see the screenshot above.

Could you list the NVidia packages you have installed?

And it’s still greyed out on the preferences UI, even when launching from the command-line like above? Could you please check that, just to rule out the possibility of somehow having two installations?

And also check ~/.config/darktable/darktablerc, as @pehar suggested. The output contains:

     0.1991 [opencl_init] opencl disabled via darktable preferences
    [...]
    0.5641 [opencl_init] FINALLY: opencl PREFERENCE=OFF is AVAILABLE and NOT ENABLED.

To make sure you run dt with a “correkt” and “fresh” darktablerc you could start it from the command line with option

--configdir <user config directory>

for test purposes , where "user config directory" is pointing to an empty directory. In this case dt creates a new darktablerc (and much more) in this directory. With your output

opencl PREFERENCE=OFF is AVAILABLE

you should find opencl=TRUE in this new darktablerc afterwards.

If you manually edit a setting in darktablerc make sure the application is not running, otherwise your changes will be overwritten when darktable is closing.

2 Likes

When was the last time you did an OS shutdown/restart? Some times nvidia is interesting.

2 Likes

Not sure if it is helpful but a few times I had to re install NVIDIA drivers.
Since I use PopOS they gave me these lines before

I know this maybe very trivial for a lot of you but I do have to go back to my notes every now and then.

sudo apt purge ~nnvidia
sudo apt clean
sudo apt update
sudo apt install nvidia-driver-550-server
sudo systemctl reboot

on apt install nvidia-driver- I used tab to find out all the packages

Bottom line is - for whatever reason - when I upgrade the nvidia driver (patches etc) - Darktable may stop recognizing it. To resolve it - I perform the above - purge everything and re install it. Then darktable recognizes it.

Currently I am on

nvidia-driver-570-open-server

If find it maybe a bit slower than the closed one

nvidia-driver-570-server

but I expect it would get better overtime.

Also - I use DT from Flatpack and sometimes updating one not the other can get things messed up. And (hopefully) lastly - a few times I cleared the modules in the cache so when DT starts - it re generates them.

:grinning: WE HAVE SUCCESS :laughing:

opencl works! zero change to anything else than point to an empty directory.

Now, do I just overwrite darktablerc from the empty onto the .config/darktable?

Thanks

Or you check the OpenCL-related settings. Something like grep -i cl darktablerc in both directories should do the job.

No, that didn’t work. I copied the opencl settings from the new empty dir in the darktablerc of .config/darktable and it still didn’t use the nvidia card.

I will just reimport everything.

Thank you for the time and effort.