VPI - Vision Programming Interface

4.1 Release

Install VPI in Docker

This page describes how to install VPI inside a docker container on a Jetson device, allowing to run VPI-based apps in it.

Pre-requisites

Before running VPI inside docker a few things need to be setup on the device.

  1. Make sure a working NVIDIA CUDA driver is installed on the device. You can check this by running
    nvidia-smi
  2. Install the NVIDIA container toolkit from the stable NVIDIA repository.
    sudo apt-get update
    sudo apt-get install -y --no-install-recommends ca-certificates curl gnupg2
    curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
    | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
    curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
    | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
    | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
    sudo apt-get update
    sudo apt-get install nvidia-container-toolkit
  3. Now use the toolkit to generate an NVIDIA CDI specification
    sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
  4. Use the container toolkit to enable CDI in Docker, and restart the daemon
    sudo nvidia-ctk runtime configure --runtime=docker --cdi.enabled=true
    sudo systemctl restart docker
  5. Make sure pva-allow is installed on the target
    sudo apt-get install pva-allow-2

Installing VPI inside docker

  1. Run the desired docker container (in this example we use ubuntu:24.04) with the following command
    sudo docker run --device nvidia.com/gpu=all --device nvidia.com/pva=all -it --net=host --rm ubuntu:24.04
  2. Inside the docker, download and install VPI debians.
    # Install packages required by add-apt-repository
    apt-get update
    apt-get install ca-certificates curl gnupg software-properties-common
    # Add Jetson public APT repository
    curl -fsSL https://repo.download.nvidia.com/jetson/jetson-ota-public.asc \
    | gpg --dearmor \
    | tee /usr/share/keyrings/nvidia-jetson-ota-public.gpg > /dev/null
    add-apt-repository 'deb [signed-by=/usr/share/keyrings/nvidia-jetson-ota-public.gpg] https://repo.download.nvidia.com/jetson/common r39.2 main'
    # Install VPI dependencies
    apt-get update
    apt-get install libnpp-13-2 libcufft-13-2 cuda-cudart-13-2 libegl1-mesa
    # Add CUDA packages to library path
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-13-2/targets/aarch64-linux/lib/
    # Install VPI
    apt-get install libnvvpi4 vpi4-dev vpi4-samples pva-allow-2
    # Optional: install VPI Python bindings and numpy
    apt-get install python3.12-vpi4 python3-numpy

After these steps are successfully executed you will be able to run VPI-based applications inside the docker container, like the VPI samples.