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

Cannot load onnxruntime_providers_cuda.dll #18820

Closed
QiuYilin opened this issue Dec 14, 2023 · 1 comment
Closed

Cannot load onnxruntime_providers_cuda.dll #18820

QiuYilin opened this issue Dec 14, 2023 · 1 comment
Labels
ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform

Comments

@QiuYilin
Copy link

QiuYilin commented Dec 14, 2023

Describe the issue

I use cuda 11.7 and cudnn 8.7.0.

When I run example fns_candy_style_transfer(cuda), it shows

Try to enable CUDA first
C:\thirdParty\vcpkg\buildtrees\onnxruntime\src\v1.16.0-7fe4bf9fce.clean\onnxruntime\core\session\provider_bridge_ort.cc:1193 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\program_on_git\thirdParty\onnxruntime-inference-examples\c_cxx\build\fns_candy_style_transfer\Debug\onnxruntime_providers_cuda.dll"    
Stacktrace:
C:\thirdParty\vcpkg\buildtrees\onnxruntime\src\v1.16.0-7fe4bf9fce.clean\onnxruntime\core\session\provider_bridge_ort.cc(1345): onnxruntime!onnxruntime::CudaProviderFactoryCreator::Create+0x23
C:\thirdParty\vcpkg\buildtrees\onnxruntime\src\v1.16.0-7fe4bf9fce.clean\onnxruntime\core\session\provider_bridge_ort.cc(1946): onnxruntime!OrtApis::SessionOptionsAppendExecutionProvider_CUDA_V2+0x5E
C:\program_on_git\thirdParty\onnxruntime-inference-examples\c_cxx\fns_candy_style_transfer\fns_candy_style_transfer.c(155): fns_candy_style_transfer!enable_cuda+0x5B
C:\program_on_git\thirdParty\onnxruntime-inference-examples\c_cxx\fns_candy_style_transfer\fns_candy_style_transfer.c(217): fns_candy_style_transfer!wmain+0x2A6
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(91): fns_candy_style_transfer!invoke_main+0x39
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): fns_candy_style_transfer!__scrt_common_main_seh+0x12E  
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331): fns_candy_style_transfer!__scrt_common_main+0xE        
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_wmain.cpp(17): fns_candy_style_transfer!wmainCRTStartup+0xE
(0): KERNEL32!BaseThreadInitThunk+0x14
(0): ntdll!RtlUserThreadStart+0x21

CUDA is not available

This is the result of Windbg

