-
Notifications
You must be signed in to change notification settings - Fork 3.2k
OnnxRuntime 1.21.0 Java package failed to load on Windows #24287
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
Comments
This is due to a change in the VC++ redist that is used to compile the native library. If it differs from the JVM one then it fails, you can see more information here - #23971. I'm hitting this in Tribuo too, but I've not had time to try and figure out a better solution that works for more users so I've not upgraded to 1.21.0. |
Majority of java user still use JDK 17, and there are large percentage is still using JDK 11 and 8. I that possible to downgrade to 14.36? |
It's not a JVM version issue, I think Oracle Java SE 24 is compiled with the older version. I think Adoptium 8u442 is compiled against the latest version, as are some versions of Microsoft's build of OpenJDK. I think my preferred solution is to statically link the VC dist for the java build on Windows but I've not tested it works nor am I sure that MS will think that's a good solution. |
The classes still seem to be compiled with Java 8, though the build.gradle targets 17. I don't understand how that happened, but I don't do the builds. |
Please note that Visual Studio 2022 version 17.6 and anything older are out of support(EOL). It means anyone who wants to build a DLL that can be run with JDK 17 would put themselves in danger. So, I suggest Oracle provides an update to the JRE versions with an updated version of MSVC runtime. They don't need to recompile their binaries.
Usually the major concern is security. If MSVC runtime is part of the ONNX Runtime binaries, then whenever MSVC runtime had a security update ONNX Runtime needs to do a security update too. However, now JRE and conda provide a copy of MSVC runtime along with their exes. If they do not keep the DLLs to update, essentially the security posture is the same. |
Oracle Java SE is updated according to it's own schedule, that team will investigate it on their end. Replacing msvcp140.dll in the JDK seems to work for some users who've hit this on either ONNX Runtime or other libraries, though I expect that's not supported by people who provide support for OpenJDK. |
Describe the issue
I got the following exception when calling
new OrtEnvironment.ThreadingOptions()
The code works with 1.20.0. I tried use dumpbin the check the dependency, didn't find anything obvious. The dependencies looks the same as 1.20.0.
To reproduce
See: https://github.com/deepjavalibrary/djl/actions/runs/14225872126/job/39865137732#step:16:174
Urgency
No response
Platform
Windows
OS Version
Windows Server 2022
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.21.0
ONNX Runtime API
Java
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: