Vulkan SC

Vulkan SC is a streamlined, deterministic, robust API based on Vulkan 1.2 that enables state-of-the-art GPU-accelerated graphics and computation to be deployed in safety-critical systems that are certified to meet industry functional safety standards.

Jetson Linux supports the Vulkan SC 1.0 specification. For the latest Vulkan SC 1.0 specification with extensions, refer to Vulkan SC Specification.

Vulkan SC on Jetson Linux is not safety-certified. Please contact NVIDIA® if you need a safety-certified deployment.

Vulkan SC Extensions

Refer to https://www.khronos.org/registry/VulkanSC/ for descriptions about the Vulkan SC extensions.

Instance Extensions

To determine the Vulkan SC instance extensions that your Jetson Linux supports, use the following code:

uint32_t instance_ext_count = 0;
VkExtensionProperties *instance_exts_ptr = NULL;

//Get the number of extensions
vkEnumerateInstanceExtensionProperties(NULL, &instance_ext_count, NULL);
instance_exts_ptr = (VkExtensionProperties*) malloc(instance_ext_count * sizeof(VkExtensionProperties));
//Get the list of extensions
vkEnumerateInstanceExtensionProperties(NULL, &instance_ext_count, instance_exts_ptr);

Where instance_exts_ptr is a pointer to an array of VkExtensionProperties structures that contain extension names.

Device Extensions

To determine the Vulkan SC device extensions that your Jetson Linux supports, use the following code:

uint32_t device_ext_count = 0;
VkExtensionProperties *device_exts_ptr = NULL;

//Get the number of extensions
vkEnumerateDeviceExtensionProperties(physDevice, NULL, &device_ext_count, NULL);
device_exts_ptr = (VkExtensionProperties*) malloc(device_ext_count * sizeof(VkExtensionProperties));
//Get the list of extensions
vkEnumerateDeviceExtensionProperties(physDevice, NULL, &device_ext_count, device_exts_ptr);

Where physDevice is the VkPhysicalDevice that will be queried and device_exts_ptr is a pointer to an array of VkExtensionProperties structures that contain extension names.

To determine the supported features and extensions of your device, run the third-party vulkanscinfo sample application that is provided with the Jetson Linux. Refer to Vulkan SC samples for more information about using the vulkanscinfo command.

Window System

Vulkan SC does not support Vulkan Window System Integration (WSI) Layers. However, as an alternative solution to display the results, Vulkan SC supports interop with OpenWFD by using NvSci extensions (VK_NV_external_memory_sci_buf and VK_NV_external_sci_sync2). Refer to Vulkan SC samples for example usages.

Vulkan SC Loader

Vulkan SC applications can interact with Vulkan SC drivers through the loader. The loader is responsible for supporting multiple GPUs and their drivers. To support the latest Vulkan SC API version, the loader version must match the API version.

The source for the Vulkan SC loader is not yet public, so Jetson Linux provides a prebuilt version of the Vulkan SC loader, and its source, until the loader is publicly available.

The Vulkan SC loader is installed at following locations:

  • JSON file - /etc/vulkansc/icd.d/nvidia_icd_vksc.json

  • Source - /usr/src/nvidia/vulkan-sc/vulkan-sc-ecosystem/vulkan-sc-loader

  • Binary - /usr/lib/aarch64-linux-gnu/tegra/libvulkansc.so.1.0.10

Vulkan SC Validation Layer

The loader also supports the Vulkan SC validation layer, which are optional components that augment the Vulkan SC system. Layers can intercept, evaluate, and modify existing Vulkan SC functions on their way from the application to the hardware. Layers are a critical component of developing correct Vulkan SC applications.

The source for the Vulkan SC validation layer is not yet public, so Jetson Linux provides a prebuilt version of the Vulkan SC validation layer, and its source, until the loader is publicly available.

The Vulkan SC validation layer is installed at following locations:

  • JSON - /etc/vulkansc/icd.d/VkSCLayer_khronos_validation.json

  • Source - /usr/src/nvidia/vulkan-sc/vulkan-sc-ecosystem/vulkan-sc-layers/validation_layers/

  • Binary - /usr/lib/aarch64-linux-gnu/tegra/libVkSCLayer_khronos_validation.so

The Vulkan SC validation layer in the current form are not fully functional and currently only provide parameter validation checks.

Vulkan SC Pipeline Cache Compiler (PCC) Tool

Safety critical applications cannot perform online pipeline compilation. As a result, to running pipeline compilation offline and provide the output at runtime, Vulkan SC uses a Pipeline Cache Compiler (PCC) tool that is provided with each installable client driver that implements Vulkan SC.

PCC tool requires the input that represents the pipeline state in JSON format, the schema for the input JSON file is outlined at JSON schema.

In order to easily generate the input JSON files, it is recommended to use the JSON generation layer, which is a new Vulkan layer for use with a Vulkan application to generate input for the PCC tool to create a pipeline cache. The source for the Vulkan SC loader is not yet public, so Jetson Linux provides a prebuilt version of the Vulkan SC loader, and its source, until the loader is publicly available. JSON generation layer is installed at following locations:

  • JSON file - VkLayer_json_gen.json

  • Source - /usr/src/nvidia/vulkan-sc/vulkan-sc-ecosystem/vulkan-sc-layers/json_generation_layers/

  • Binary - /usr/lib/aarch64-linux-gnu/tegra/libVkLayer_json_gen.so

The basic workflow of the JSON generator layer is outlined in slide 10 here.

Here are the steps for general usage:

  1. Follow the standard procedure for enabling Vulkan layers.

    1. Set the VK_ICD_FILENAMES environment variable to the location of VkLayer_json_gen.json.

    2. Enable the layer in your application.

      For more information about enabling the layer in your application, see Layers Overview and Configuration.

  2. Set the VK_JSON_FILE_PATH environment variable to a path where you want to create the JSON file.

  3. Use the offline JSON file generated from step 2 as input to the PCC tool provided under /usr/bin/pcc and output a pipeline cache binary. The PCC tool supports the following arguments:

    • -path: The path where the JSON files are located. The tool parses all JSON files in a given path.

    • -chip <target>: The target chip architecture to which the binaries will be compiled. Specify gv11b for a Xavier board and ga10b for an Orin board.

    • -out: The output binary name.

    • -help: Display the help options.

    • -hex: Get hex dump to embed the output pipeline cache data in C/C++ code directly.

Refer to steps 1 and 4 in Vulkan SC samples for more information about using the PCC tool and examples.

Vulkan SC Packages

Jetson Linux provides four packages for driver, SDK, development tools and samples:

  • nvidia-l4t-vulkan-sc

    This package includes the Vulkan SC driver (libnvidia-vksc-core.so)

  • nvidia-l4t-vulkan-sc-dev

    This package includes the Vulkan SC headers that are installed at /usr/include/VulkanSC/vulkan/ and PCC tool.

  • nvidia-l4t-vulkan-sc-sdk

    This package includes the prebuilt binaries and sources for Vulkan SC loader, Vulkan SC layers.

  • nvidia-l4t-vulkan-sc-samples

    This packages includes the prebuilt binaries and sources for Vulkan SC samples.