Module 13 · Lesson 83 of 98

L4T base images and device mapping

Choose a Jetson container image, inspect how device nodes and libraries become visible, and run NVIDIA’s deviceQuery sample on an Orin.

  • Beginner to advanced
  • 6 min read
  • 28 min lab
What you will need

A Jetson Orin running JetPack with Docker and NVIDIA Container Toolkit configured, a compatible l4t-cuda development image with CMake and a build tool, and a local checkout of NVIDIA CUDA Samples compatible with that toolkit. Ubuntu 24.04 can be used for the shell-only warm-up.

Your place in the module
By the end you can 4 objectives
  • Identify the host Jetson Linux release and select a compatible ARM64 image
  • Distinguish the contents of l4t-base, l4t-cuda, and l4t-jetpack images
  • Inspect the GPU device nodes and CUDA libraries visible inside a container
  • Build and run deviceQuery inside a compatible Jetson container
Video coming soonL4T base images and device mapping
The video for this lesson is being recorded. Read the lesson below in the meantime.
Recall first from Why containers and how the GPU gets injected
  • An image digest identifies a fixed image or image index, while a tag can move.
  • Containers can isolate application dependencies while sharing the host kernel and GPU driver.
  • NVIDIA Container Toolkit makes selected GPU devices and required driver-side resources available at launch.
01

Choose an image for the Orin

3 min read

You have the toolkit. This lesson answers which L4T base images exist and how device nodes and CUDA libraries enter the container.

A CUDA program may work on the Orin host while a shell in a freshly started container cannot run it. The executable needs its shared libraries in the container’s filesystem view, and CUDA needs access to the GPU through the host driver. Linux mount namespaces let the host and container see different files at the same path. That is why checking what the host can see is only the first step. mount_namespaces(7): isolation of mount points

L4T stands for Linux for Tegra. NVIDIA’s Jetson Linux distribution provides the host kernel and drivers, and JetPack supplies the associated SDK components. NVIDIA publishes several Jetson image families at nvcr.io, the NVIDIA NGC container registry. Each name describes a different set of files available to your program.

Image family What to look for
nvcr.io/nvidia/l4t-base A Jetson Linux userspace base. Release-specific runtime mounts can supply additional files from the board. Check the tag before assuming it includes CUDA development tools.
nvcr.io/nvidia/l4t-cuda A Jetson CUDA image. A runtime variant serves prebuilt CUDA programs, while a development variant supplies nvcc and CUDA headers for building them.
nvcr.io/nvidia/l4t-jetpack A broader JetPack SDK image. Use the tag’s contents to check for components such as CUDA, cuDNN, TensorRT, and development tools.

Start on the Orin host by reading its architecture and Jetson Linux release. Also check whether the Docker daemon lists the NVIDIA runtime.

bash
uname -m
head -n 1 /etc/nv_tegra_release
docker info --format '{{json .Runtimes}}'

The architecture on a native Orin installation is aarch64, which container platforms describe as linux/arm64. The release file names the L4T release and revision. This is the release to compare with the image tag’s compatibility information. The container may use a different Ubuntu userspace from the machine you use to read the lesson or connect to the board. A shell launched in the container uses the image’s userspace and the Orin host’s kernel.

A specific tag identifies what NVIDIA published. Some tags encode an L4T release, while CUDA image tags can encode a CUDA version and an image variant. Check the compatibility information for the exact tag, since a CUDA version alone does not identify the Jetson Linux releases that can run it. Once you have a working selection, record the board release and full image reference together so another person can repeat the same run.

Choose a Jetson imageRead hostreleaseJetsonLinuxrelease andrevisionCheck tag compatibilityConfirmJetsonLinux andARM64supportSelectdevelopmentvariantCompilerand CUDAheadersRecordimagereferenceRegistry,family, andtagRead hostreleaseJetsonLinuxrelease andrevisionCheck tag compatibilityConfirmJetsonLinux andARM64supportSelectdevelopmentvariantCompilerand CUDAheadersRecordimagereferenceRegistry,family, andtag
Start with the board release, then check the image family and exact tag against the work you need to do.
02

Trace the device nodes and CUDA libraries

3 min read

A When the container starts with NVIDIA support, the runtime can expose the device nodes selected for that platform and setup. Names on Jetson can include entries under /dev beginning with nvidia or nvhost, depending on the release and driver. A list copied from a discrete-GPU workstation gives you little information about the nodes your Orin actually needs. Inspect the board and the running container to see which names are present.

Device access and library visibility solve different problems. The exposed nodes let the process communicate with the running host driver. CUDA also needs user-space libraries. The NVIDIA runtime can make selected host files visible inside the container through bind mounts, including driver-facing files such as libcuda.so.1 where the setup supplies it that way. A bind mount exposes a file at a path in the container’s mount namespace. Toolkit libraries such as the shared CUDA runtime, libcudart, can come from the image. Which files are mounted from the host depends on the Jetson release, image, and runtime configuration. mount(8): bind mounts and mount options

