CV-CUDA Samples

November 14, 2025 ยท View on GitHub

CV-CUDA Samples

CV-CUDA Python samples showcase the use of various CV-CUDA APIs to construct fully functional end-to-end deep learning inference pipelines.

Quick Start

Quick Test (Hello World Only)

For quick testing with just the hello_world.py sample:

For CUDA 12:

python3 -m venv venv_samples
source venv_samples/bin/activate
python3 -m pip install -r requirements_hello_world_cu12.txt
python3 applications/hello_world.py

For CUDA 13:

python3 -m venv venv_samples
source venv_samples/bin/activate
python3 -m pip install -r requirements_hello_world_cu13.txt
python3 applications/hello_world.py

This installs only 4 packages (CV-CUDA, NumPy, cuda-python, nvImageCodec).

Full Installation (All Samples)

Install CV-CUDA and sample dependencies using the installation script:

cd samples
./install_samples_dependencies.sh

This script will:

  • Detect your CUDA version (12 or 13)
  • Create a virtual environment at venv_samples
  • Install all required dependencies including CV-CUDA, PyTorch, NumPy, and sample-specific packages from self-contained requirements files

Note: Full samples require Python 3.10-3.13 on x86_64/amd64 platforms

For interoperability samples only, use:

./install_interop_dependencies.sh

This installs a lighter set of dependencies specifically for interoperability samples (PyTorch, CuPy, PyCUDA, PyNvVideoCodec, CV-CUDA).

After installation, activate the virtual environment:

source venv_samples/bin/activate

Running Samples

Run individual samples:

python3 operators/label.py
python3 applications/classification.py
python3 interoperability/pytorch_interop.py

Or run all samples at once:

./run_samples.sh     # Operators and applications
./run_interop.sh     # Interoperability samples

Documentation

For detailed documentation, tutorials, and API reference: