Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions tools/env_setup/install_cosmos_transfer1.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ set -e
# Assuming this script is in tools/env_setup/
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"

# Source utility functions
source "$PROJECT_ROOT/tools/env_setup/bash_utils.sh"
# Allow setting the python in PYTHON_EXECUTABLE
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE:-python}

check_project_root
check_conda_env
# Install cuDNN
bash "$PROJECT_ROOT/tools/env_setup/install_cudnn.sh"

conda install -c conda-forge ninja libgl ffmpeg gcc=12.4.0 gxx=12.4.0 -y

COSMOS_TRANSFER_DIR="$PROJECT_ROOT/third_party/cosmos-transfer1"
COSMOS_TRANSFER_DIR=${1:-$$PROJECT_ROOT/third_party/cosmos-transfer1}

if [ -d "$COSMOS_TRANSFER_DIR" ]; then
echo "Cosmos Transfer directory already exists at $COSMOS_TRANSFER_DIR. Skipping clone."
Expand All @@ -41,13 +39,11 @@ fi
pushd "$COSMOS_TRANSFER_DIR"
git checkout bf54a70a8c44d615620728c493ee26b4376ccfd6
git submodule update --init --recursive
pip install -r requirements.txt
# Patch Transformer engine linking issues in conda environments.
ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/nvidia/*/include/* $CONDA_PREFIX/include/
ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/nvidia/*/include/* $CONDA_PREFIX/include/python3.10
pip install transformer-engine[pytorch]==1.12.0
$PYTHON_EXECUTABLE -m pip install -r requirements.txt
MAX_JOBS=2 $PYTHON_EXECUTABLE -m pip install transformer-engine[pytorch]==1.12.0
$PYTHON_EXECUTABLE -m pip install tensorstore==0.1.74

CUDA_HOME=$CONDA_PREFIX PYTHONPATH=$(pwd) python scripts/test_environment.py
$PYTHON_EXECUTABLE scripts/test_environment.py
popd

echo "Cosmos Transfer Dependencies Installation Finished"
63 changes: 63 additions & 0 deletions tools/env_setup/install_cudnn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

# Check if CUDNN_PATH and CUDNN_INCLUDE_PATH are set. If so, skip the installation.
if [ -d "$CUDNN_PATH" ] && [ -d "$CUDNN_INCLUDE_PATH" ]; then
echo "CUDNN_PATH and CUDNN_INCLUDE_PATH are set. Skipping CUDNN installation."
exit 0
fi

# Check if CUDA_HOME is set. If not, set it to /usr/local/cuda.
if [ -z "$CUDA_HOME" ]; then
echo "CUDA_HOME is not set. Setting it to /usr/local/cuda."
export CUDA_HOME=/usr/local/cuda
fi

# Get the cuDNN version and see if it is 8.9.7. If it is, skip the installation.
if [ -f "$CUDA_HOME/include/cudnn_version.h" ]; then
CUDNN_VERSION="$(grep -oP '#define CUDNN_MAJOR \K\d+' $CUDA_HOME/include/cudnn_version.h).$(grep -oP '#define CUDNN_MINOR \K\d+' $CUDA_HOME/include/cudnn_version.h).$(grep -oP '#define CUDNN_PATCHLEVEL \K\d+' $CUDA_HOME/include/cudnn_version.h)"
if [ "$CUDNN_VERSION" == "8.9.7" ]; then
echo "cuDNN version is 8.9.7. Skipping CUDNN installation."
exit 0
fi
fi


# Install CUDNN
echo "Install cuDNN 8.9.7..."

mkdir -p /tmp/cudnn

wget https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz \
-O /tmp/cudnn/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
tar -xvf /tmp/cudnn/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz -C /tmp/cudnn/

if [ "$EUID" -ne 0 ]; then
sudo cp /tmp/cudnn/cudnn-linux-x86_64-8.9.7.29_cuda12-archive/lib/libcudnn* $CUDA_HOME/lib64/
sudo cp /tmp/cudnn/cudnn-linux-x86_64-8.9.7.29_cuda12-archive/include/cudnn*.h $CUDA_HOME/include/
sudo ldconfig $CUDA_HOME/lib64
else
cp /tmp/cudnn/cudnn-linux-x86_64-8.9.7.29_cuda12-archive/lib/libcudnn* $CUDA_HOME/lib64/
cp /tmp/cudnn/cudnn-linux-x86_64-8.9.7.29_cuda12-archive/include/cudnn*.h $CUDA_HOME/include/
ldconfig $CUDA_HOME/lib64
fi

rm -rf /tmp/cudnn

echo "cuDNN is installed to $CUDA_HOME/lib64 and headers are in $CUDA_HOME/include"
15 changes: 7 additions & 8 deletions tools/env_setup/install_holoscan.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ set -e
# Assuming this script is in tools/env_setup/
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"

# Assuming bash_utils.sh is in $PROJECT_ROOT/tools/env_setup/bash_utils.sh
source "$PROJECT_ROOT/tools/env_setup/bash_utils.sh"
# Allow setting the python in PYTHON_EXECUTABLE
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE:-python}

check_project_root
check_conda_env
HOLOSCAN_DIR=${1:-$PROJECT_ROOT/workflows/robotic_ultrasound/scripts/holoscan_apps/}

conda install -c conda-forge gcc=13.3.0 -y
pip install holoscan==2.9.0

HOLOSCAN_DIR=$PROJECT_ROOT/workflows/robotic_ultrasound/scripts/holoscan_apps/
# ---- Install Holoscan ----
$PYTHON_EXECUTABLE -m pip install holoscan==2.9.0
echo "Holoscan installed successfully!"

# ---- Install Holoscan Apps ----
echo "Building Holoscan Apps..."
pushd $HOLOSCAN_DIR

Expand Down
4 changes: 0 additions & 4 deletions tools/env_setup/install_isaac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,4 @@ echo "Installing IsaacLab ..."
yes Yes | ./isaaclab.sh --install
popd

# ---- Install libstdcxx-ng for mesa ----
echo "Installing libstdcxx-ng..."
conda install -c conda-forge libstdcxx-ng=13.2.0 -y

echo "IsaacSim and dependencies installed successfully!"
8 changes: 7 additions & 1 deletion tools/env_setup_robot_us.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ if [[ "$INSTALL_WITH_POLICY" == "gr00tn1" ]]; then
fi


# for holoscan and cosmos transfer1, we need to install the following conda packages:
conda install -c conda-forge ninja libgl ffmpeg pybind11 gcc=12.4.0 gxx=12.4.0 libstdcxx-ng=12.4.0 -y


# ---- Install Holoscan (Common) ----
echo "Installing Holoscan..."
bash "$PROJECT_ROOT/tools/env_setup/install_holoscan.sh"

# ---- Install Cosmos (Common) ----
echo "Installing Cosmos..."
bash "$PROJECT_ROOT/tools/env_setup/install_cosmos_transfer1.sh"

echo "=========================================="
echo "Environment setup script finished."
echo "Selected policy dependencies ($INSTALL_WITH_POLICY) should be installed along with base components."
echo "=========================================="
2 changes: 1 addition & 1 deletion workflows/robotic_ultrasound/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The main script `tools/env_setup_robot_us.sh` installs all necessary dependencie
The script supports installing additional policy-specific dependencies using the `--policy` flag:
- **`--policy pi0` (Default)**: Installs PI0 policy dependencies (e.g., OpenPI)
- **`--policy gr00tn1`**: Installs GR00T N1 policy dependencies (e.g., Isaac-GR00T)
- **`--policy base`**: Installs only common base dependencies
- **`--policy none`**: Installs only common base dependencies

Run the script from the repository root:
```bash
Expand Down
Loading