VPI - Vision Programming Interface

3.2 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. Make sure NVIDIA container toolkit is installed and up to date.
  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:22.04) with the following command
    sudo docker run --device nvidia.com/gpu=all --device nvidia.com/pva=all -it --net=host --rm ubuntu:22.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-12-6 libcufft-12-6 cuda-cudart-12-6 libegl1-mesa
    # Add CUDA packages to library path
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.6/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 vpi3-dev vpi3-samples
    # If VPI python packages are also installed, Install numpy
    apt-get install python3-pip
    python3.10 -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.