-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Failed to create CUDAExecutionProvider. #17537
Comments
It is not related to model. Most likely related to package installation or cuDNN installation. Are you able to reproduce it in a new python environment, or reinstall like the following?
Then test with your python script
Since you imported torch before onnxruntime, ORT shall be able to use the cuDNN loaded by torch. |
You can also try our nightly build. To get it, first uninstall the one you have installed: python3 -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu -qq Then get a new one from our nightly feed:
Then you can use the |
hi @tianleiwu , thanks for commenting. I tried reinstalling it but it does not seem to help. I have also tried this on a different server (with the exact same cuda/python environment) but am still getting the same error. @snnn thanks for the suggestion. Looks like the nightly build also is not working properly... The only difference I see is just that the error output is now colored yellow. Can you specify on what you mean by using |
To where the package is installed, you may find some *.so files. For example, if you run
in the directory where ort-nightly-gpu python package is installed, the ldd tool should show some errors saying something is not found. |
@jFkd1, Example of ldd for ort-nightly-gpu in Ubuntu 20.04 with CUDA 11.8:
|
It seems totally fine. As tianleiwu said, the "import torch" statement could be the reason. If you load pytorch before loading onnxruntime, onnxruntime probably will get cuda and cudnn libs from pytorch instead and there might be version mismatch happened. Can you try to create a simpler script that only has onnxruntime? |
The latest nightly package has some problems. But the latest release package is fine. I just tested it under RHEL8 and it worked fine. The running environment had the following packages:
|
Thanks for the responses. I tried not importing torch and that did not seem to mitigate the issue. I was only importing torch because it was believed to solve the CUDA dependency issue with ort for some. Unfortunately it did not work for me. Here's what I get from running
A quick internet search suggests this may be related to #9754. I will try the suggested fix with reinstalling libcudnn8 and see if that would help. |
I will make a new nightly package for you to test, which will not have the #9754 issue. But I will need a few days. |
following, |
Right, as it said, your operating system cannot find libcurand.so.10. Did you install CUDA and CUDNN? |
Feel free to create a new issue if the problem still exists. Please note CUDA and CUDNN are commercial software owned by Nvidia with End User License Agreements. Our team do not redistribute their software due to license restrictions and security concerns. Even if we do, there is no way to prove to you the redistributed files are genuine. The latest ONNX Runtime release was built with CUDA 11.8 and CUDNN 8.9. Users of ONNX Runtime GPU packages need to get the dependent libraries from Nvidia. If any dependent library is missing, on Linux ONNX Runtime should be able to print out a detailed error message when loading its CUDA execution provider. The message can tell what was missing. |
Describe the issue
For some reason, onnxruntime-gpu is having a hard time using CUDAExecutionProvider.
Using Cuda 11.7 with onnxruntime-gpu=1.15.1, I tried running the following in python 3.10:
And I will always get the error message:
It looks like I am using the right system and versions. I will upload the model onnx if necessary.
To reproduce
pip install onnxruntime-gpu==1.15.1
Using cuda 11.7
Run this code:
Urgency
Very urgent
Platform
Linux
OS Version
Ubuntu 18.04.6 LTS
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.15.1
ONNX Runtime API
Python
Architecture
X64
Execution Provider
CUDA
Execution Provider Library Version
CUDA 11.7
The text was updated successfully, but these errors were encountered: