Skip to content

[Build] Java API with oneDNN error: LoadLibrary failed with error 126  #18292

Open
@PeipeiF

Description

Describe the issue

Hi,
I built ort Java jar with oneDNN EP and met error when executing my code. Error message shows that the onnxruntime_providers_dnnl.dll load failed with error code 126.
Error happens in this line:
options.addDnnl(true);
It seems that the onnxruntime_providers_dnnl.dll exists in the jar, but the program can't find it correctly. I'm not sure which step did I make a mistake when building.

Urgency

No response

Target platform

windows x64

Build script

.\build.bat --config Release --build_java --parallel --compile_no_warning_as_error --skip_submodule_sync --use_dnnl

Error / output

I got a ort jar with onnxruntime_providers_dnnl.dll, but error happens when options.addDnnl(true) is executed. The error message is as follows:

Exception in thread "main" ai.onnxruntime.OrtException: Error code - ORT_RUNTIME_EXCEPTION - message: C:\ProgramData\onnxruntime-1.16.1\onnxruntime\core\session\provider_bridge_ort.cc:1193 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Users\admin\AppData\Local\Temp\onnxruntime-java12664764697564321839\onnxruntime_providers_dnnl.dll"

Visual Studio Version

2022 community

GCC / Compiler Version

No response

Metadata

Assignees

No one assigned

    Labels

    api:Javaissues related to the Java APIbuildbuild issues; typically submitted using templateep:oneDNNquestions/issues related to DNNL EPplatform:windowsissues related to the Windows platformstaleissues that have not been addressed in a while; categorized by a bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions