-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
v1.8.0 raises Exception if cudnn not found in Program Files #7965
Comments
When possible , don't use "PATH" for locating dependent DLLs. If you put these CUDA DLL in the same dir of your application exe, it should be fine. "for end-users who will not install CUDA/CUDNN sdk", why do you provide the onnx runtime GPU build to them? Please tell us more about your usage. Is it a C/C++ program or python? |
I know. My CUDA dlls located near in project dir. But 1.8.0 raises a hard exception if cudnn not found in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin onnxruntime/onnxruntime/python/_pybind_state.py Lines 42 to 45 in 63df683
there was no such code in 1.7.0 and works fine |
Cudnn documentation asks to copy cudnn files into the CUDA Toolkit directory located in Program Files. Maybe @skottmckay can give more context. |
Now I got it. 1.8 assumes the CUDNN files are either located in the CUDA dir or %CUDNN_HOME% (which is a onnx runtime specific env variable). But 1.7 doesn't have such requirement, as long as the DLLs are in %PATH%, it is fine. So this is a breaking change. |
that is for developers. I am making an app for END-users. Requirement to install CUDA/CUDNN manually by an end-user is suicide. Wake up developers ! What the hell are you doing ?? |
I believe the change was done to address a new restrictions for secure python dll loading on Windows: This is currently only needed for python 3.8 and above.
However, this change will eventually be required for all users as they update their python version on Windows, |
@ivanst0 added the bulk of the new behavior in #6436 however that PR seemed to be more about handling multiple CUDA versions being on a machine. I included the additional CUDNN_HOME check to be consistent with what the ORT build uses for an explicitly specified path to the CUDNN libraries (and part of the build uses the python bindings for tests). Previously the CUDNN documentation involved putting the binaries in a separate location to CUDA_HOME, but now that that has changed we could remove the usage of CUDNN_HOME from the build etc. That seems like a side issue though. Is it that there's a requirement for a user to install CUDA/CUDNN, or that Long term, would it be valid to not fail if the CUDA environment variables aren't found (that doesn't mean the dlls aren't available), and do a check via |
cuda/cudnn bin path via |
Yes, if you are distributing CUDA/cuDNN DLLs with your Python app/package (in <LIB_DIR>\bin), I recommend setting the appropriate environment variable (e.g. CUDA_PATH_V11_2) to <LIB_DIR> instead of prepending <LIB_DIR>\bin to PATH, before importing onnxruntime package. This works across all supported Python versions (3.6 - 3.9). @iperov, if this solution works for you please feel free to close this issue. |
@ivanst0 Is there a reason why we need to force someone to set the environment variable if the CUDA library would have been found? i.e. what would the issue be with us making the calls to add_dll_directory if paths are available via the environment variable/s, but only failing if If possible that seems slightly cleaner and more user friendly to me as the user doesn't need to discover the correct incantation for the |
It just happened to work. onnx runtime and pytorch requires different CUDA and CUDNN versions. Even though sometimes the file names are the same, the versions are different. |
why different if I choosed |
onnxruntime 1.8.0 uses 11.0 CUDA provides minor version backward compatibility starting from 11.1. And what about CUDNN version? And what if onnxruntime was built with a newer CUDA version than pytorch? |
please don't discuss offtopic |
we plan on patching 1.8 release to fix this issue. |
seems like someone removed code from pybind_state and now works as 1.7.0 what solution about securing dlls in future? |
looks like onnxruntime-gpu==1.12.1 does not work with cuda 11.5+ cuda 11.3 is fine. @jywu-msft Can you write the cuda version requirements on the release page? |
11.5 should work. I just tested it with onnxruntime-gpu 1.12.1 python package and it worked fine. |
I don't use cuda "installation". Cuda is not an installation, but only bunch of dlls. i am using cuda dlls from torch pip but dlls from |
tested torch==1.11.0+cu115 and that worked too. |
Because it uses dlls from your already installed "cuda kit" or other dirs from PATH. I am using builder of portable all-in-one folder for DeepFaceLive project (written by me) (https://github.com/iperov/DeepFaceLive), where PATHs are limited by folder. |
that error message is saying it could not load cudnn_cnn_infer64_8.dll , but it could also mean one of its dependencies is missing. I suspect that is most likely the cause. |
ok I will check. There is other issue . same model produces different result with Every new release you introduce new bugs !! so tired. |
I understand your frustration about bugs. Unfortunately, bugs will come with new features and changes. We will try our best to do better testing and avoid regressions. You can help us by opting into our Release Candidate testing. Every release we will have a couple weeks period where we publish Release Candidates and users can report issues before we finalize the release. Can you please file a separate issue with repro steps and assets for the "buggy inference" issue? Otherwise it is getting buried in this closed issue and others aren't looking at it. |
check issue 12706 |
v1.8.0
raises Exception if cudnn not found inC:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\bin
but my app is standalone and made for end-users who will not install CUDA/CUDNN sdk.
os LoadLibrary() automatically uses CUDA dlls provided in
PATH
environmentall works fine in
v1.7.0
, can you fix it?The text was updated successfully, but these errors were encountered: