OpenCV python wheels built against CUDA 13.1, Nvidia Video Codec SDK 13.0 and cuDNN 9.17.1.
Suitable for all devices of compute capability >= 7.5 with binary compatible code for devices of compute capability 7.5-12.0.
Nvidia GPU Computing Toolkit v13.1 is required for import cv2 to work and cuDNN 9.17.1 for accelerated inference when using the dnn module.
Note Windows OS: This wheel relies on cuDNN being installed in the CUDA Toolkit directory. Therefore you can either download
-
the cuDNN Tarball (Version->Tarball) and extract its contents to your CUDA directory, or
-
the installer (Version->exe (local)) and the add the path to the bin folder inside the cuDNN installation directory to your PATH_TO_PYTHON_DIST/Lib/site-packages/cv2/config.py file. e.g.
import os
BINARIES_PATHS = [
os.path.join('D:/build/opencv/install', 'x64/vc17/bin'),
os.path.join(os.getenv('CUDA_PATH', 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1'), 'bin')
os.path.join('C:/Program Files/NVIDIA/CUDNN/v9.17.1/bin/13.1')
] + BINARIES_PATHS
Nvidia CMake configuration output
-- NVIDIA CUDA: YES (ver 13.1.80, CUFFT CUBLAS NVCUVID NVCUVENC)
-- NVIDIA GPU arch: 75 80 86 89 90 100 120
-- NVIDIA PTX archs: 121
--
-- cuDNN: YES (ver 9.17.1)
Build Summary
Windows Build commands
set "CMAKE_ARGS=-DWITH_CUDA=ON -DCUDA_ARCH_BIN=7.5;8.0;8.6;8.9;9.0;10.0;12.0 -DCUDA_ARCH_PTX=12.1 -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON"
set ENABLE_CONTRIB=1
python.exe setup.py bdist_wheel --py-limited-api=cp37
Ubuntu 22.04 Build commands
export "CMAKE_ARGS=-DWITH_CUDA=ON -DCUDA_ARCH_BIN=7.5;8.0;8.6;8.9;9.0;10.0;10.3;12.0;12.1 -DCUDA_ARCH_PTX=12.1 -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON"
export ENABLE_CONTRIB=1
python setup.py bdist_wheel --py-limited-api=cp37