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 jniOpenCL on Mac M2 with onnxruntime-platform #1389

Closed
alawasoft opened this issue Jul 17, 2023 · 4 comments
Closed

UnsatisfiedLinkError jniOpenCL on Mac M2 with onnxruntime-platform #1389

alawasoft opened this issue Jul 17, 2023 · 4 comments

Comments

@alawasoft
Copy link

alawasoft commented Jul 17, 2023

Issue
When trying to use the onnxruntime-platform on a Mac with an M2chip, I'm encountering an UnsatisfiedLinkError related to jniOpenCL.

java.lang.UnsatisfiedLinkError: no jniOpenCL in java.library.path: /Users/campin/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2434)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:848)
	at java.base/java.lang.System.loadLibrary(System.java:2015)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1423)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1234)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1210)
	at org.bytedeco.opencl.global.OpenCL.<clinit>(OpenCL.java:14)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:488)
	at java.base/java.lang.Class.forName(Class.java:467)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1289)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1234)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1226)
	at ai.onnxruntime.OnnxRuntime.init(OnnxRuntime.java:150)
	at ai.onnxruntime.OrtEnvironment.<clinit>(OrtEnvironment.java:31)

using this import
.settings(libraryDependencies += "org.bytedeco" % "onnxruntime-platform" % "1.15.0-1.5.9")

To Reproduce
Steps to reproduce the behavior:

  1. Import onnxruntime-platform version 1.15.0-1.5.9 in a project.
  2. Try to get an instance of OrtEnvironment with OrtEnvironment.getEnvironment().
  3. See error
import ai.onnxruntime._
val env: OrtEnvironment = OrtEnvironment.getEnvironment()

or 
import org.bytedeco.onnxruntime._
import org.bytedeco.onnxruntime.global.onnxruntime._
val env = new Env(ORT_LOGGING_LEVEL_WARNING, "test")

Environment
OS: macOS
Chip: M2
Java version: [e.g., 18.0.2]
Scala version: [e.g., 2.13.6]
ONNX Runtime version: 1.15.0-1.5.9

@saudet
Copy link
Member

saudet commented Jul 17, 2023

Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" to get more information on the console.

@saudet
Copy link
Member

saudet commented Jul 17, 2023

Are you trying to run this in native mode with an ARM version of the JDK? If so, binaries for that are not available, so that's normal.

@alawasoft
Copy link
Author

Hi @saudet thanks for your replies, yes I'm running that natively using ARM version of JDK. well that makes sense, thank you.

@saudet
Copy link
Member

saudet commented Jul 18, 2023

Duplicate of #1069

@saudet saudet marked this as a duplicate of #1069 Jul 18, 2023
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
@saudet @alawasoft and others