I have just installed DT 5.6 from the Darktable repository. I was hoping to try out some of the new AI features.
However, it appears that the program has been built without the optional AI component. Is it possible to request a version with these features, and if it is, how do I go about it?
According to the revision message, AI support was disabled by default “since no onnxruntime package is present in the repo,” and a --with ai flag was added, “so AI can be enabled once ONNX Runtime is available in Factory.” The flatpak version is without AI too, you may try the AppImage one.
Thanks for that, I have downloaded it, and I am running it. The only downside is that it only uses the CPU, rather than the GPU. This leads to large load averages and run time
curl -fsSL https://raw.githubusercontent.com/darktable-org/darktable/HEAD/tools/ai/install-ort-gpu.sh | bash
ONNX Runtime GPU acceleration installer
========================================
Resolving latest microsoft/onnxruntime ...
GPU: Quadro RTX 4000
Driver: 610.43.02
ORT version: 1.27.0
Download size: ~210 MB
Install to: /home/username/.local/lib/onnxruntime-cuda
Requirements: CUDA 13, cuDNN 9
Continue? [y/N] y
Downloading...
######################################################################## 100.0%
Verifying checksum...
Checksum OK.
Extracting...
Done. Installed to: /home/username/.local/lib/onnxruntime-cuda
Library: /home/username/.local/lib/onnxruntime-cuda/libonnxruntime.so.1.27.0
To enable in darktable:
1. Open darktable preferences (Ctrl+,)
2. Go to the AI tab
3. Click 'detect' to find the installed library automatically,
or set 'ONNX Runtime library' to:
/home/username/.local/lib/onnxruntime-cuda/libonnxruntime.so.1.27.0
4. Restart darktable
....
....
I don’t have an OBS account, so I went a slightly different way.
I upgraded the NVIDIA drivers, to include CUDA. There are lots of conflicting instructions of various ages on the web, as to how to do this, but the SDB page worked quite nicely (though I had to fix my monitor being reduced to a 640x480 resolution).
An automatic installation of ONNX failed, because it couldn’t find a GPU driver, so I installed it manually.
The AI configuration now detects an ONNX runtime, but I had to set the GPU acceleration to NVIDIA CUDA explicitly, rather than leave it at “auto”.
The only problem now is that running darktable-cltest shows AI as being disabled, and openCL not being available or enabled.
I can see why there isn’t a version of DT with AI enabled in the repositories as yet
Noticed that darktable 5.6.0 is being staged in Factory and should be included in the next snapshot, despite AI features stripped, which is still good anyway. I’m most excited for the new color harmonizer module and the Wayland improvements, alongside with bugfixes.
I think I may have found the reason that AI is not enabled. If I call journalctl I get:
NVRM: API mismatch: the client 'nvidia-smi' (pid 131275)
NVRM: has the version 610.43.02, but this kernel module has
NVRM: the version 595.84. Please make sure that this
NVRM: kernel module and all NVIDIA driver components
NVRM: have the same version.
It looks like a mismatch between the NVIDIA drivers in the OpenSUSE repositories and the CUDA library that I got from NVIDIA. I have updated the kernel driver to 610.
So, I am now running DT from the appImage (not the one from the OpenSUSE repositories), on top of versions of onnx, NVIDIA drivers and CUDA that Zypper doesn’t know about.
It is all working, and the AI features are now using the GPU, but it feels a bit like a Jenga tower.
I guess the impediment for darktable is the onnx runtime from the machine learning development repository not being submitted to openSUSE Factory for inclusion. Once that’s done enabling in darktable should be fine.
You still need to install the runtime package as your user, restart darktable and detect etc…
I have been told that there is an OpenSUSE repository for CUDA, which I have now looked at. It really is a horrible mess, with stuff there from the dawn of time. To be frank, the NVIDIA repository isn’t much better.
I have to wonder whether a clean-up would be a good idea, given that an increasing number of people will be using NVIDIA GPUs for AI as well as graphics.
All done, all good. Here is a cute picture, taken at the Loch of the Lowes, just outside Dunkeld (in Scotland, if you hadn’t realised), just to prove how it works.