GPU acceleration for AI features in Darktable - help needed testing install scripts

Which is what the Detect button loads:

Still failing.

~/.local/lib/onnxruntime-openvino$ ls -la
total 32508
drwxrwxr-x 2 jb jb 4096 Apr 2 22:54 .
drwx------ 4 jb jb 4096 Apr 2 18:25 …
-rwxr-xr-x 1 jb jb 31260360 Apr 2 21:01 libonnxruntime.so.1.24.1
-rwxr-xr-x 1 jb jb 2000856 Apr 2 21:01 libonnxruntime_providers_openvino.so
-rwxr-xr-x 1 jb jb 15776 Apr 2 21:01 libonnxruntime_providers_shared.so

It should be about 20 files in the folder. On my side, if I force install, I got:

~/.local/lib/onnxruntime-openvino$ ls -la
total 219536
drwxrwxr-x 2 andrii andrii     4096 Apr  2 09:11 .
drwxrwxr-x 5 andrii andrii     4096 Apr  1 21:56 ..
-rwxr-xr-x 1 andrii andrii  2000856 Apr  2 09:36 libonnxruntime_providers_openvino.so
-rwxr-xr-x 1 andrii andrii    15776 Apr  2 09:36 libonnxruntime_providers_shared.so
-rwxr-xr-x 1 andrii andrii 31260360 Apr  2 09:36 libonnxruntime.so.1.24.1
-rwxr-xr-x 1 andrii andrii   682457 Apr  1 21:42 libopenvino_auto_plugin.so
-rwxr-xr-x 1 andrii andrii   389321 Apr  1 21:42 libopenvino_c.so
-rwxr-xr-x 1 andrii andrii   389321 Apr  1 21:42 libopenvino_c.so.2025.4.1
-rwxr-xr-x 1 andrii andrii   389321 Apr  1 21:42 libopenvino_c.so.2541
-rwxr-xr-x 1 andrii andrii   614553 Apr  1 21:42 libopenvino_hetero_plugin.so
-rwxr-xr-x 1 andrii andrii 67008289 Apr  1 21:42 libopenvino_intel_cpu_plugin.so
-rwxr-xr-x 1 andrii andrii 18158505 Apr  1 21:42 libopenvino_intel_gpu_plugin.so
-rwxr-xr-x 1 andrii andrii  6079705 Apr  1 21:42 libopenvino_intel_npu_plugin.so
-rwxr-xr-x 1 andrii andrii  7006249 Apr  1 21:42 libopenvino_onnx_frontend.so
-rwxr-xr-x 1 andrii andrii  7006249 Apr  1 21:42 libopenvino_onnx_frontend.so.2025.4.1
-rwxr-xr-x 1 andrii andrii  7006249 Apr  1 21:42 libopenvino_onnx_frontend.so.2541
-rwxr-xr-x 1 andrii andrii 25284089 Apr  1 21:42 libopenvino.so
-rwxr-xr-x 1 andrii andrii 25284089 Apr  1 21:42 libopenvino.so.2025.4.1
-rwxr-xr-x 1 andrii andrii 25284089 Apr  1 21:42 libopenvino.so.2541
-rw-r--r-- 1 andrii andrii   158129 Apr  1 21:42 libtbbmalloc.so
-rw-r--r-- 1 andrii andrii   367649 Apr  1 21:42 libtbb.so
-rw-r--r-- 1 andrii andrii   367649 Apr  1 21:42 libtbb.so.12

Also, do you have intel-compute-runtime installed? Intel OpenCL or Level Zero is required.

Tested on Linux Mint 22 with Nvidia RTX 4060 laptop.

Yes.

Yes, no problem.

Yes. Didn’t try with -d ai, but since the processing went 10 times faster than on CPU, it’s obvious that it works. I also find the final denoised image a bit better when running on GPU

Fun to test this, but I’m not shure I’ll use this very often. The ai masking seems more useful for me.

1 Like

I’m on Ubuntu 26.04 beta. Intel compute runtime is handled by intel opencl-icd package. Opencl compute runs well on other modules in darktable. I just found out that openvino is not yet officially supported on Ubuntu 26.04. Given its impending general release, I will just wait until it is supported. CPU works well until then.

1 Like

I’ve barely started on this dt stuff yet, but, on seeing your post, took another look at ubuntu cuDNN stuff.

You should be able to install it from nvidia. Start here

I’ve just run through this for my Linux Mint )Ubuntu 24.4. It seems to have completed without error. But it was one of those distract myself from going to bed jaunts, so won’t be checking out the dt install right now.

Hello,

The script works perfectly with Debian 13 and an NVIDIA GeForce RTX 4050 Laptop GPU.

