Getting Started#
Set up your local PVA Solutions project#
Install the dependencies needed to set up the project:
git
git-lfs: to retrieve binary files from the remote repository
On Ubuntu >= 22.04, install the following packages using apt:
sudo apt install -y git git-lfs
Build PVA Solutions#
Prerequisites#
NVIDIA PVA SDK version 2.5.4 or later is required, with version 2.6.1 set as the default recommended version. Please follow the PVA SDK documentation for installing the SDK and its prerequisites. If multiple versions of PVA SDK are installed, the
FORCE_PVA_SDK_VERSION
CMake flag can be set to select between them, e.g.-DFORCE_PVA_SDK_VERSION=2.5.4
.CUDA Toolkit 12.5 (or later) and cross-platform packages
CMake 3.20 (or later)
Building for DRIVE OS Linux or Jetson Linux (L4T)#
To build PVA Solutions for DRIVE OS Linux or Jetson Linux (L4T), you need to set some environment variables to locate the ASIP Programmer and ASIP licensing information. Refer to the PVA SDK documentation for detailed instructions. Below is an example of how to build for Linux platforms:
mkdir build_l4t && cd build_l4t
cmake -DPVA_BUILD_MODE=L4T ..
make package -j16
Pre-compiled device target binaries are also provided in the source tree to enable building PVA Solutions without needing the ASIP Programmer.
To use pre-compiled binaries, set the IMPORT_DEVICE_TARGETS
CMake flag to ON
during configuration of L4T or QNX builds.
Building for DRIVE OS QNX#
The procedure is similar to building for Linux platforms; however some QNX toolchain environment variables are also required. Refer to the PVA SDK documentation for detailed instructions.
QNX CUDA Toolkit and cross-compile packages are required to build for QNX. Path to the QNX CUDA Toolkit should be set using the CUDA_TOOLKIT_DIR
CMake flag, similar to the example below.
mkdir build_qnx && cd build_qnx
cmake -DPVA_BUILD_MODE=QNX -DCUDA_TOOLKIT_DIR=/usr/local/cuda-safe-12.5 ..
make package -j16
Building for Native Emulator#
The PVA SDK native emulator, which emulates the PVA hardware on a CPU, allows you to build and test PVA Solutions and samples directly on your development system without the need for deployment to the target hardware. This enables faster iteration and debugging. Using the native emulator does not require the ASIP Programmer and license. Below is an example of how to build for the native emulator:
mkdir build_native && cd build_native
cmake -DPVA_BUILD_MODE=NATIVE ..
make -j16
Deploying PVA Solutions#
On Linux Platforms#
PVA Operator sample applications require pva_operator and nvcv_types dynamic libraries on the target device, in addition to cuPVA runtime libraries. Ensure that cuPVA host runtime libraries (and compatible BSP) are installed on the target device.
PVA Solutions debian packages can be used to conveniently install dynamic libraries, sample application binaries, and asset files.
Copy Debian Packages to Target#
Copy the runtime library and sample Debian packages from the root build directory (build_l4t) to the target system.
pva-solutions-<version>-l4t.deb
pva-solutions-<version>-l4t-samples.deb
pva-solutions-<version>-sample-assets.deb
Install Debian Packages on Target#
sudo apt install ./pva-solutions-<version>-l4t.deb ./pva-solutions-<version>-l4t-samples.deb ./pva-solutions-<version>-sample-assets.deb
On QNX Platforms#
For automotive platforms with read-only filesystems (such as DRIVE OS), PVA Solutions libraries, samples applications and cuPVA runtime libraries need to be deployed to the filesystem prior to flashing the board. Refer to the DRIVE OS SDK/PDK documentation for details about how to deploy binaries to the target filesystem.
Install Debian Packages on Host#
For QNX platforms, the following packages contain PVA Solutions libraries and samples:
pva-solutions-<version>-qnx-cross.deb
pva-solutions-<version>-qnx-cross-samples.deb
pva-solutions-<version>-sample-assets.deb
PVA Solutions cross-compiled for QNX can be installed to the host system using the following commands:
sudo apt install ./pva-solutions-<version>-qnx-cross.deb ./pva-solutions-<version>-qnx-cross-samples.deb ./pva-solutions-<version>-sample-assets.deb
Deploy VPU Application Signature Allowlist#
PVA drivers allow system administrators to limit the VPU executables which may be run on the platform by registering cryptographic signatures of VPU ELFs in a secure allowlist database. The allowlist for the PVA Operators (cupva_allowlist_pva_operators_all) must be deployed to the target filesystem. Refer to the PVA SDK documentation for detailed instructions on deploying and registering the allowlist file.
Running PVA Solutions Sample Applications#
On Target Device#
Sample applications will be installed in the target filesystem at a location specified by your SDK/PDK configuration. The exact path depends on your deployment settings. For Linux platforms, sample applications will be installed in:
/opt/nvidia/pva-solutions-<version>/bin/aarch64-linux-gnu/
Some sample applications require input files. For Linux platforms, these assets will be installed in:
/opt/nvidia/pva-solutions-<version>/share/sample_assets/
You can run the sample applications using commands similar to the following:
/opt/nvidia/pva-solutions-<version>/bin/aarch64-linux-gnu/cornersubpix -a /opt/nvidia/pva-solutions-<version>/share/sample_assets/
For QNX platforms, PVA Solutions and PVA SDK library paths should be added to the LD_LIBRARY_PATH
environment variable.
For PVA SDK 2.6.x:
export LD_LIBRARY_PATH=<pva-sdk-install-dir>/lib/aarch64-qnx800:<pva-solutions-install-dir>/lib/aarch64-qnx800:$LD_LIBRARY_PATH
For PVA SDK 2.5.x:
export LD_LIBRARY_PATH=<pva-sdk-install-dir>/lib/aarch64-qnx710:<pva-solutions-install-dir>/lib/aarch64-qnx710:$LD_LIBRARY_PATH
Native Emulator#
You can run the PVA Operator sample applications on your development machine using the PVA SDK Native Emulator.
cd build_native
export PVA_GEN=GEN2
./samples/cornersubpix/cornersubpix -a ../samples/assets/