Skip to content

Commit 287a979

Browse files
committed
change base docker image with cuda support
1 parent cd0950c commit 287a979

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

docker/Dockerfile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3535
curl \
3636
&& rm -rf /var/lib/apt/lists/*
3737

38-
FROM nvidia/opengl:1.0-glvnd-runtime-ubuntu${UBUNTU_VER} as ros2nvidia
38+
FROM nvidia/cuda:12.1.0-runtime-ubuntu${UBUNTU_VER} as ros2nvidia
3939
SHELL ["/bin/bash", "-c"]
4040
ENV DEBIAN_FRONTEND=noninteractive
4141

@@ -65,13 +65,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6565
software-properties-common \
6666
wget \
6767
curl \
68-
libegl1-mesa libglu1-mesa libxv1 libxtst6 \
68+
libegl1-mesa \
69+
libglu1-mesa \
70+
libxv1 \
71+
libxtst6 \
6972
&& rm -rf /var/lib/apt/lists/*
7073

74+
# Install VirtualGL
7175
ARG VIRTUALGL_VER="3.1"
7276
RUN wget -O /tmp/virtualgl.deb https://zenlayer.dl.sourceforge.net/project/virtualgl/${VIRTUALGL_VER}/virtualgl_${VIRTUALGL_VER}_amd64.deb
7377
RUN dpkg -i /tmp/virtualgl.deb
7478

79+
# Install glvnd
80+
RUN apt-get update && apt-get install -y --no-install-recommends \
81+
libglvnd0 \
82+
libgl1 \
83+
libglx0 \
84+
libegl1 \
85+
libxext6 \
86+
libx11-6 \
87+
&& rm -rf /var/lib/apt/lists/*
88+
7589
# Install ROS2
7690
ARG USE_ROS_DISTRO=
7791
RUN add-apt-repository universe \
@@ -90,6 +104,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
90104
RUN source /opt/ros/${USE_ROS_DISTRO}/setup.bash
91105
RUN rosdep init
92106
ENV ROS_DISTRO=${USE_ROS_DISTRO}
107+
ENV NVIDIA_VISIBLE_DEVICES=all
108+
ENV NVIDIA_DRIVER_CAPABILITIES=graphics,utility,compute
109+
ENV QT_X11_NO_MITSHM=1
93110

94111
from ros2${RUNTIME} as common
95112
SHELL ["/bin/bash", "-c"]

0 commit comments

Comments
 (0)