Darktable 4-MacOS M1+OpenCL

In darktable 3.8, on M1 MacBook Air, OpenCL used to work great on MacBook Air M1
With 4.0, OpenCl in not longer activated. How do I activate it? Anybody else having this issue? THanks.
Jimmy

I believe there is a new metric with the Opencl tuning that if your cpu is 3x faster than your GPU then opencl is disabled.

I feel like someone commented at one point that this might impact Mac M1 installs??

I could be wrong and I usually am but if so I think there must be a way in preferences or at least as a variable in the darktablerc file to over ride it??

But check if using the GPU really is faster for you (i.e with the modules you normally use). Using the GPU can actually slow down dt if the required transfers take up more time than the speedup in calculations gains.

I don’t know what hardware that system has, is opencl supported by hardware or is it emulated on cpu.

Also, “darktable -d opencl” would tell…

When a new version of darktable is first started, it‘s OpenCL kernels will be compiled. Now there‘s an issue with MacOS, that a header file randomly cannot be found, although it‘s there. You can see that if you start darktable from the command line with option -d opencl.

If this is the problem, repeatedly start darktable, until eventually all kernels have successfully been compiled and OpenCL can be activated, usually after 5 … 10 restarts.

In 3.8 with opencl activated and set to defualt processing 83 images (with multiple denoise modules among other modules) takes ~12min. without opencl it takes ~18min same files/modules (in 3.8 and 4.0)

@priort Opencl is set to TRUE in darktablerc 4.0. I even set opencl library path manually in darktablerc, still opencl does not get activated

@hannoschwalm darktable -d opencl output is attached for both. The kernel modules get loaded for 3.8 but there is an issue with 4.0

geni1105 tried restarting many times but opencl is not activated.

darktable3-8-opencl.txt (50.4 KB)
darktable4-0-opencl.txt (3.5 KB)

Try removing your cache and kernels, then get DT to regenerate them

@paperdigits OpenCL not activated after removing .cache/darktable and .config/darktable.
How do i remove kernels?

since it was enabled with 3.8 it seems to be obvious that the new performance tuning stuff broke something specific to M1.
Not really surprising since no developer is using OS X :wink:
So it’s worth to file an issue at Sign in to GitHub · GitHub
Maybe some of those building native M1 with homebrew are able to reproduce…

You might have to specifically enable device 1, I agree here that it should be by default. A look into the manual - opencl section - will help.

You have to find the device specific conf key in darktablerc. Sorry about this…

Could you post that key too for me to make sure?

A github issue would also be good as Martin suggested

Even your 3.8 seems not to be using the GPU:

1.736061 [opencl_priorities] image preview export thumbs preview2
1.736062 [opencl_priorities] 0 -1 0 0 -1

The GPU is device 1 in the 3.8 output and device 0 is the CPU (0.182591 [opencl_init] discarding CPU device 0 `Apple M1’).

@hannoschwalm @MStraeten I have filed a bug report https://github.com/darktable-org/darktable/issues/12119
I dont know how to find device “specific conf key”?
@g-man OK. I will take your word for it. I really care about time it takes to process files (CPU or GPU or both)

@zeppelin did you find a solution to this?