This keeps coming up and even if we don't officially support it, would be good to set expectations and point people in the right direction.
At time of writing, with 0.22.1 the following works.
Install nvidia-container-runtime.
Make sure /etc/docker/daemon.json contains:
{
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
}
}
Make sure your docker image includes at least: libgtk-3-dev libxkbcommon-x11-0 vulkan-tools
Example Dockerfile for an ubuntu image.
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y python3-pip libgtk-3-dev libxkbcommon-x11-0 vulkan-tools
RUN python3 -m pip install rerun-sdk==0.22.1
Jump through all the hoops necessary for GPU access, X authentication, etc.
In particular the following two seem to be crucial:
--runtime=nvidia
-e NVIDIA_DRIVER_CAPABILITIES=all
Example run.sh script:
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
chmod 777 $XAUTH
docker run --runtime=nvidia --rm --gpus all -it --privileged --network=host -e NVIDIA_DRIVER_CAPABILITIES=all -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH rerun:0.22.1 rerun
The above Dockerfile and run script can be used by running:
docker build -t rerun:0.22.1 .
./run.sh
This keeps coming up and even if we don't officially support it, would be good to set expectations and point people in the right direction.
At time of writing, with 0.22.1 the following works.
Install
nvidia-container-runtime.Make sure
/etc/docker/daemon.jsoncontains:Make sure your docker image includes at least:
libgtk-3-dev libxkbcommon-x11-0 vulkan-toolsExample
Dockerfilefor an ubuntu image.Jump through all the hoops necessary for GPU access, X authentication, etc.
In particular the following two seem to be crucial:
--runtime=nvidia-e NVIDIA_DRIVER_CAPABILITIES=allExample
run.shscript:The above Dockerfile and run script can be used by running: