problem with onnx #1312
Replies: 1 comment
-
This is what AI says my friend:) barry You're hitting one of the most infamous ONNX Runtime + CUDA + cuDNN errors: LoadLibrary failed with error 126 This almost always means: 🔥 TL;DR Fix This First Add these to your system environment variable PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin cudnn64_8.dll must be inside C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin 🧼 Close all terminals / VSCode / PyCharm / shells and restart your PC after changing PATH. 🧠 Deeper Explanation LoadLibrary failed with error 126 "" Python tried to load onnxruntime_providers_cuda.dll, but that DLL depends on CUDA/cuDNN DLLs — and it can’t find them. So even if onnxruntime-gpu is installed correctly, it will fail unless: cuda.dll (like cudart64_110.dll, cublas64_11.dll, cudnn64_8.dll) can be found in the environment. These are in PATH, not just installed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
help lol, ive pulled all my hair from reinstalling cuda 11.8 and cudnn 8.5, 8.5 and 8.9 for like 3 times, even tried once on wsl which worked but useless since i cant use webcam. pls lmao im losing my sanity. i installed correct onnx runtime, cuda 11.8, cudnn 8.5, added to PATH, confirmed path and i keep getting this
(venv) PS C:\Users\ihsan\Documents\Deep-Live-Cam> python run.py --execution-provider cuda
2025-05-26 18:56:17.9423569 [E:onnxruntime:Default, provider_bridge_ort.cc:1480 onnxruntime::TryGetProviderInfo_CUDA] D:\a_work\1\s\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\ihsan\Documents\Deep-Live-Cam\venv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"
EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:743 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
when using ['CUDAExecutionProvider']
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
2025-05-26 18:56:18.0196360 [E:onnxruntime:Default, provider_bridge_ort.cc:1480 onnxruntime::TryGetProviderInfo_CUDA] D:\a_work\1\s\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\ihsan\Documents\Deep-Live-Cam\venv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"
Beta Was this translation helpful? Give feedback.
All reactions