From 9f6217e1562ee3f3d3162849e3304fa32e87d100 Mon Sep 17 00:00:00 2001 From: JBVAkshaya Date: Wed, 16 Jul 2025 20:24:28 +0000 Subject: [PATCH 1/2] fixed no nvidia GPU access --- .devcontainer/nvidia/Dockerfile | 11 +++++++++++ .devcontainer/nvidia/devcontainer.json | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.devcontainer/nvidia/Dockerfile b/.devcontainer/nvidia/Dockerfile index 8a4daeb0..51a9158b 100644 --- a/.devcontainer/nvidia/Dockerfile +++ b/.devcontainer/nvidia/Dockerfile @@ -1,5 +1,16 @@ FROM ghcr.io/robotic-decision-making-lab/blue:jazzy-desktop-nvidia + +USER root + +# Setup ROS2 repository and update package lists +RUN rm -f /etc/apt/sources.list.d/ros2*.list || true && \ + apt-key del F42ED6FBAB17C654 || true && \ + rm -f /usr/share/keyrings/ros*-archive-keyring.gpg || true && \ + curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ + apt-get update + # Install ROS dependencies # This is done in a previous stage, but we include it again here in case anyone wants to # add new dependencies during development diff --git a/.devcontainer/nvidia/devcontainer.json b/.devcontainer/nvidia/devcontainer.json index 27f58aa6..89fd5623 100644 --- a/.devcontainer/nvidia/devcontainer.json +++ b/.devcontainer/nvidia/devcontainer.json @@ -14,6 +14,7 @@ "--privileged", "--volume=/tmp/.X11-unix:/tmp/.X11-unix", "--volume=/mnt/wslg:/mnt/wslg", + "--runtime=nvidia", "--gpus=all" ], "containerEnv": { @@ -22,7 +23,12 @@ "XDG_RUNTIME_DIR": "${localEnv:XDG_RUNTIME_DIR}", "PULSE_SERVER": "${localEnv:PULSE_SERVER}", "LIBGL_ALWAYS_SOFTWARE": "1", - "QT_X11_NO_MITSHM": "1" + "QT_X11_NO_MITSHM": "1", + "NVIDIA_VISIBLE_DEVICES": "all", + "NVIDIA_DRIVER_CAPABILITIES": "all", + "__GLX_VENDOR_LIBRARY_NAME": "nvidia", + "__NV_PRIME_RENDER_OFFLOAD": "1", + "__VK_LAYER_NV_optimus": "NVIDIA_only" }, "customizations": { "vscode": { From e32c88806176af6d47221c5b4ac652858eea2480 Mon Sep 17 00:00:00 2001 From: JBVAkshaya Date: Thu, 17 Jul 2025 01:08:17 +0000 Subject: [PATCH 2/2] added the updated ros signing key --- .devcontainer/nvidia/Dockerfile | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.devcontainer/nvidia/Dockerfile b/.devcontainer/nvidia/Dockerfile index 51a9158b..3e3c5b2c 100644 --- a/.devcontainer/nvidia/Dockerfile +++ b/.devcontainer/nvidia/Dockerfile @@ -1,26 +1,21 @@ FROM ghcr.io/robotic-decision-making-lab/blue:jazzy-desktop-nvidia - -USER root - -# Setup ROS2 repository and update package lists -RUN rm -f /etc/apt/sources.list.d/ros2*.list || true && \ - apt-key del F42ED6FBAB17C654 || true && \ - rm -f /usr/share/keyrings/ros*-archive-keyring.gpg || true && \ - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ - apt-get update - # Install ROS dependencies # This is done in a previous stage, but we include it again here in case anyone wants to # add new dependencies during development ENV USERNAME=ubuntu ENV USER_WORKSPACE=/home/$USERNAME/ws_blue +ENV USER_GID=1000 +ENV USER_UID=1000 WORKDIR $USER_WORKSPACE COPY --chown=$USER_UID:$USER_GID . src/blue + +ENV ROS2_LATEST_ARCHIVE_KEYRING="/usr/share/keyrings/ros2-latest-archive-keyring.gpg" +RUN sudo rm -f ${ROS2_LATEST_ARCHIVE_KEYRING} +RUN sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o ${ROS2_LATEST_ARCHIVE_KEYRING} + RUN sudo apt-get -q update \ - && sudo apt-get -q -y upgrade \ && rosdep update \ && rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys="gz-transport12 gz-sim7 gz-math7 gz-msgs9 gz-plugin2" \ && sudo apt-get autoremove -y \