How to use ZED X with Docker

In order to use the ZED X and the ZED X Mini in a Docker container, a certain number of options and volumes are required when running the container.

To run an interactive container using docker run:

docker run --runtime nvidia -it --privileged -e DISPLAY \
  --network host \
  -v /dev/:/dev/ \
  -v /tmp/:/tmp/ \
  -v /var/nvidia/nvcam/settings/:/var/nvidia/nvcam/settings/ \
  -v /etc/systemd/system/zed_x_daemon.service:/etc/systemd/system/zed_x_daemon.service \
  -v ${HOME}/zed_docker_ai/:/usr/local/zed/resources/ \
  <docker_image> sh

Note: ensure that the L4T (Linux for Tegra) version of your host system matches the L4T version of the container you are using.

Note: the ZED GMSL2 driver must be only installed on the host machine, and not in the Docker container.

Note: If you cannot open the ZED X camera in Docker, it is possible that the ZED LiGMSL2nk driver on the host is not correctly installed. You might need to install the libqt5core5a dependency if not already installed.

Use the following command before re-installing the driver:

sudo apt install libqt5core5a