Skip to content

Commit 945546e

Browse files
committed
[build] Add cv2 package dir to DLL search path so cuDNN 9.x can load sublibraries correctly
1 parent 6d807bb commit 945546e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎scripts/__init__.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
PYTHON_EXTENSIONS_PATHS = [
22
LOADER_DIR
33
] + PYTHON_EXTENSIONS_PATHS
4+
5+
# The bundled CUDA/cuDNN DLLs live next to cv2.pyd. cuDNN 9's cudnn64_9.dll loads its
6+
# sub-libraries (cudnn_graph64_9.dll, cudnn_cnn64_9.dll, ...) with LoadLibrary at runtime,
7+
# which does not search the calling DLL's directory, so the DNN CUDA backend aborts the
8+
# process ("Cannot load symbol cudnnGetVersion") unless the package dir is on PATH.
9+
# The loader adds every BINARIES_PATHS entry to the DLL search path and PATH.
10+
BINARIES_PATHS = [
11+
LOADER_DIR
12+
] + BINARIES_PATHS

0 commit comments

Comments
 (0)