Thank you for your work.
Christian

1 Like

Thanks for this…first attempt I just cut and pasted and ran…Error was couldn’t find the manifest …then I compared your original instructions and found hat extra bit of text was missing so I added it and everything went smoothly and though I only tried it on a couple of images it seems to work just fine…Thanks for all your efforts to make these tools available in DT as options and enhancements

1 Like

It worked fine with the distro’s own package; I think it’s just a difference in naming:
The package nvidia-cudnn, currently at version 9.0.0.312~cuda12 provides the library file libcudnn.so.9. Maybe it’s worth double-checking the message the script displays.

2 Likes

I get the same warning as @kofa on Debian 13.4 + NVIDIA Quadro RTX 4000 GPU, when I use the install button. GPU acceleration for AI features in Darktable - help needed testing install scripts - #11 by kofa. I have this system library installed nvidia-cudnn/stable,now 9.0.0.312~cuda12 amd64 [installed] and NVIDIA CUDA works fine for me, with that Debian system library installed.

OK. Looks like cuDNN does not work correctly on your system. I will look at it. But good that library was installed and works.

Thank you, but I have nvidia-cudnn/stable,now 9.0.0.312~cuda12 amd64 [installed] from Debian and I think it works fine. Please correct me if I am wrong, but I thought the warning was triggered because of some package naming convention. At least I can verify that GPU does the job of denoising and upscaling with nvidia-smi (and it is > 10x faster than CPU).

What is not working correctly on my system? EDIT: Debian 13.4.

1 Like

Sorry, my bad. I meant cuDNN detection does not work well on a specific distribution.

If you forced installation and you can select CUDA execution provider without fallback to CPU, then at the end everything works fine.

1 Like

Oh yeah… I see that available now. Thanks.

If my from-nvidia install doesn’t work, I’ll try that.

Just got darktable compiled with the AI features. On my Ubuntu 24.04, AMD cpu and Nvidia GPU PC. When I go to Settings - AI features, I can enable the AI features alright.

But here is where problems start: I leave the execution provider on ‘default’. When I click on the ‘detect’ button I get the message ‘No system ONNX runtime library found’ ‘Install one via your package manager or use the browse button to select a custom build’.

When I consult my package manager ‘apt search onnx’ I find the libonnx-dev. But installing this does not help. There is a python3 library, ‘python3-onnx’, but this does not work either. What exactly do I need to install on Ubuntu 24.04 to get an ONNX runtime?

I understand that you cannot provide detailed instructions for every OS under the sun, but the term ‘system ONNX runtime’ seems not clear enough.

I found a second problem in the settings dialog; there are two mask models listed. The second one, ‘mask segnext vitb-sax2 hq’ seems fine and can be downloaded. But the first ‘mask sam2.1 hiera small’ can be selected for download, but the download does not occur. There is no error message; it just silently fails.
When selecting that model and clicking on the download button, I get this output on the console:

688.1588 [preferences_ai] refreshing model list, count=4
688.1588 [preferences_ai] adding model: mask-object-sam21-small
688.1588 [preferences_ai] adding model: mask-object-segnext-b2hq
688.1589 [preferences_ai] adding model: denoise-nind
688.1589 [preferences_ai] adding model: upscale-bsrgan

Just replying to my own post. The problem with ‘detect’ coming up with an error still persists. But I found the missing library.

When attempting to use AI masking, I got an error. On the console darktable was looking for /home/markus/Workbench/darktable/build/lib/darktable/libonnxruntime.so. This was missing. Copying the library there fixed the problem and AI masking is now working!

@Markus_b The default and recommended way to install ONNX Runtime dependency on Linux is using system package onnxruntime-dev. It may not be available on older distros.

Auto-download option is not covered by our CI and may not be fully predictable.

If you use AppImage nightly build, it will have ONNX Runtime bundled.

Scripts described in this thread can help you install GPU-accelerated ONNX Runtime. If you will have custom ONNX Runtime for NVidia GPU you will not need anything else.

If you use AppImage nightly build, it will have ONNX Runtime bundled.

I got around and downloaded the AppImage build (Darktable-5.5.0+908.g791cf934bc-x86_64.AppImage). But it seems to lack the GPU acceleration.

Here the extract from the log ‘d ai’:

46.3729 [darktable_ai] refreshing model list
46.3730 [darktable_ai] discovered: upscale bsrgan (upscale-bsrgan, backend=onnx)
46.3730 [darktable_ai] discovered: mask segnext vitb-sax2 hq (mask-object-segnext-b2hq, backend=onnx)
46.3730 [darktable_ai] discovered: mask sam2.1 hiera small (mask-object-sam21-small, backend=onnx)
46.3731 [darktable_ai] discovered: denoise nind (denoise-nind, backend=onnx)
46.3731 [darktable_ai] refresh complete, found 4 models
51.1757 [darktable_ai] dt_ai_env_init start.
51.1758 [darktable_ai] discovered: upscale bsrgan (upscale-bsrgan, backend=onnx)
51.1759 [darktable_ai] discovered: mask segnext vitb-sax2 hq (mask-object-segnext-b2hq, backend=onnx)
51.1759 [darktable_ai] discovered: mask sam2.1 hiera small (mask-object-sam21-small, backend=onnx)
51.1760 [darktable_ai] discovered: denoise nind (denoise-nind, backend=onnx)
51.2024 [darktable_ai] loaded ORT 1.24.4 from 'libonnxruntime.so'
51.2024 [darktable_ai] execution provider: auto
51.2713 [darktable_ai] loading: /home/markus/.local/share/darktable/models/mask-object-sam21-small/encoder.onnx
51.2714 [darktable_ai] attempting to enable NVIDIA CUDA...
51.2714 [darktable_ai] NVIDIA CUDA provider not found.
51.2714 [darktable_ai] attempting to enable AMD MIGraphX...
51.2714 [darktable_ai] AMD MIGraphX provider not found.
51.2714 [darktable_ai] attempting to enable AMD ROCm (legacy)...
51.2714 [darktable_ai] AMD ROCm (legacy) provider not found.
51.8384 [darktable_ai] loading: /home/markus/.local/share/darktable/models/mask-object-sam21-small/decoder.onnx
51.8385 [darktable_ai] using CPU only (no hardware acceleration)

The log for my locally compiled version looks the same:

13.3777 [preferences_ai] refreshing model list, count=4
13.3777 [preferences_ai] adding model: mask-object-sam21-small
13.3778 [preferences_ai] adding model: mask-object-segnext-b2hq
13.3778 [preferences_ai] adding model: denoise-nind
13.3779 [preferences_ai] adding model: upscale-bsrgan
19.1392 [darktable_ai] loaded ORT from plugindir: /home/markus/Workbench/darktable/build/lib/darktable/libonnxruntime.so
19.1393 [darktable_ai] loaded ORT 1.24.4 from 'libonnxruntime.so'
19.1393 [darktable_ai] execution provider: CUDA
19.1813 [darktable_ai] attempting to enable NVIDIA CUDA...
19.1813 [darktable_ai] NVIDIA CUDA provider not found.
32.1388 [preferences_ai] refreshing model list, count=4
32.1388 [preferences_ai] adding model: mask-object-sam21-small
32.1388 [preferences_ai] adding model: mask-object-segnext-b2hq
32.1389 [preferences_ai] adding model: denoise-nind
32.1389 [preferences_ai] adding model: upscale-bsrgan
57.8776 [darktable_ai] dt_ai_env_init start.
57.8778 [darktable_ai] discovered: upscale bsrgan (upscale-bsrgan, backend=onnx)
57.8779 [darktable_ai] discovered: mask segnext vitb-sax2 hq (mask-object-segnext-b2hq, backend=onnx)
57.8779 [darktable_ai] discovered: mask sam2.1 hiera small (mask-object-sam21-small, backend=onnx)
57.8780 [darktable_ai] discovered: denoise nind (denoise-nind, backend=onnx)
57.8780 [darktable_ai] loading: /home/markus/.local/share/darktable/models/mask-object-sam21-small/encoder.onnx
57.8780 [darktable_ai] attempting to enable NVIDIA CUDA...
57.8781 [darktable_ai] NVIDIA CUDA provider not found.
57.8781 [darktable_ai] attempting to enable AMD MIGraphX...
57.8781 [darktable_ai] AMD MIGraphX provider not found.
57.8781 [darktable_ai] attempting to enable AMD ROCm (legacy)...
57.8781 [darktable_ai] AMD ROCm (legacy) provider not found.
58.5420 [darktable_ai] loading: /home/markus/.local/share/darktable/models/mask-object-sam21-small/decoder.onnx
58.5421 [darktable_ai] using CPU only (no hardware acceleration)

So it looks like darktable can not find my gpu. The OS can find it, though:

$ nvidia-smi
Tue Apr  7 22:20:17 2026       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.288.01             Driver Version: 535.288.01   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce GTX 1080        Off | 00000000:26:00.0  On |                  N/A |
|  0%   54C    P8              14W / 210W |    551MiB /  8192MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

Correct. On Linux bundled ONNX Runtime currently supports only CPU. Please, see my first message in this thread regarding how you can add GPU acceleration support.

cuDNN detection in UI install is fixed

1 Like