-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
should add cuda dll path via os.add_dll_directory on windows #16500
Copy link
Copy link
Closed
Labels
category: 3rdpartycategory: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribOpenCV 4.0+: moved to opencv_contribcategory: python bindings
Milestone
Description
System information (version)
- OpenCV => master
- Operating System / Platform =>win10
- Compiler => vs2019
- CUDA 10.2
- Python 3.8
Detailed description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category: 3rdpartycategory: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribOpenCV 4.0+: moved to opencv_contribcategory: python bindings