OpenCL with rocm on Fedora 37 for darktable

Hello all, about mid cycle on Fedora 36 I swapped over from the amdgpu-pro OpenCL drivers to the rocm OpenCL drivers and recently I upgraded the desktop to Fedora 37 and main branch darktable fails to launch with the following error:

mesa: CommandLine Error: Option 'h' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted (core dumped)

I tried removing the previous OpenCL kernels in .cache and rebuilding the program with no success. However removing the rocm-opencl package and its dependencies allows darktable to work just fine.

I’m not sure who’s bug this is: darktable, LLVM, mesa or rocm? I’m running a Radeon RX 6900 XT currently. On my laptop I’ve got an RTX 3060 and Fedora 37 and OpenCL works just fine so this is limited to AMD/rocm. Version info below on what Fedora installs:

hsakmt-1.0.6-26.rocm5.3.0.fc37.x86_64
lld-libs-15.0.6-1.fc37.x86_64
rocm-comgr-5.3.0-1.fc37.x86_64
rocm-opencl-5.3.2-1.fc37.x86_64
rocm-runtime-5.3.0-2.fc37.x86_64                       

Any ideas? Thanks!

I think this is upstream and not darktable. I think i saw some LLVM changes this am. Maybe try to build again?

I’m on fedora 37 KDE but using Nvidia. I have a AMD GPU/CPU in the system, but I disable it for darktable.

I’m thinking this is upstream too, just not sure if it’s compiler/linker or something in the rocm runtime. A fresh recompile after today’s LLVM patches did not fix it.

Rocm supports opencl graphical apps?

Looks like you hit some rocm bug: `clIcdGetPlatformIDsKHR` crash if multiple llvm based implementations present · Issue #153 · RadeonOpenCompute/ROCm-OpenCL-Runtime · GitHub

Thanks, verified that clinfo also gives the same error. My rather default F37 install does seem to have LLVM libs from 13 and 15 installed:

llvm-libs-15.0.6-1.fc37.x86_64
llvm-15.0.6-1.fc37.x86_64
llvm-test-15.0.6-1.fc37.x86_64
llvm-static-15.0.6-1.fc37.x86_64
llvm-devel-15.0.6-1.fc37.x86_64
llvm-libs-15.0.6-1.fc37.i686
llvm13-libs-13.0.1-2.fc37.x86_64

@paperdigits I guess? Maybe not officially but it’s been working for a while. :man_shrugging:

I just turn off nvidia to try using the rocm drivers. Darktable loads, but it fails to compile any of the kernels [opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE. I will try to investigate a bit more, but AMD is normally a pain.

That’s another issue, I also got yesterday while testing. Rocm Fedora package lacks a dependency on the clang-libs package.
See the discussion here: darktable-cltest fails on latest Fedora 37 with AMD RX 6800 and OpenCL enabled · Issue #12971 · darktable-org/darktable · GitHub

When you have a CL_BUILD_PROGRAM_FAILURE message, you should run darktable-cltest -d verbose to see the actual error.