Skip to content

Breakthrough/opencv-python-cuda

 
 

Repository files navigation

opencv-python-cuda

Pre-built NVIDIA® CUDA™ enabled OpenCV wheels for Python - batteries included.

Latest release Platform License

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.

Requirements

  • 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 cv2 to succeed
  • Python 3.7 or newer - a single abi3 wheel covers all supported Python versions

Installation

  1. Download the latest opencv_python_cuda-*-win_amd64.whl from the Releases page.

  2. Install it with pip (or another package manager like uv):

    pip install opencv_python_cuda-<version>-win_amd64.whl
    
  3. Import the cv2 package 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.

What's included

  • 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.

Documentation

Frequently Asked Questions

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.

Licensing

The opencv-python-cuda package (i.e. the scripts in this repository) is available under the MIT license.

By downloading and using the software, you agree to fully comply with the terms and conditions of the CUDA EULA.

About

Precompiled NVIDIA® CUDA™ enabled opencv-python package, all batteries included.

Resources

License

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages

  • Python 100.0%