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

FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\code\Blueprint.Net.Server\bin\Debug\net8.0-windows10.0.22621.0\runtimes\win-x64\native\onnxruntime_providers_cuda.dll" ” #21436

Open
anan1213095357 opened this issue Jul 22, 2024 · 3 comments
Labels
build build issues; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot

Comments

@anan1213095357
Copy link

Describe the issue

1721617468489 ![image](https://github.com/user-attachments/assets/9828fd6f-38a2-4a99-8166-64b8094b23e9) 1721617633987 1721617694068 1721617759622 1721617830984 1721617874579

Urgency

No response

Target platform

w11

Build script

null

Error / output

Microsoft.ML.OnnxRuntime.OnnxRuntimeException:“[ErrorCode:RuntimeException] C:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1426 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\code\Blueprint.Net.Server\bin\Debug\net8.0-windows10.0.22621.0\runtimes\win-x64\native\onnxruntime_providers_cuda.dll"

Visual Studio Version

No response

GCC / Compiler Version

No response

@anan1213095357 anan1213095357 added the build build issues; typically submitted using template label Jul 22, 2024
@tianleiwu
Copy link
Contributor

tianleiwu commented Jul 22, 2024

You can use Dependency Walker to see the required DLLs for onnxruntime_providers_cuda.dll. 1.18.1 requires installation of CUDA 11.8 + CuDNN 8.9 + Latest VC Runtime, or CUDA 12.x + cuDNN 9 + Latest VC Runtime. Example could be like:
image

See https://stackoverflow.com/questions/7378959/how-to-check-for-dll-dependency.

If you are not sure whether it is PATH setting problem, just copy those dependent DLLs (except API-*.dll) to the same directory of onnxruntime_providers_cuda.dll to verify.

@skottmckay
Copy link
Contributor

You need to follow the cuDNN install instructions closely for the specific cuDNN version. The instructions change semi-regularly. Often the zlibwapi.dll library is overlooked.

e.g. for cuDNN 8.9: https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-890/install-guide/index.html#install-windows

Make sure the PATH value in the environment the app is running in is as expected.

Dlls loaded manually at runtime won't show up in Dependency Walker (or Dependencies), so while that's a good place to start, it may not be comprehensive.

The ORT CUDA library links against cudnn64_8.dll, but that has minimal dependencies listed, so most likely it loads things like cudnn_cnn_infer64_8.dll manually at runtime as/when needed. cudnn_cnn_infer64_8.dll requires zlibwapi.dll.

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants