You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
should add cuda dll path via os.add_dll_directory on windows #16500
I compiled opencv from source with cuda and python supports and encountered "import cv2 ,dll failed to load " error, after spent a lot of time solving this problem, I found that dll loading policy has changed in python3.8 such that PATH and the current working directory are no longer used.
Please see this note
Steps to reproduce
Compiler opencv under python3.8 on windows.
Can't load cv2 even when C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin is in PATH
Copy all cuda DLL to C:\Python38 then it works, which shows that python3.8 doesn't use PATH when loading DLLs.
Now remove all cuda DLLs from C:\Python38 and add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin via os.add_dll_directory in cv2/init.py ,then it will work too.
It is Python 3.8 specific (on Windows).
There is no good robust way to resolve broken DLLs loading.
Some hacks are possible - see #16120 (through "loader"). You may try to add something for CUDA too.
It is Python 3.8 specific (on Windows).
There is no good robust way to resolve broken DLLs loading.
Some hacks are possible - see #16120 (through "loader"). You may try to add something for CUDA too.
So could we use cmake commands to add cuda path to BINARIES_PATHS when cuda is enabled?
It is Python 3.8 specific (on Windows).
There is no good robust way to resolve broken DLLs loading.
Some hacks are possible - see #16120 (through "loader"). You may try to add something for CUDA too.
Activity
alalek commentedon Feb 4, 2020
It is Python 3.8 specific (on Windows).
There is no good robust way to resolve broken DLLs loading.
Some hacks are possible - see #16120 (through "loader"). You may try to add something for CUDA too.
cyyever commentedon Feb 4, 2020
So could we use cmake commands to add cuda path to BINARIES_PATHS when cuda is enabled?
cyyever commentedon Feb 4, 2020
I has committed a PR.
fixes opencv#16500
fixes opencv#16500