Jump to content

GPU validation

From RidgeRun Developer Wiki
Yocto Documentation
Release 2026


Follow us on: YouTube Twitter LinkedIn Email Share this page

Share This Page

Preferred Partner Logo 3 Partner Program Banner



GPU validation

NVIDIA Jetson platforms integrate an NVIDIA GPU that can be used for general-purpose GPU computing, graphics, artificial intelligence, and accelerated multimedia applications.

The NVIDIA Yocto environment provides recipes for the NVIDIA GPU software stack and CUDA components, allowing GPU support to be integrated directly into a custom Yocto image.

This section describes how to verify GPU support, enable CUDA components in the image, and run basic CUDA tests on the target.

Overview

GPU support on Jetson requires several software components working together:

GPU software layers from the application through CUDA and NVIDIA drivers to Jetson GPU hardware

A working GPU configuration therefore requires more than simply having CUDA applications installed. The kernel driver, NVIDIA user-space libraries, and CUDA runtime must all be compatible with the Jetson Linux BSP used by the Yocto build.

The NVIDIA meta-tegra layer provides the recipes and platform integration required to include these components in the generated image.

Checking GPU Support in the Yocto Workspace

Before modifying the image, the available CUDA recipes can be inspected from the Yocto build environment.

Run:

bitbake-layers show-recipes "*cuda*"

This displays CUDA-related recipes available in the configured layers.

The recipes can also be inspected directly:

find layers/meta-tegra -type f -iname '*cuda*'

For example, meta-tegra provides a recipe cuda-samples_git.bb for the NVIDIA CUDA samples.

The available samples can be listed with:

find /usr/bin/cuda-samples -maxdepth 2 -type f -executable

Example output:

/usr/bin/cuda-samples/matrixMul
/usr/bin/cuda-samples/simpleMultiGPU
/usr/bin/cuda-samples/simplePrintf
/usr/bin/cuda-samples/UnifiedMemoryStreams
/usr/bin/cuda-samples/vectorAdd
...

Running a Basic CUDA Test

The vectorAdd sample provides a simple GPU validation test.

Run:

/usr/bin/cuda-samples/vectorAdd

The application allocates memory, transfers data to the GPU, executes a CUDA kernel, and verifies the resulting data.

A successful execution confirms that the basic path is working: CUDA Application -> CUDA Runtime -> NVIDIA GPU Driver -> Jetson GPU

The test should complete without CUDA runtime or device initialization errors.

Matrix Multiplication Test

Another useful test is matrixMul:

/usr/bin/cuda-samples/matrixMul

This executes matrix multiplication using CUDA.

Other recomended tests:

/usr/bin/cuda-samples/vectorAdd
/usr/bin/cuda-samples/matrixMul
/usr/bin/cuda-samples/fp16ScalarProduct
/usr/bin/cuda-samples/UnifiedMemoryPerf
/usr/bin/cuda-samples/simpleMultiCopy

A successful result provides additional confirmation that CUDA kernels can execute on the GPU.

Troubleshooting

CUDA Samples Are Not Available

If the directory:

/usr/bin/cuda-samples/

does not exist, verify that the package is included in the image:

IMAGE_INSTALL:append = " cuda-samples"

Check whether BitBake can find the recipe:

bitbake-layers show-recipes cuda-samples

CUDA Reports No Device

If a CUDA application cannot find the GPU, inspect the kernel log:

dmesg | grep -i -E 'nvidia|gpu|nvgpu'

Check the relevant kernel modules:

lsmod | grep -E 'nvidia|nvgpu'

Also verify that the CUDA runtime and NVIDIA user-space libraries included in the image correspond to the BSP release being used.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.