VPI - Vision Programming Interface

4.0 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. The following instructions guarantee that the most recent version ( >= 1.15) is installed.
    curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
    | sudo tee /etc/apt/trusted.gpg.d/nvidia-container-toolkit-keyring.asc
    curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
    | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
    cat <<-EOF | sudo tee /etc/apt/preferences.d/nvidia-container-toolkit-version
    Package: *
    Pin: release o=https://nvidia.github.io/libnvidia-container/stable
    Pin-Priority: 1001
    EOF
    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 gnupg software-properties-common
    # Add Jetson public APT repository
    apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc
    add-apt-repository 'deb https://repo.download.nvidia.com/jetson/common r36.4 main'
    # Install VPI depedencies
    apt-get update
    apt-get install libnpp-13-0 libcufft-13-0 cuda-cudart-13-0 libegl1-mesa
    # Add CUDA packages to library path
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-13-0/targets/aarch64-linux/lib/
    # This is a temporary workaround required to install pva-allow-2 in docker which will not be necessary next release
    apt-get install pva-allow-2 || true
    rm /var/lib/dpkg/info/pva-allow-2.post*
    dpkg --configure pva-allow-2
    # Install VPI
    apt-get install libnvvpi3 vpi-dev vpi-samples
    # If VPI python packages are also installed, Install numpy
    apt-get install python3-pip
    python3.12 -m pip install numpy

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