Pre-built NVIDIA® CUDA™ enabled OpenCV wheels for Python - batteries included.
This is a fork of the official opencv-python project that ships fully standalone CUDA-enabled OpenCV builds. No CUDA Toolkit, cuDNN, or other NVIDIA SDK needs to be installed - every required runtime library is bundled in the wheel, including hardware video decoding and encoding (NVDEC/NVENC). Once installed, the following should just work:
import cv2
print(cv2.cuda.getCudaEnabledDeviceCount())See the project homepage for more documentation.
- Windows x64 (the only platform packages are currently produced for)
- NVIDIA GPU - Maxwell class (GeForce GTX 900 series) or newer
- NVIDIA driver - the wheel links directly against driver libraries, so an up-to-date driver must be installed for
import cv2to succeed - Python 3.7 or newer - a single abi3 wheel covers all supported Python versions
-
Download the latest
opencv_python_cuda-*-win_amd64.whlfrom the Releases page. -
Install it with
pip(or another package manager likeuv):pip install opencv_python_cuda-<version>-win_amd64.whl -
Import the
cv2package as usual.
Note
If you have a previous manually-installed (not via pip) version of OpenCV (e.g. a cv2 module in the root of Python's site-packages), remove it before installing to avoid conflicts. Also make sure your pip is up to date (19.3 is the minimum supported version): pip install --upgrade pip.
- All OpenCV modules that can be built with CUDA support
- Hardware-accelerated video decoding and encoding via NVDEC/NVENC (
cv2.cudacodec) - FFmpeg for video I/O
- All required CUDA runtime libraries, bundled in the wheel
Non-free algorithms (e.g. SURF) are excluded - see the FAQ below.
- Project homepage - downloads and overview
- CUDA Compatibility Reference - GPU architectures, compute capabilities, and CUDA toolkit support
- Workflow Guide - repository setup, triggering builds, and wheel size strategy
For general OpenCV questions, refer to the FAQ in the upstream project.
Q: Why can't I pip install opencv-python-cuda from PyPI?
A: The package is far too large for PyPI and exceeds its project size limits. Download wheels from the Releases page instead.
Q: Why does import cv2 fail with "DLL load failed"?
A: The wheel requires an NVIDIA driver to be installed. On machines without one (or with a very old driver), the bundled CUDA and video codec libraries cannot be loaded.
Q: Why are non-free algorithms excluded?
A: Non-free algorithms such as SURF are patented and cannot be distributed as built binaries. Note that SIFT is included, due to patent expiration as of OpenCV 4.3.0 / 3.4.10. See opencv-python#126 for more info.
The opencv-python-cuda package (i.e. the scripts in this repository) is available under the MIT license.
- OpenCV itself is available under the Apache 2 license.
- All wheels are distributed with FFmpeg, licensed under the LGPLv2.1, and redistributable portions of the NVIDIA® CUDA™ SDK under the NVIDIA Software License Agreement (EULA).
- The packages include other binaries as well; the full list of licenses can be found in LICENSE-3RD-PARTY.txt.
By downloading and using the software, you agree to fully comply with the terms and conditions of the CUDA EULA.