Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct soname for libOpenCL.so? #8569

Open
mcourteaux opened this issue Feb 9, 2025 · 1 comment
Open

Correct soname for libOpenCL.so? #8569

mcourteaux opened this issue Feb 9, 2025 · 1 comment
Assignees
Labels
build Issues related to building Halide and with CI

Comments

@mcourteaux
Copy link
Contributor

mcourteaux commented Feb 9, 2025

I wasn't having a functioning OpenCL backend, on my Fedora 40/41 with NVIDIA driver setup. Turns out there is no libOpenCL.so, but instead the soname versioning starts with libOpenCL.so.1, which symlinks to libOpenCL.so.1.0.0.

I'm not super familiar with these so versioning strategies, but I can confirm Halide works fine when adding libOpenCL.so.1 to the list of attempted library names in the opencl runtime module. What would be the most correct / portable soname for libOpenCL?

No guarantees, but ChatGPT says you should use libOpenCL.so.1 (and I didn't bias it).

@alexreinking
Copy link
Member

There are three paths that are commonly associated with shared libraries on Linux:

  1. The real library is named libFoo.so.X.Y.Z with the whole version attached.
  2. A soname link like libFoo.so.W links to the real library. It is not required that W equal X. W is the soversion, which determines binary compatibility.
  3. A library name like libFoo.so with no version information. This is the path searched by linkers, like ld.

In the case of OpenCL and other driver libraries we dynamically load, we should use the soname (2). That's the one that's typically installed as part of the runtime package (i.e. not -dev).

Thus, the appropriate one to use is libOpenCL.so.1.

@mcourteaux mcourteaux self-assigned this Feb 19, 2025
@mcourteaux mcourteaux added bug build Issues related to building Halide and with CI labels Feb 19, 2025
@alexreinking alexreinking removed the bug label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to building Halide and with CI
Projects
None yet
Development

No branches or pull requests

2 participants