[Build] CUDA_PATH is set but CUDA wasn't able to be loaded (Windows 11, onnxruntime-gpu 1.13.1, CUDA 11.8) #21740
Labels
build
build issues; typically submitted using template
ep:CUDA
issues related to the CUDA execution provider
platform:windows
issues related to the Windows platform
Describe the issue
I am trying to use the ONNX Runtime CUDA Execution Provider with a GeForce RTX 4060 Ti on Windows 11, but I am consistently getting the error "CUDA_PATH is set but CUDA wasn't able to be loaded". I have CUDA Toolkit 11.8 and cuDNN 8.9.2 installed, and I am using onnxruntime-gpu version 1.13.1.
I have tried the following troubleshooting steps:
--no-cache-dir
flagCUDA_PATH
,Path
,INCLUDE
, andLIB
environment variables are set correctlydeviceQuery.exe
andbandwidthTest.exe
CUDA samples, which both passedonnxruntime_config.json
file to force the use of the CUDA Execution ProviderDespite these efforts, the error persists. I am unable to generate the ONNX Runtime debug log. I am using Python 3.10.9 and Visual Studio Build Tools 2022.
I have attached the output of the
onnx_test.py
script and the Deep-Live-Cam application, as well as screenshots of my environment variables.I would greatly appreciate any assistance in resolving this issue.
Urgency
No response
Target platform
Windows
Build script
import onnxruntime as ort
import json
with open('onnxruntime_config.json', 'r') as f:
config = json.load(f)
try:
ort_session = ort.InferenceSession(r"C:\Users\lucas\miniconda3\envs\trocarosto\Deep-Live-Cam\models\inswapper_128_fp16.onnx", providers=config['providers'])
print("Sessão ONNX Runtime com CUDA criada com sucesso!")
except Exception as e:
print(f"Erro ao criar sessão ONNX Runtime com CUDA: {e}")
Error / output
(base) C:\Windows\System32>conda activate trocarosto
(trocarosto) C:\Windows\System32>cd C:\Users\lucas\miniconda3\envs\trocarosto\Deep-Live-Cam
(trocarosto) C:\Users\lucas\miniconda3\envs\trocarosto\Deep-Live-Cam>python onnx_test.py
EP Error using [{'name': 'CUDAExecutionProvider', 'device_id': 0}]
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
2 0 2 4 - 0 8 - 1 4 1 5 : 2 9 : 4 5 . 0 7 5 7 7 1 7 [ W : o n n x r u n t i m e : , g r a p h . c c : 3 4 8 7 o n n x r u n t i m e : : G r a p h : : C l e a n U n u s e d I n i t i a l i z e r s A n d N o d e A r g s ] R e m o v i n g i n i t i a l i z e r ' b u f f 2 f s ' . I t i s n o t u s e d b y a n y n o d e a n d s h o u l d b e r e m o v e d f r o m t h e m o d e l .
2 0 2 4 - 0 8 - 1 4 1 5 : 2 9 : 4 5 . 1 0 9 4 0 4 5 [ E : o n n x r u n t i m e : D e f a u l t , p r o v i d e r _ b r i d g e _ o r t . c c : 1 2 6 6 o n n x r u n t i m e : : T r y G e t P r o v i d e r I n f o _ C U D A ] D : \ a \ _ w o r k \ 1 \ s \ o n n x r u n t i m e \ c o r e \ s e s s i o n \ p r o v i d e r _ b r i d g e _ o r t . c c : 1 0 6 9 o n n x r u n t i m e : : P r o v i d e r L i b r a r y : : G e t [ O N N X R u n t i m e E r r o r ] : 1 : F A I L : L o a d L i b r a r y f a i l e d w i t h e r r o r 1 2 6 " " w h e n t r y i n g t o l o a d " C : \ U s e r s \ l u c a s \ m i n i c o n d a 3 \ e n v s \ t r o c a r o s t o \ L i b \ s i t e - p a c k a g e s \ o n n x r u n t i m e \ c a p i \ o n n x r u n t i m e _ p r o v i d e r s _ c u d a . d l l "
Erro ao criar sessão ONNX Runtime com CUDA: D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:574 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/reference/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they're in the PATH, and that your GPU is supported.
(trocarosto) C:\Users\lucas\miniconda3\envs\trocarosto\Deep-Live-Cam>
Visual Studio Version
Visual Studio Build Tools 2022
GCC / Compiler Version
No response
The text was updated successfully, but these errors were encountered: