[Solved] Darktable 4.2: LLVM ERROR on startup

Hello!
After a system update (Gentoo linux) dt stopped working with opencl with this message:

4.435667 [opencl_fopen_stat] could not open file `/tmp/kanyck/.cache/darktable/cached_kernels_for_gfx803_34860HSA11LC/demosaic_ppg.cl.bin'!
4.435673 [opencl_load_program] could not load cached binary program, trying to compile source
LLVM ERROR: Cannot select: 0x5575b8fcc580: i64 = FrameIndex<0>
In function: border_interpolate
zsh: IOT instruction  darktable-cltest

I filed an issue on github but there is silence there, rolled llvm/clang/rocm stuff back without any success. Clinfo looks valid, numa works with opencl just fine. The error report dt provides is fully cryptic to me, and I ran out of ideas what went wrong. Please help!

Have you trier removing the cached kernels?

IIUC they’re in /tmp/kanyck/.cache so don’t survive the reboot. Or there’s some other place to cleanup?

They should be in ~/.cache/darktable

You should also tell us what version of darktable and what changed on your system.

As you can see from the log, dt definitely looks for /tmp/kanyck/.cache/darktable/cached_kernels_for_gfx803_34860HSA11LC, there’s no ~/.cache/darktable dir. (BTW I think I shall find out why it is in /tmp: keeping them in ~/.cache/darktable will make dt start much faster. But now it’s as it is: dt tries to compile the kernels every time it starts)

dt 4.2.0. What changed is a toughest part: about 350 packages were updated. That’s why I am lost.

I looked – it’s XDG_CACHE_HOME variable that sets cache into tmpfs. Irrelevant to the matter.

Oookay, the issue is found and palliatively hacked. The offender was system-wide llvm setting -fstack-protector-strong unsupported by ROCm. So many hours wasted! Thanks @paperdigits for being involved!

Ooof. That’s a doozy. Glad you got it solved.

Welcome to the Gentoo world, Neo :grin:

I am happily using NixOS where everything is reproducible :wink:

I don’t think I’ll ever change the distro. Looking at what’s been happening with Linux ecosystem I’m getting more and more interested in the BSDs though.