Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Fail to initialize onnxruntime with 1.21.0 on windows #23969

Closed
HerrDerb opened this issue Mar 10, 2025 · 2 comments
Closed

Fail to initialize onnxruntime with 1.21.0 on windows #23969

HerrDerb opened this issue Mar 10, 2025 · 2 comments
Labels
api:Java issues related to the Java API platform:windows issues related to the Windows platform

Comments

@HerrDerb
Copy link

After the update to com.microsoft.onnxruntime:onnxruntime:1.21.0 I do get an error when trying to load the runtime in java (21). Colleagues with a mac seems not to experience this issue.

java.lang.UnsatisfiedLinkError: ~\AppData\Local\Temp\onnxruntime-java3314415972495013183\onnxruntime.dll: A dynamic link library (DLL) initialization routine failed
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2418)
	at java.base/java.lang.Runtime.load0(Runtime.java:852)
	at java.base/java.lang.System.load(System.java:2025)
	at ai.onnxruntime.OnnxRuntime.load(OnnxRuntime.java:387)
	at ai.onnxruntime.OnnxRuntime.init(OnnxRuntime.java:166)
	at ai.onnxruntime.OrtEnvironment.<clinit>(OrtEnvironment.java:34)
        ....

while I do have the latest VC++ redistributables
Image

maybe related to #23957?

@github-actions github-actions bot added api:Java issues related to the Java API platform:windows issues related to the Windows platform labels Mar 10, 2025
@Craigacp
Copy link
Contributor

It's broken for me too, it's failing on GitHub Actions' default Windows runner - https://github.com/oracle/tribuo/actions/runs/13768367698/job/38500483425?pr=396. Unfortunately I don't know what Windows build system changes happened for this release, but something is different.

@snnn
Copy link
Member

snnn commented Mar 10, 2025

Add this powershell script to your action:

Get-ChildItem -Path $env:AGENT_TOOLSDIRECTORY -File -Include msvcp*.dll,concrt*.dll,vccorlib*.dll,vcruntime*.dll -Recurse | Remove-Item -Force -Verbose

@microsoft microsoft locked and limited conversation to collaborators Mar 10, 2025
@snnn snnn converted this issue into discussion #23971 Mar 10, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
api:Java issues related to the Java API platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants