From 16f26dfc0dc6c91344d6a91b9b117d3b511dfd1e Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Sun, 31 Mar 2024 19:13:18 +0000 Subject: [PATCH] sim --- sim/scripts/install_isaac_dependencies.sh | 68 +++++++++++++++++++++++ sim/scripts/run_headless.sh | 14 +++++ sim/scripts/setup_isaac.sh | 40 ------------- 3 files changed, 82 insertions(+), 40 deletions(-) create mode 100755 sim/scripts/install_isaac_dependencies.sh create mode 100755 sim/scripts/run_headless.sh delete mode 100644 sim/scripts/setup_isaac.sh diff --git a/sim/scripts/install_isaac_dependencies.sh b/sim/scripts/install_isaac_dependencies.sh new file mode 100755 index 00000000..891d5b04 --- /dev/null +++ b/sim/scripts/install_isaac_dependencies.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Script to set up Isaac Sim on a cluster. +# This script was adapted from here: +# https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_container.html + +set -e + +# Create a directory for installation artifacts. +build_dir=$(pwd)build/sim/ +mkdir -p ${build_dir} + +showmsg() { + echo -e "\e[1;32m$1\e[0m" +} + +showmsg "Updating and installing dependencies..." +sudo apt-get update +sudo apt install build-essential -y + +# Install NVIDIA drivers. This shouldn't be necessary since the cluster +# already has NVIDIA drivers installed. +# if [[ ! -f ${build_dir}/NVIDIA-Linux-x86_64-525.85.05.run ]]; then +# showmsg "Downloading NVIDIA drivers..." +# wget https://us.download.nvidia.com/XFree86/Linux-x86_64/525.85.05/NVIDIA-Linux-x86_64-525.85.05.run -P ${build_dir} +# chmod +x ${build_dir}/NVIDIA-Linux-x86_64-525.85.05.run +# sudo ${build_dir}/NVIDIA-Linux-x86_64-525.85.05.run +# fi + +# Docker installation using the convenience script +if [[ ! -f /usr/bin/docker ]]; then + showmsg "Installing Docker..." + curl -fsSL https://get.docker.com -o ${build_dir}get-docker.sh + sudo sh ${build_dir}get-docker.sh + + showmsg "Post-install steps for Docker..." + sudo groupadd docker + sudo usermod -aG docker $USER + newgrp docker + + showmsg "Verifying Docker installation..." + docker run hello-world +fi + +# Configure the repository +if [[ ! -f /etc/apt/sources.list.d/nvidia-container-toolkit.list ]]; then + showmsg "Configuring the NVIDIA Container Toolkit repository..." + if [[ ! -f /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg ]]; then + curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \ + sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg + fi + 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 + + showmsg "Updating the package list..." + sudo apt-get update + + showmsg "Installing NVIDIA Container Toolkit..." + sudo apt-get install -y nvidia-container-toolkit + sudo systemctl restart docker +fi + +showmsg "Verifying NVIDIA Container Toolkit..." +docker run --rm --gpus all ubuntu nvidia-smi + +showmsg "Installing NVIDIA Container Runtime..." +docker login nvcr.io +docker pull nvcr.io/nvidia/isaac-sim:2023.1.1 diff --git a/sim/scripts/run_headless.sh b/sim/scripts/run_headless.sh new file mode 100755 index 00000000..bbcd567e --- /dev/null +++ b/sim/scripts/run_headless.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Runs Isaac in headless mode. + +docker run --name isaac-sim --entrypoint bash -it --gpus all -e "ACCEPT_EULA=Y" --rm --network=host \ + -e "PRIVACY_CONSENT=Y" \ + -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 \ + nvcr.io/nvidia/isaac-sim:2023.1.1 diff --git a/sim/scripts/setup_isaac.sh b/sim/scripts/setup_isaac.sh deleted file mode 100644 index 0620e25d..00000000 --- a/sim/scripts/setup_isaac.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Script to set up Isaac Sim on a cluster. -# This script was adapted from here: -# https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_container.html - -# Run updates and install dependencies. -sudo apt-get update -sudo apt install build-essential -y - -# Install NVIDIA drivers. -wget https://us.download.nvidia.com/XFree86/Linux-x86_64/525.85.05/NVIDIA-Linux-x86_64-525.85.05.run -chmod +x NVIDIA-Linux-x86_64-525.85.05.run -sudo ./NVIDIA-Linux-x86_64-525.85.05.run - -# Docker installation using the convenience script -curl -fsSL https://get.docker.com -o get-docker.sh -sudo sh get-docker.sh - -# Post-install steps for Docker -sudo groupadd docker -sudo usermod -aG docker $USER -newgrp docker - -# Verify Docker -docker run hello-world - -# 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 - -# Verify NVIDIA Container Toolkit -docker run --rm --gpus all ubuntu nvidia-smi