Bug 2154666 - clang-libs 15.0.6-1 is missing opencl-c-base.h, preventing OpenCL from working in darktable
Summary: clang-libs 15.0.6-1 is missing opencl-c-base.h, preventing OpenCL from workin...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: clang
Version: 37
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-18 13:51 UTC by Garrett LeSage
Modified: 2022-12-29 17:05 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-29 17:05:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Garrett LeSage 2022-12-18 13:51:25 UTC
Description of problem:

darktable no longer works with OpenCL on Fedora 37. It's likely other OpenCL-related software may have problems as well. (Anything that needs opencl-c-base.h)


Version-Release number of selected component (if applicable):

15.0.6-1.fc37 is problematic. This version prevents darktable from compiling OpenCL optimizations.

15.0.0-2.fc37 includes the necessary file, opencl-c-base.h.


How reproducible:

Every time.


Steps to Reproduce:
1. Make sure 15.0.6-1.fc37 is installed, and 15.0.0-2.fc37 is not installed.
2. Also ensure you have OpenCL enabled on your video card. (Intel needs intel-opencl; AMD needs rocm-opencl. I'm not sure about NVidia.)
3. Run darktable-cltest.

Actual results:

See that the card is "not supported" as it cannot compile the OpenCL optimizations for the modules.


Expected results:

The command `darktable-cltest` should show that a card is supported when OpenCL libraries are installed.


Additional info:

There's an issue @ https://github.com/darktable-org/darktable/issues/12971 with more information.

Specifically, this commenter tracked down the issue and has a workaround (to install the older version of clang-libs in the meantime): https://github.com/darktable-org/darktable/issues/12971#issuecomment-1352364429

Comment 1 Nikita Popov 2022-12-19 09:45:25 UTC
I just checked clang-libs-15.0.6-1.fc37.x86_64.rpm and it does contain usr/lib64/clang/15.0.6/include/opencl-c-base.h.

From the github thread, I suspect that *something* is embedding a hardcoded 15.0.0 resource directory, while the file is now in the 15.0.6 resource directory. We probably need to find that something and rebuild it.

(This problem should be solved for good with Clang 16 via https://reviews.llvm.org/D125860.)

Comment 2 Nikita Popov 2022-12-19 11:02:24 UTC
I'm on nvidia, so can't directly reproduce this, but:

> rpm2cpio rocm-comgr-5.3.0-1.fc38.x86_64.rpm | cpio -idmv
> strings usr/lib64/libamd_comgr.so.2.4.0 | grep opencl-c-base.h
/usr/lib64/clang/15.0.0/include/opencl-c-base.h
/usr/lib64/clang/15.0.0/include/opencl-c-base.h
/usr/lib64/clang/15.0.0/include/opencl-c-base.h
/usr/lib64/clang/15.0.0/include/opencl-c-base.h

So it looks like rocm-compilersupport is the problematic package.

As it so happens, there is a pending update to rocm 5.4.1 available at https://bodhi.fedoraproject.org/updates/FEDORA-2022-f523363d5e. Doing the same check on that build, it uses the /usr/lib64/clang/15.0.6/include/opencl-c-base.h path.

Could you please check whether that update fixes the issue for you?

Comment 3 Toby Haynes 2022-12-22 20:21:52 UTC
Applied the rocm 5.4.1 update from  https://bodhi.fedoraproject.org/updates/FEDORA-2022-f523363d5e and ran `dnf update` to sync the rest of the repositories to the latest. darktable-cltest -d verbose passes and Darktable settings show OpenCL active.

Comment 4 Garrett LeSage 2022-12-29 17:05:43 UTC
I can confirm; this works for me too!

Thanks for debugging further and pointing out the ROCm fix!

(Apologies for taking a few days to get back to this issue.)


Note You need to log in before you can comment on or make changes to this bug.