Skip to content

Run NVIDIA Isaac Sim in a Docker container with ROS2 Humble and ROS2 bridge already set up.

License

Notifications You must be signed in to change notification settings

arambarricalvoj/nvidia_isaac-sim_ros2_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvidia_isaac-sim_ros2_docker

Run NVIDIA Isaac Sim in a Docker container with ROS2 Humble and ROS2 bridge already set up.

I work with Ubuntu 24.04.1 LTS and I found that NVIDIA Isaac Sim isn't running on it yet. Thus, I had to dockerize it over an ubuntu 22.04 image. Furthermore, I wanted to build an image with ROS2 Humble installed and the ROS2 bridge for Isaac Sim too.

Consequently, I share the Dockerfile in this repository. I hope it helps you!

In order to build the image, you can either follow the steps manually or run the bash script build.sh. Make sure to meet all the prerrequisites.
In order to run the container, you can run it manually as shown below or run the bash script run.sh.

Specifications

This repository has been run with the following host specifications:

OS: Ubuntu 24.04.1 LTS*
RAM: 32 GB
Processor: 13th Gen Intel® Core™ i7-13650HX × 20
Graphics card: NVIDIA GeForce RTX 4060 Laptop GPU
Graphics card memory: 8 GB
Needed disk space: 22 GB

*It should work in previous releases as 20.04 and 22.04.

Prerequisites

nvidia-smi
  • Docker installation and executing without sudo:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Post-install steps for Docker
sudo groupadd docker # Create group
sudo usermod -aG docker $USER # Add current user to docker group
newgrp docker # Log in docker group
#Verify Docker installation
docker run hello-world
  • NVIDIA Container Toolkit installation:
# Configure the repository
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \
  && \
    sudo apt-get update

# Install the NVIDIA Container Toolkit packages
sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

# Configure the container runtime
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

# Verify NVIDIA Container Toolkit
docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
docker login nvcr.io
Username: $oauthtoken
Password: <Your NGC API Key>
WARNING! Your password will be stored unencrypted in /home/username/.docker/config.json.
Configure a credential helper to remove this warning. See
credentials-store
Login Succeeded

Isaac Sim version

4.2.0

ROS2 version

ROS2 Humble Desktop

Docker version

Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:40:59 2024
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 27.3.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.7
Git commit: 41ca978
Built: Fri Sep 20 11:40:59 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.22
GitCommit: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
runc:
Version: 1.1.14
GitCommit: v1.1.14-0-g2c9f560
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Build image

docker build -t {IMAGE_NAME}:{TAG} .

Example:

docker build -t isaac_sim_ros2:4.2.0-Humble .

Run container

Allow running graphic interfaces in the container:

xhost +

Run the container with the needed configuration:

docker run --name isaac-sim --entrypoint bash -it --gpus all -e "ACCEPT_EULA=Y" --rm --network=host   -e "PRIVACY_CONSENT=Y"   -v $HOME/.Xauthority:/root/.Xauthority   -e DISPLAY   -v ~/docker/isaac-sim/cache/kit:/isaac-sim/kit/cache:rw   -v ~/docker/isaac-sim/cache/ov:/root/.cache/ov:rw   -v ~/docker/isaac-sim/cache/pip:/root/.cache/pip:rw   -v ~/docker/isaac-sim/cache/glcache:/root/.cache/nvidia/GLCache:rw   -v ~/docker/isaac-sim/cache/computecache:/root/.nv/ComputeCache:rw   -v ~/docker/isaac-sim/logs:/root/.nvidia-omniverse/logs:rw   -v ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw   -v ~/docker/isaac-sim/documents:/root/Documents:rw   isaac_sim_ros2:4.2.0-Humble

REMEMBER: if you want to share a folder between the host and the container, mount it adding the next flag to the previous command:

-v HOST_PATH:PATH_IN_CONTAINER
-v ~/Documents/isaac_sim/PROJECT_ID:~/PROJECT_ID

Run Isaac Sim inside the container

If this command is included when running the container, ROS2 bridge will fail. That's because the container with ROS2 packages must be started first, and then Isaac Sim. Once the container is running, type next line in the container:

./runapp.sh

Wait until Isaac Sim is completely loaded. Ignore "not responding" messages, it will take some time, so be patient ;).

Build and run with bash scripts

Add execution permissions:

chmod u+x build.sh run.sh

Build:

./build.sh

Run:

./run.sh

Bibliography

https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_container.html

https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/Documentation/Isaac-Sim-Docs_2022.2.1/isaacsim/latest/install_ros.html

https://catalog.ngc.nvidia.com/orgs/nvidia/containers/isaac-sim

https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles

About

Run NVIDIA Isaac Sim in a Docker container with ROS2 Humble and ROS2 bridge already set up.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published