Microsoft (R) Windows Debugger Version 10.0.22621.2428 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: C:\test\fns_candy_style_transfer.exe

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*
Symbol search path is: srv*
Executable search path is: 
ModLoad: 00007ff7`27a50000 00007ff7`27a80000   fns_candy_style_transfer.exe
ModLoad: 00007fff`55710000 00007fff`55908000   ntdll.dll
ModLoad: 00007fff`55560000 00007fff`5561d000   C:\WINDOWS\System32\KERNEL32.DLL
ModLoad: 00007fff`53190000 00007fff`53486000   C:\WINDOWS\System32\KERNELBASE.dll
ModLoad: 00007fff`50030000 00007fff`500c0000   C:\WINDOWS\SYSTEM32\apphelp.dll
ModLoad: 00007fff`53b50000 00007fff`53c7b000   C:\WINDOWS\System32\ole32.dll
ModLoad: 00007fff`52e90000 00007fff`52f90000   C:\WINDOWS\System32\ucrtbase.dll
ModLoad: 00007fff`539b0000 00007fff`53ad6000   C:\WINDOWS\System32\RPCRT4.dll
ModLoad: 00007fff`54310000 00007fff`54664000   C:\WINDOWS\System32\combase.dll
ModLoad: 00007fff`54090000 00007fff`540bc000   C:\WINDOWS\System32\GDI32.dll
ModLoad: 00007fff`53590000 00007fff`535b2000   C:\WINDOWS\System32\win32u.dll
ModLoad: 00007fff`52f90000 00007fff`530aa000   C:\WINDOWS\System32\gdi32full.dll
ModLoad: 00007fff`52df0000 00007fff`52e8d000   C:\WINDOWS\System32\msvcp_win.dll
ModLoad: 00007fff`540c0000 00007fff`5425e000   C:\WINDOWS\System32\USER32.dll
ModLoad: 00007fff`4e340000 00007fff`4e34f000   C:\WINDOWS\SYSTEM32\VCRUNTIME140_1D.dll
ModLoad: 00007fff`3d990000 00007fff`3d9be000   C:\WINDOWS\SYSTEM32\VCRUNTIME140D.dll
ModLoad: 00007fff`11dd0000 00007fff`11eb1000   C:\WINDOWS\SYSTEM32\MSVCP140D.dll
ModLoad: 000001d1`3bf60000 000001d1`3c181000   C:\WINDOWS\SYSTEM32\ucrtbased.dll
ModLoad: 00007fff`11450000 00007fff`11671000   C:\WINDOWS\SYSTEM32\ucrtbased.dll
ModLoad: 000001d1`3bd30000 000001d1`3bf51000   C:\WINDOWS\SYSTEM32\ucrtbased.dll
ModLoad: 00007fff`07f90000 00007fff`0abe5000   C:\test\onnxruntime.dll
ModLoad: 00007fff`53c80000 00007fff`53d2f000   C:\WINDOWS\System32\ADVAPI32.dll
ModLoad: 00007fff`53780000 00007fff`5381e000   C:\WINDOWS\System32\msvcrt.dll
ModLoad: 00007fff`55450000 00007fff`554ec000   C:\WINDOWS\System32\sechost.dll
ModLoad: 00007fff`11240000 00007fff`11441000   C:\test\re2.dll
ModLoad: 00007fff`07860000 00007fff`07f8f000   C:\test\libprotobufd.dll
(5b58.4284): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00007fff`557e0730 cc              int     3
0:000> g
ModLoad: 00007fff`546d0000 00007fff`54700000   C:\WINDOWS\System32\IMM32.DLL
ModLoad: 00007fff`51640000 00007fff`51652000   C:\WINDOWS\SYSTEM32\kernel.appcore.dll
ModLoad: 00007fff`53500000 00007fff`53582000   C:\WINDOWS\System32\bcryptPrimitives.dll
ModLoad: 00007fff`4cab0000 00007fff`4cac2000   C:\test\onnxruntime_providers_shared.dll
ModLoad: 00007ffe`94c70000 00007ffe`a805a000   C:\test\onnxruntime_providers_cuda.dll
ModLoad: 00007fff`365a0000 00007fff`365eb000   C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cudnn64_8.dll
ModLoad: 00007ffe`8c2c0000 00007ffe`94c64000   C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cublas64_11.dll
ModLoad: 00007ffe`79ed0000 00007ffe`8c2c0000   C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cublasLt64_11.dll
ModLoad: 00007ffe`64410000 00007ffe`79ec8000   C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cufft64_10.dll
ModLoad: 00007fff`3b9f0000 00007fff`3c077000   C:\WINDOWS\SYSTEM32\dbgeng.dll
ModLoad: 00007fff`53160000 00007fff`53187000   C:\WINDOWS\System32\bcrypt.dll
ModLoad: 00007fff`3b930000 00007fff`3b9e4000   C:\WINDOWS\SYSTEM32\dbgmodel.dll
ModLoad: 00007fff`53ee0000 00007fff`53fad000   C:\WINDOWS\System32\OLEAUT32.dll
ModLoad: 000001d1`3f560000 000001d1`3f62d000   C:\WINDOWS\System32\OLEAUT32.dll
ModLoad: 00007fff`50b40000 00007fff`50d24000   C:\WINDOWS\SYSTEM32\dbghelp.dll
ModLoad: 00007fff`4d8f0000 00007fff`4d926000   C:\WINDOWS\SYSTEM32\XmlLite.dll
ModLoad: 00007fff`3d3b0000 00007fff`3d3bc000   C:\WINDOWS\SYSTEM32\Secur32.dll
ModLoad: 00007fff`52cd0000 00007fff`52d02000   C:\WINDOWS\SYSTEM32\SSPICLI.DLL
ModLoad: 00007fff`53940000 00007fff`53995000   C:\WINDOWS\System32\shlwapi.dll
ModLoad: 00007fff`4ba20000 00007fff`4ba2a000   C:\WINDOWS\SYSTEM32\version.dll
ModLoad: 00007fff`54260000 00007fff`5430d000   C:\WINDOWS\System32\shcore.dll
ModLoad: 00007fff`53490000 00007fff`534f7000   C:\WINDOWS\System32\wintrust.dll
ModLoad: 00007fff`535c0000 00007fff`5371d000   C:\WINDOWS\System32\CRYPT32.dll
ModLoad: 00007fff`529c0000 00007fff`529d2000   C:\WINDOWS\SYSTEM32\MSASN1.dll
ModLoad: 00007fff`52790000 00007fff`527a8000   C:\WINDOWS\SYSTEM32\CRYPTSP.dll
ModLoad: 00007fff`51e50000 00007fff`51e84000   C:\WINDOWS\system32\rsaenh.dll
ModLoad: 00007fff`52780000 00007fff`5278c000   C:\WINDOWS\SYSTEM32\CRYPTBASE.dll
ModLoad: 00007fff`556b0000 00007fff`556cd000   C:\WINDOWS\System32\imagehlp.dll
(5b58.4284): C++ EH exception - code e06d7363 (first chance)
(5b58.4284): C++ EH exception - code e06d7363 (first chance)
(5b58.4284): C++ EH exception - code e06d7363 (first chance)
ntdll!NtTerminateProcess+0x14:
00007fff`557ad564 c3              ret

To reproduce

fns_candy_style_transfer example(cuda)

Urgency

No response

Platform

Windows

OS Version

10(22H2 19045)

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.16.0

ONNX Runtime API

C++

Architecture

X64

Execution Provider

CUDA

Execution Provider Library Version

CUDA 11.7

@github-actions github-actions bot added ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform labels Dec 14, 2023
@QiuYilin
Copy link
Author

I use a modified compilation method in vcpkg style: https://github.com/luncliff/vcpkg-registry/tree/main/ports/onnxruntime.I have tested the release version of 1.16.0 and there is no problem (except for the lack of zlibwapi), so it may be that the compilation options are missing.

@QiuYilin QiuYilin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

1 participant