<SOLVED> OpenCL support depends on how to start DT in Linux Mint?

Hello reader,

I’m running DT 5.0.1 (as system package) on Linux Mint Cinnamon 22.1 with a AMD Radeon RX 6600 card and OpenCL 1.1 Mesa 24.3.4 - kisak-mesa PPA.

If I start DT on command in a terminal, DT shows in the Processing preferences that OpenCL GPU acceleration settings can be set. When I enable activate OpenCL support and RusticCL as OpenCL driver and restart DT from the terminal, DT indicates that OpenCL is active. One happy user! :grinning:

But if I start DT from a menu item, DT does not recognize OpenCL support anymore. It does not matter if I indicate in the Launcher properties of the menu-item ‘Launch in terminal?’ or ‘Use dedicated GPU if available’. With or without these options enabled in the launcher properties, DT starts without OpenCL. :confused:

I need to start DT again on command in a terminal, re-enable activate OpenCL support, restart again from terminal, before DT is again using OpenCL.

So I’m a little bit flabbergasted. Somehow using a launcher acts different on start up then plain from command line?

I have no clue if this is a Linux (Mint) thing or a DT thing. And so, if this topic is for this forum or for the Linux Mint forum.

Suggestions and advice are welcome!

Part of clinfo output:

Platform Name rusticl
Number of devices 1
Device Name AMD Radeon RX 6600 (radeonsi, navi23, LLVM 17.0.6, DRM 3.57, 6.8.0-53-generic)
Device Vendor AMD
Device Vendor ID 0x1002
Device Version OpenCL 3.0
Device UUID 00000000-2d00-0000-0000-000000000000
Driver UUID 414d442d-4d45-5341-2d44-525600000000
Valid Device LUID No
Device LUID 0000-000000000000
Device Node Mask 0
Device Numeric Version 0xc00000 (3.0.0)
Driver Version 24.3.4 - kisak-mesa PPA
Device OpenCL C Version OpenCL C 1.2
Device OpenCL C Numeric Version 0x402000 (1.2.0)

use the search function for “AMD Radeon opencl”

Where did you get your system package from?

Is it possible that you have two darktable installs?

@g-man
What I thought also, so checked my system and found only one DT in the /usr/bin folder.

Interesting: when I open DT from the file manager (right mouse click open) in this folder, again DT opens without OpenCL support, like when I start it from the menu.
When I open a terminal from within the same folder in the file manager, start DT, DT shows that it knows that I have OpenCL GPU acceleration available.

Wanted to try running darktable-cltest from menu and from command line to examine output and possible differences. Don’t know however to ‘capture’ output from running from the menu. Tried with > or | file.log appending darktable-cltest command in menu item, but not successful so far. Insufficient knowledge.

Running darktable-cltest directly from command line shows:

/usr/bin$ 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 → ENABLED
ImageMagick → DISABLED
libavif → ENABLED
libheif → ENABLED
libjxl → ENABLED
LibRaw → ENABLED - Version 0.22.0-Devel202403
OpenJPEG → ENABLED
OpenEXR → ENABLED
WebP → ENABLED

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

 0,3223 [dt_get_sysresource_level] switched to 2 as `large'
 0,3223   total mem:       32013MB
 0,3223   mipmap cache:    4001MB
 0,3223   available mem:   21884MB
 0,3223   singlebuff:      500MB
 0.3243 [opencl_init] opencl disabled via darktable preferences
 0.3244 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
 0.3244 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
 0.3245 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'
 0.3886 [opencl_init] found 2 platforms
 0.3886 [check platform] platform 'Clover' with key 'clplatform_clover' is NOT active

[opencl_init] found 1 device

[dt_opencl_device_init]
OpenCL Mesa platform Mesa/X.org' --> AMD Radeon RX 6600’
DEVICE: 0: ‘AMD Radeon RX 6600 (radeonsi, navi23, LLVM 17.0.6, DRM 3.57, 6.8.0-53-generic)’
CONF KEY: cldevice_v5_rusticlamdradeonrx6600
PLATFORM, VENDOR & ID: rusticl, Mesa:Mesa/X.org, ID=4098
CANONICAL NAME: rusticlamdradeonrx6600
DRIVER VERSION: 24.3.4 - kisak-mesa PPA
DEVICE VERSION: OpenCL 3.0
DEVICE_TYPE: GPU, dedicated mem
GLOBAL MEM SIZE: 8192 MB
MAX MEM ALLOC: 2048 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
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/henk/.cache/darktable/cached_v5_kernels_for_rusticlAMDRadeonRX6600_2434kisakmesaPPA
CL COMPILER OPTION:
CL COMPILER COMMAND: -w -DAMD=1 -I"/usr/share/darktable/kernels"
KERNEL LOADING TIME: 0.3865 sec
[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init] 0 ‘rusticl AMD Radeon RX 6600’
0.7756 [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

@paperdigits:
From PPA ubuntuhandbook1/darktable.

You have this… is OpenCL enabled in preferences?

For Rusticl, as far as I know, you have to enable it for AMD by setting the environment variable RUSTICL_ENABLE=radeonsi. Is it possible that this variable is not in the environment when launching from the menu item?

1 Like

It is set. I’m not aware that it is possible that starting from a launcher ignores environment variables.

~$ echo $RUSTICL_ENABLE
radeonsi

Sharp! This is output from the first start from command line after a previous launcher (menu) start. DT (re)sets the preference to off in case no opencl is detected in the launcher start. So with first start from command line, I need to enable set that preference (again) to yes, restart DT from command line and then DT uses opencl again.

Output from darktable-cltest after restart:

[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices:
[opencl_init] 0 ‘rusticl AMD Radeon RX 6600’
0.7468 [opencl_init] FINALLY: opencl PREFERENCE=ON is AVAILABLE and ENABLED.
[opencl_init] opencl_scheduling_profile: ‘default’

Yes, but you may also have a snap package or a FlatPak or an AppImage.

Can you check those?

When you have three darktable insurance without OpenCL running, can you open a terminal and type:
ps -aux | grep -i darktable

@kofa
No AppImage and no snap or flatpak. Started DT from menu (so no opencl active), opened terminal:

ps -aux | grep -i darktable
henk 4284 28.4 0.8 3862260 276348 pts/1 SLsl+ 12:53 0:07 /usr/bin/darktable
henk 4420 0.0 0.0 9292 2304 pts/2 S+ 12:53 0:00 grep --color=auto -i darktable

I think I may be on to something.
Opening DT with command /usr/bin/darktable -d opencl shows a difference between menu/launcer start and plain commandline.
From launcher DT reports that “[opencl_init] no devices found for Mesa/X.org (vendor) - rusticl (name)”. Somehow the Mesa driver cannot be found?

From menu/launcher:


0.0001 [dt starting]
/usr/bin/darktable -d opencl
2,6572 [dt_get_sysresource_level] switched to 2 as `large’
2,6573 total mem: 32013MB
2,6573 mipmap cache: 4001MB
2,6573 available mem: 21884MB
2,6573 singlebuff: 500MB
2.6766 [dt_dlopencl_init] could not find default opencl runtime library ‘libOpenCL’
2.6767 [dt_dlopencl_init] could not find default opencl runtime library ‘libOpenCL.so’
2.6768 [opencl_init] opencl library ‘libOpenCL.so.1’ found on your system and loaded, preference ‘default path’
2.7339 [opencl_init] found 2 platforms
2.7339 [check platform] platform ‘Clover’ with key ‘clplatform_clover’ is NOT active
2.7339 [opencl_init] no devices found for Mesa/X.org (vendor) - rusticl (name)
[opencl_init] found 0 device
2.7339 [opencl_init] FINALLY: opencl PREFERENCE=ON is NOT AVAILABLE and NOT ENABLED.

From command line (1st time, then in DT set pref again to Y ):


0.0001 [dt starting]
/usr/bin/darktable -d opencl
2,9083 [dt_get_sysresource_level] switched to 2 as `large’
2,9083 total mem: 32013MB
2,9083 mipmap cache: 4001MB
2,9083 available mem: 21884MB
2,9083 singlebuff: 500MB
2.9282 [opencl_init] opencl disabled via darktable preferences
2.9284 [dt_dlopencl_init] could not find default opencl runtime library ‘libOpenCL’
2.9284 [dt_dlopencl_init] could not find default opencl runtime library ‘libOpenCL.so’
2.9286 [opencl_init] opencl library ‘libOpenCL.so.1’ found on your system and loaded, preference ‘default path’
3.0476 [opencl_init] found 2 platforms
3.0476 [check platform] platform ‘Clover’ with key ‘clplatform_clover’ is NOT active
[opencl_init] found 1 device

[dt_opencl_device_init]
OpenCL Mesa platform Mesa/X.org' --> AMD Radeon RX 6600’

After restart from command line:


0.0001 [dt starting]
/usr/bin/darktable -d opencl
2,8680 [dt_get_sysresource_level] switched to 2 as `large’
2,8680 total mem: 32013MB
2,8680 mipmap cache: 4001MB
2,8680 available mem: 21884MB
2,8680 singlebuff: 500MB
2.8880 [dt_dlopencl_init] could not find default opencl runtime library ‘libOpenCL’
2.8880 [dt_dlopencl_init] could not find default opencl runtime library ‘libOpenCL.so’
2.8882 [opencl_init] opencl library ‘libOpenCL.so.1’ found on your system and loaded, preference ‘default path’
2.9825 [opencl_init] found 2 platforms
2.9825 [check platform] platform ‘Clover’ with key ‘clplatform_clover’ is NOT active
[opencl_init] found 1 device

[dt_opencl_device_init]
OpenCL Mesa platform Mesa/X.org' --> AMD Radeon RX 6600’

An hypothesis proved after some extra research correct. My assumption was that somehow the environment variable RUSTIC_ENABLE stored in ~/.bashsrc is not picked up when using a launcher.

Did some research on environment variables and came across this How to.

So I added RUSTICL_ENABLE=radeonsi to ~/.profile . Started DT from menu and now works with opencl !

I don’t know if that is a standard Linux (Mint) thing in setting/using environment variables. But problem solved.

Thank you all repliers for yr help.

2 Likes

Glad you figured that out, and a good opportunity for me, as well, to read the docs.

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.

When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrc and ~/.bashrc.

To late, but I do it like this on the command line:

[User]$ RUSTICL_ENABLE=radeonsi darktable -d opencl -d perf

And, I’m always starting dt from CLI because I want to see what’s going on in regard’s of GPU usage.

Thanks @kofa for the docs extract. Another learning step in ‘mastering Linux’ :wink:.