How to Install ZED SDK with Docker on NVIDIA® Jetson

Open in ClaudeOpen in ChatGPT

Setting Up Docker

On NVIDIA® Jetson™, the NVIDIA® Container Runtime lets you build and run GPU-accelerated containers with Docker. Its support is installed with NVIDIA® JetPack™ through the nvidia-container-toolkit package.

On recent JetPack™ releases, Docker itself is not always installed by default. If the docker command is missing, install Docker first.

Check that the NVIDIA® runtime is available to Docker:

$sudo docker info | grep -i runtime
$# Runtimes: io.containerd.runc.v2 nvidia runc

Download a ZED SDK Docker Image

To build and run an application with the ZED SDK, you first need to pull a ZED SDK Docker image.

The official ZED SDK Docker images for Jetson™ are hosted in the StereoLabs DockerHub repository. Jetson releases are tagged by ZED SDK and L4T (or JetPack) version. These images extend NVIDIA®‘s L4T base images with the ZED SDK library and its dependencies.

The tag format for Jetson images is stereolabs/zed:<sdk>-<variant>-l4t-r<l4t> (or stereolabs/zed:<sdk>-<variant>-jetson-jp<jetpack>), where <variant> is runtime or devel (the py-runtime, py-devel, and tools-devel variants are also available). For example:

$# Generic form — replace the placeholders with the versions matching your board
$docker pull stereolabs/zed:<ZED_SDK_version>-runtime-l4t-r<L4T_version>
$
$# Example
$docker pull stereolabs/zed:5.4-runtime-l4t-r36.5

Not every ZED SDK release is published for every L4T version. Browse the available tags and pick the combination that matches your board.

Always make sure the L4T (Linux for Tegra) version of your host system matches the L4T version of the container you are using. You can check your host L4T version with cat /etc/nv_tegra_release or dpkg-query --show nvidia-l4t-core.

Start a Docker Container

To start a container from a ZED SDK image, use the following command:

$docker run --runtime nvidia -it --privileged stereolabs/zed:<container_tag>

The --runtime nvidia flag selects the NVIDIA® container runtime so the container can access the GPU, and --privileged grants the container access to the camera devices.

For example, replacing <container_tag> with the tag matching your host:

$docker run --runtime nvidia -it --privileged stereolabs/zed:<ZED_SDK_version>-runtime-l4t-r<L4T_version>

Congratulations, the ZED SDK is now available inside your container!

Using a ZED X / ZED X One (GMSL2) camera? The GMSL2 driver must be installed on the host Jetson™. Install the latest version by following Install the ZED Link driver or from the ZED X Camera Drivers download page. You will also need to share a few extra volumes when running the container — see Volumes.

Run the ZED Explorer Tool

To verify the installation, we are going to run the ZED Explorer tool. By default, a Docker container can only run command-line applications. On NVIDIA® Jetson™, however, OpenGL, CUDA, and TensorRT are ready to use within the l4t-base container.

To enable display output, we simply grant the container access to the X server when running it:

$xhost +si:localuser:root # allow containers to communicate with the X server
$docker run -it --runtime nvidia --privileged -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix stereolabs/zed:<container_tag>
  • --runtime nvidia selects the NVIDIA® container runtime.
  • -v /tmp/.X11-unix:/tmp/.X11-unix lets the container access the display.
  • -e DISPLAY makes your DISPLAY environment variable available inside the container.
  • <container_tag> must be replaced with the tag of the image you want to use.

You can now run any GUI application in the container. Let’s launch ZED Explorer:

$/usr/local/zed/tools/ZED_Explorer

You should now see the ZED Explorer GUI running on your display from within a Docker container!

Run a Sample Application

In this example, we will build and run the Depth Sensing sample available in the ZED SDK samples folder.

$apt update && apt install cmake -y
$cp -r /usr/local/zed/samples/depth\ sensing/ /tmp/depth-sensing
$cd /tmp/depth-sensing/cpp ; mkdir build ; cd build
$cmake .. && make
$./ZED_Depth_Sensing

Compiling on a Jetson™ board can be slow. We recommend building your image on an x86 host and running it on the Jetson™, especially for resource-constrained boards such as the NVIDIA® Jetson™ Orin™ Nano. See Creating a Docker Image for your ZED Application to get started.