-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fixed packaging of onnxruntime java module for Mac OSX with Apple M1 Chip #12325
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
Conversation
I would prefer to fix the packaging, which I thought should have been dealt with by the change here - https://github.com/microsoft/onnxruntime/pull/10981/files#r834505949. |
Mentioned PR was merged on 26th of March, but I (and other people) still can encounter that bug, so I guess more changes are needed. I'm not familiar with cmake configuration, so I'm not sure how to fix it in that place. |
On macOS arm, what's the value of "os.arch" property for Java applications? |
On my basic Macbook Air M1: System.getProperty("os.arch", "generic"); prints:
so I guess change may be required both in cmake (already done) and Java code (this PR). |
We should only need to change one of the location where the binary is placed by the build system and the location the Java loader looks, changing both is likely to cause the same problem. If we build from source on an M1 Mac does it build the jar with it in |
I downloaded jar file from the Maven Central repository here: https://search.maven.org/artifact/com.microsoft.onnxruntime/onnxruntime/1.12.0/jar and looked inside. In the path
Contents of the
It looks fine, but maybe something is wrong with the directories contents? I also extracted my What is interesting, in my custom file in the path
and contents of this directory looks like that:
so the directory has different name and generated Clearly, there are differences between my old I even mentioned path in my compiled I see two solutions:
Please note: |
If the one compiled from source has the right structure (i.e. with a I can run some tests on my personal M1 machine tonight. I have been using it for development of the JNI code recently without issue, which is why I suspect the packaging pipeline in Azure. |
Ok, thanks. I will wait for the update. |
Yeah, the |
The root yaml which produces jars is https://github.com/microsoft/onnxruntime/blob/master/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml . In the second yaml file, we call a script java_copy_strip_binary.sh in a way like: /tools/ci_build/github/linux/java_copy_strip_binary.sh -r /Users/runner/work/1/b -c Release -a onnxruntime-java-osx-arm64 -l libonnxruntime.dylib -n libonnxruntime4j_jni.dylib -v 1.12.0 -h osx-arm64 sample output from the script:
|
@Craigacp: we have 1.12.1 patched. https://aiinfra.visualstudio.com/PublicPackages/_artifacts/feed/ORT-Nightly/maven/com.microsoft.onnxruntime%2Fonnxruntime/overview/1.12.1 |
Thanks. I checked library from this patch in my project on Mac with M1 and it works fine. It works on Linux too. |
Description: Fixed packaging of onnxruntime java module for Mac OSX with Apple M1 Chip
Motivation and Context