I’m noticing the same issue with rocm-opencl
acceleration not working with darktable on Fedora 40. It seemed to work during the beta phase, but isn’t working now. I guess something changed recently?
As a fallback, I’ve enabled rusticl for the time being. This is from Mesa and it also works on AMD cards (7900 XTX here) and is now working fine in darktable, according to How to enable RusticCL with darktable 4.6? (opencl fails to init) (near the bottom of that thread) and my own quick testing this evening.
Summary: You basically need:
- install
mesa-libOpenCL
- add this environment variable somewhere (more details below):
RUSTICL_ENABLE=radeonsi
- reboot (details below)
- Enable Rusticl & OpenCL support in darktable’s “Processing” settings
…and then darktable should hopefully work with acceleration via Rusticl on your system with an AMD GPU. (Although you might need to still turn it on in the settings.)
Detailed installation instructions
So… first install Rusticl.
-
Fedora transactional (standard, like Workstation):
sudo dnf install mesa-libOpenCL
-
Fedora Atomic (like Silverblue, Kinoite, etc.):
rpm-ostree install -A mesa-libOpenCL
(this will attempt a live install, as
-A
is shorthand for--apply-live
, which tries to install something without rebooting… but you might still need to reboot if that doesn’t work)
Then you can do one of the following:
-
To test it from the command line (this isn’t good for general use, but useful for testing), run this:
RUSTICL_ENABLE=radeonsi darktable
You might want to run this instead to really test and see if it’s working, as it’ll specifically test and tell you if OpenCL works (however, this may depend on settings in darktable, like turning on support):
RUSTICL_ENABLE=radeonsi darktable-cltest
-
System environment: If you have admin access (root) on your machine: add
RUSTICL_ENABLE=radeonsi
to/etc/environment
-
Local environment: Create a local environment file:
mkdir -p ~/.config/environment.d/ echo RUSTICL_ENABLE=radeonsi > ~/.config/environment.d/rusticl.conf
The latter two options where you add the environment variable requires rebooting afterward.
If you happen to be using the flatpak version of darktable (from Flathub), then — unlike ROCm at the moment — you can actually even have hardware acceleration there too. Choose one of the following:
-
Graphical: Add
RUSTICL_ENABLE=radeonsi
to the “Environment” section using Flatseal -
Command line: Run this after installing darktable from Flathub:
sudo flatpak override --env=RUSTICL_ENABLE=radeonsi org.darktable.Darktable
…after all that, make sure Rusticl and OpenCL is turned on in darktable’s settings.
If you do notice graphical or stability issues, don’t forget you turned this on. Turn if off if you run into problems. (You’ll likely notice if so.) It seems to work fine for me here, so far.
I’m not sure if I’ll stick with Rusticl or switch back to ROCm OpenCL when it works again. It seems Rusticl is plenty fast? https://www.phoronix.com/news/Rusticl-Outperformed-ROCm — but this is an old article, before it worked well enough to run darktable. I’d love to see real world performance tests of ROCm vs. Rusticl in darktable some day.
Anyway, I hope this helps! It seems like it’s working here. Best of luck!
(If this is a bad idea, to use Rusticl with darktable, I’m sure someone will show up after this post and tell us so. But it seems to work for me for now. I know people worked on sorting out the issues, both on Mesa/Rusticl’s side of things as well as darktable’s. But this support is still new.)