Build with Docker

Prerequisites

  1. Install Docker and manage Docker as a non-root user following this tutorial.

  2. Make sure NVIDIA Driver is working.

  3. Install NVIDIA Container Toolkit and configure Docker to use the NVIDIA runtime:

sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Build Image

Build a Docker Image named realsim:cuda12.8, where all dependencies are installed and the RealSim Engine is automatically built:

docker build -t realsim:cuda12.8 .

Run Container and Test

Run this on your host (outside Docker) that allows Docker to access your X display:

xhost +local:root

You'll see something like non-network local connections being added to access control list indicating your X server is now allowing Docker containers (as root) to open display windows on your local desktop.

Run your container with GPUs and X11 forwarding (for rendering):

docker run -it --rm --gpus all \
  -e DISPLAY \
  -e XAUTHORITY=$XAUTHORITY \
  -e NVIDIA_VISIBLE_DEVICES=all \
  -e NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility \
  -e LIBGL_DRI3_DISABLE=1 \
  -v $XAUTHORITY:$XAUTHORITY \
  -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
  realsim:cuda12.8 /bin/bash

You will be located to /workspace/realsim_py directory. Run the example to test:

Last updated