CUDA access from a Jetson containerCUDA programRuns inside the containerUser-space librariesImage files and runtime mountsExposed device nodesVisible under container /devHost kernel driverHandles GPU requestsOrin GPUCUDA programRuns inside the containerUser-space librariesImage files and runtimemountsExposed device nodesVisible under container /devHost kernel driverHandles GPU requestsOrin GPU
The CUDA program loads user-space libraries and reaches the host driver through the device nodes available to it.

--runtime=nvidia explicitly selects the NVIDIA container runtime configured in Docker. Use it for the Jetson commands in this lesson. --gpus all is Docker’s request to expose all available GPUs through a supported GPU integration. On Jetson setups that use the NVIDIA runtime’s CSV mode, where host files and devices are described in CSV files, selecting the NVIDIA runtime explicitly matters. Using --gpus all by itself can fail on such a setup. Follow the launch options for your board’s configuration and inspect what the container actually receives.

Set JETSON_IMAGE in the Orin shell to the full, compatible l4t-cuda development image reference, including its tag. Then use the same inspection on the host and in the container:

bash
: "${JETSON_IMAGE:?Set JETSON_IMAGE to your full tagged image reference}"
probe='
find /dev -maxdepth 1 -type c \( -name "nvidia*" -o -name "nvhost*" \) -print | sort
ldconfig -p | grep -E "libcuda\.so\.1|libcudart\.so" || true
'
sh -c "$probe"
docker run --rm --runtime=nvidia "$JETSON_IMAGE" sh -c "$probe"

The first command in the probe lists matching character devices at the top level of /dev. The second searches the dynamic linker’s cache for library names. A match gives you a path to inspect. Libraries outside the cache can still be found through other loader search paths, and an executable can link some code statically. An empty libcudart cache search therefore leaves the source of the CUDA runtime unresolved. Compare the listings as clues, then check what a real CUDA program can do. ld.so(8): the dynamic linker and loader

03

Verify CUDA with deviceQuery

2 min read

NVIDIA’s deviceQuery sample calls CUDA to enumerate devices and read their properties. A successful run is stronger evidence than a device listing because CUDA has actually communicated with the driver. It verifies device discovery and property queries. A sample that launches a kernel and checks its result would test computation as well.

Use a local checkout of NVIDIA CUDA Samples whose release matches the image’s toolkit and whose Samples/1_Utilities/deviceQuery directory uses CMake. Set CUDA_SAMPLES_DIR on the Orin to the absolute path to that checkout. The Docker command below mounts the source read-only at /samples. The compiler writes its files under /tmp/devicequery-build inside the container, so the host checkout stays clean. The sample runs before --rm removes the container and its build directory.

bash
: "${JETSON_IMAGE:?Set JETSON_IMAGE to your full tagged image reference}"
: "${CUDA_SAMPLES_DIR:?Set CUDA_SAMPLES_DIR to the absolute checkout path}"
docker run --rm --runtime=nvidia \
  --mount "type=bind,src=${CUDA_SAMPLES_DIR},dst=/samples,readonly" \
  "$JETSON_IMAGE" bash -euc '
    command -v nvcc
    command -v cmake
    cmake -S /samples/Samples/1_Utilities/deviceQuery \
          -B /tmp/devicequery-build
    cmake --build /tmp/devicequery-build
    /tmp/devicequery-build/deviceQuery
  '

This run assumes nvcc is on PATH and the image has CMake, a build tool, and the host compiler required by nvcc. The two command -v checks identify missing commands before configuration. If CMake cannot find the source directory, confirm that the mounted path is the checkout root and that the sample release uses the stated layout. A CMake compiler error points to the build environment. A shared library error after a successful build points to executable startup. A CUDA initialization or device discovery error means the executable ran far enough to call CUDA, so revisit the runtime selection and host-image compatibility.

On a successful run, record the detected GPU name, the sample’s pass result, and the exit status. Run echo "$?" immediately after the Docker command to read that status. The reported hardware and version values depend on the board and image. Keep the full image reference with those observations so a later run can reproduce the conditions you tested.

Build and run deviceQueryMountsamplesourceRead-onlycheckoutConfiguresampleLocatecompilerand buildtoolsBuildexecutableWrite intocontainertemporarystorageQuery CUDAdeviceRead devicepropertiesMountsamplesourceRead-onlycheckoutConfiguresampleLocatecompilerand buildtoolsBuildexecutableWrite intocontainertemporarystorageQuery CUDAdeviceRead deviceproperties
The point at which deviceQuery stops tells you whether to inspect the source mount, build tools, loader, or GPU access.

In Building a CUDA image and pulling from NGC, you’ll use the compatible image and working launch configuration to package a CUDA program and retrieve an image by its registry reference.

Key takeaways

  • An L4T image tag must be compatible with the Jetson Linux release running on the host
  • The host kernel handles GPU requests through the device nodes made available to the container
  • The image and NVIDIA runtime can supply different CUDA libraries
  • A successful deviceQuery run verifies CUDA device discovery and property queries
Reflect
  1. Explain to a colleague, in two sentences: identify the host Jetson Linux release and select a compatible ARM64 image
  2. Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
  3. What surprised you when you ran the commands yourself?
On a real board

Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.

References and further reading

Find your next step

↑ ↓ to move · Enter to open · Esc to close