OpenCL on Fedora

@42578
One thing which I noticed was the following in the output from darktable-cltest

0.096445 [opencl_init] discarding device 0 `gfx902:xnack+' due to insufficient global memory (512MB).

I don’t know in the BIOS of your computer you can increase the amount of memory devoted to the onboard GPU, but it could be the fact that the 512MB of memory allocated to the onboard graphics isn’t sufficient for OpenCL to be enabled? Try upping it to 2GB of reserved ram for the onboard GPU.

1 Like

I can’t increase it, but I also don’t think that’s the problem, because I got OpenCL activated on Arch with the same computer.

The OBS package supports CR3 and will work if your driver supports OpenCL

1 Like

Ok. I install it from here and still don’t get OpenCL activated. I’m assuming that the package I mentioned don’t installed OpenCL properly.

What can I do?

On my laptop with an AMD CPU and a separate GPU (RX5700M), on fedora 35 I just used the official AMD provided OpenCL package; but just that one, not the graphic driver.
Basically, I’ve gone to their support download area to find the link to their latest drivers.
Current driver installation package is : http://repo.radeon.com/amdgpu-install/21.40.2/rhel/8.5/amdgpu-install-21.40.2.40502-1.el8.noarch.rpm
that package contains 2 config for AMD provided package repositories and a shell script to install various part of their graphic stack.
if you look at the install script, it can be simplified to dnf install rocm-opencl-runtime.
So, for me , the first thing to do is to be sure OpenCL works on your system.
If it does not work with darktable nor blender, don’t blame those softwares but the openCL driver install.

2 Likes

To back what @Oleastre is saying: in the readme of the GitHub-Project you linked, it says

This package is intended to work along with the free amdgpu stack for fedora. Similiar to AUR (en) - opencl-amd

So it only works if the driver stack is installed. The comment above is one way to install it; another one would be https://amdgpu-install.readthedocs.io/en/latest/install-prereq.html

I guess, you might have done something similar in arch.

1 Like

And from Darktable manual:

A sufficient amount of graphics memory (1GB+) needs to be available for darktable to take advantage of the GPU.

https://docs.darktable.org/usermanual/3.8/en/special-topics/opencl/activate-opencl/

Definitely, your system GPU does not have access to enough memory to be able to be used by Darktable, even if the driver is correctly installed.

1 Like

I tried both methods and I got this:

Errors during downloading metadata for repository 'amdgpu':
  - Status code: 404 for https://repo.radeon.com/amdgpu/21.40.2/rhel//main/x86_64/repodata/repomd.xml (IP: 13.82.220.49)
Error: Failed to download metadata for repo 'amdgpu': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: amdgpu

I wasn’t aware of that, but what can I say is that darktable editing process is slower on Fedora when compared to Arch. I don’t remember what I have done to make it work, but I think that I installed the AUR package mentioned by @sushey.

My laptop is the Slimbook Pro X 15 with 32GB of ram. I don’t know if it matters, but it can run DaVinci Resolve.

With 32Gb of ram, then check this: https://github.com/darktable-org/darktable/issues/10922

Set your host_memory_limit to 0 in preferences to ensure DT can use all of that memory.

2 Likes

That was commented upon in your (?) pull request as being dangerous, so perhaps just set it at 16Mb (or 4 as a first try, increase if that’s stable)

3 Likes

Oh yes, I remember one of the two repositories installed was not working. Just remove that entry in /etc/yum.repo.d and ignore.

1 Like

Why don’t you install the darktable packages provides either by Fedora itself or the once in the openSUSE Build Service for Fedora?

1 Like

I removed it and installed the package, but I still don’t get OpenCL available in darktable.

Thanks, @g-man and @rvietor. Changing that setting improved darktable’s performance.

I tried it, but I wasn’t getting CR3 support or OpenCL available out-of-the-box. With flatpak, I have CR3 support. See this topic.

Given that @asn is the maintainer of those packages and a fedora developer. you can be kinda sure it works.

in your other thread you said you used the fedora package and the fedora flatpak.

I uninstalled darktable and then reinstalled it via: flatpak and rpm from Fedora; flatpak from Flathub. I uninstalled darktable before install it from another package. As I said on the other thread, I can only view CR3 files if I install darktable’s flatpak package from Flathub.

you should not install the Fedora package but the package from build.opensuse.org

see install | darktable

https://software.opensuse.org/download.html?project=graphics:darktable&package=darktable

fedora is under unknown.

1 Like

Thanks, it also worked. :+1:

The OpenCL problem persists and I still don’t know what the solution is, or if there is a solution.

Since your log says
0.096445 [opencl_init] discarding device 0 'gfx902:xnack+' due to insufficient global memory (512MB).

I think it’s quite clear that Darkktable refuses your APU because it can not access more than 512Mb of memory; whatever the driver you have.

2 Likes

Sorry for the incredible late response.

I managed to enable OpenCL, but darktable’s performance was bad. Now, I’m using darktable without OpenCL.

How did you manage to do that? I’ve bought a second SSD to have Windows on one of them and Linux on the other. My choice was Fedora 35 and I tried regular install from GNOME Software Manager (RPM package) and from build.opensuse - in both cases opencl in preferences is grayed out.

I’ve also installed packages for opencl & headers, still no luck.

My GPU is Gigabyte GTX 1050 Ti G1, Nvidia’s proprietary 510 drivers.
The same version of drivers and darkatble (3.8.1) under Windows work like a charm.