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

UnsatisfiedLinkError: com.apple.opencl #861

Closed
scootermorris opened this issue Feb 22, 2023 · 5 comments
Closed

UnsatisfiedLinkError: com.apple.opencl #861

scootermorris opened this issue Feb 22, 2023 · 5 comments

Comments

@scootermorris
Copy link

Version

3.3.1

Platform

macOS arm64

JDK

Temurin-17.0.4.1+1

Module

OpenCL

Bug description

In the most recent versions of MacOS (13.1) our application has been failing to initialize OpenCL with a backtrace failing to find com.apple.opencl.

Stacktrace or crash log output

java.lang.UnsatisfiedLinkError: Failed to retrieve bundle with identifier: com.apple.opencl
    at org.lwjgl.system.macosx.MacOSXLibraryBundle.getWithIdentifier(MacOSXLibraryBundle.java:31)
    at org.lwjgl.system.macosx.MacOSXLibrary.getWithIdentifier(MacOSXLibrary.java:20)
    at org.lwjgl.opencl.CL.create(CL.java:63)
    at org.lwjgl.opencl.CL.<clinit>(CL.java:45)
    at org.cytoscape.cycl.internal.CyCL.initialize(CyCL.java:54)
    at org.cytoscape.cycl.internal.CyActivator.lambda$start$0(CyActivator.java:32)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
@ws909
Copy link

ws909 commented Feb 22, 2023

Without further investigation, it may just seem that Apple removed OpenCL from the OS.

Many discussions online, such as this one: https://discussions.apple.com/thread/254008829

Maybe it's possible to provide an implementation on top of Metal, similar to MoltenVK for Vulkan.

@scootermorris
Copy link
Author

Yes, OpenCL, as well as OpenGL have been deprecated since 10.14, but so far, they haven't removed them from the OS. OpenGL, at least, continues to work. We're hoping that there is a relatively easy workaround (install old library, etc.).

@ws909
Copy link

ws909 commented Feb 22, 2023

So you have confirmed that the OpenCL library actually is present on your machine? If it's still there, has its path or name changed?

@scootermorris
Copy link
Author

We're comparing our Ventura Macs (which don't work) with older OS versions (which to work). Will let you know what we find, but I suspect that a library is missing.

@Spasi
Copy link
Member

Spasi commented Mar 27, 2023

Thank you @scootermorris, this will be fixed in the next snapshot.

The problem was that CFBundleGetBundleWithIdentifier("com.apple.opencl") does not work anymore on macOS 13. The same call with com.apple.opengl does work. I've changed both to use dlopen("<framework path>") and both OpenCL and OpenGL work fine on macOS 12 (tested on old Intel macbook) and 13 (tested on M2 macbook).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants