This shows you the differences between two versions of the page.
|
rasb:lab:08 [2026/06/19 10:44] vlad.radulescu2901 [5. Files used in this lab] |
rasb:lab:08 [2026/07/08 19:29] (current) vlad.radulescu2901 [Manual Install] |
||
|---|---|---|---|
| Line 875: | Line 875: | ||
| If `NUM_ENVS=2000` causes an OOM kill, reduce the number of environments or increase the requested memory in the SLURM script. | If `NUM_ENVS=2000` causes an OOM kill, reduce the number of environments or increase the requested memory in the SLURM script. | ||
| + | |||
| + | |||
| + | |||
| + | =====Manual Install===== | ||
| + | https://developer.nvidia.com/isaac-gym/download | ||
| + | |||
| + | <code> | ||
| + | #!/bin/bash | ||
| + | #SBATCH --job-name=lab8_setup | ||
| + | #SBATCH --partition=dgxa100 | ||
| + | #SBATCH --gres=gpu:1 | ||
| + | #SBATCH --cpus-per-task=8 | ||
| + | #SBATCH --mem=32G | ||
| + | #SBATCH --time=02:00:00 | ||
| + | #SBATCH --output=lab8_setup_%j.out | ||
| + | #SBATCH --error=lab8_setup_%j.err | ||
| + | |||
| + | set -e | ||
| + | |||
| + | LAB_DIR="$HOME/pupper_lab8" | ||
| + | mkdir -p "$LAB_DIR" | ||
| + | cd "$LAB_DIR" | ||
| + | |||
| + | echo "LAB_DIR=$LAB_DIR" | ||
| + | |||
| + | echo "1. Check Apptainer image" | ||
| + | if [ ! -f pytorch_isaacgym.sif ]; then | ||
| + | echo "pytorch_isaacgym.sif not found." | ||
| + | echo "Pulling base PyTorch image..." | ||
| + | apptainer pull pytorch_isaacgym.sif docker://pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime | ||
| + | else | ||
| + | echo "pytorch_isaacgym.sif already exists." | ||
| + | fi | ||
| + | |||
| + | echo "2. Check Isaac Gym package" | ||
| + | if [ ! -f IsaacGym_Preview_4_Package.tar.gz ]; then | ||
| + | echo "ERROR: IsaacGym_Preview_4_Package.tar.gz is missing." | ||
| + | echo "The instructor must upload it manually to $LAB_DIR." | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | if [ ! -d isaacgym ]; then | ||
| + | echo "Extracting Isaac Gym..." | ||
| + | tar -xzf IsaacGym_Preview_4_Package.tar.gz | ||
| + | else | ||
| + | echo "isaacgym folder already exists." | ||
| + | fi | ||
| + | |||
| + | echo "3. Clone rsl_rl if missing" | ||
| + | if [ ! -d rsl_rl ]; then | ||
| + | git clone https://github.com/leggedrobotics/rsl_rl.git | ||
| + | else | ||
| + | echo "rsl_rl already exists." | ||
| + | fi | ||
| + | |||
| + | echo "4. Clone leggedgym if missing" | ||
| + | if [ ! -d leggedgym ]; then | ||
| + | git clone https://github.com/cs123-stanford/leggedgym.git | ||
| + | else | ||
| + | echo "leggedgym already exists." | ||
| + | fi | ||
| + | |||
| + | echo "5. Install Python packages inside Apptainer user base" | ||
| + | |||
| + | export PYTHONUSERBASE="$LAB_DIR/pyuser_isaac" | ||
| + | export PATH="$PYTHONUSERBASE/bin:$PATH" | ||
| + | export PYTHONPATH="$PYTHONUSERBASE/lib/python3.7/site-packages:${PYTHONPATH:-}" | ||
| + | |||
| + | apptainer exec --nv pytorch_isaacgym.sif bash -lc " | ||
| + | set -e | ||
| + | cd $LAB_DIR | ||
| + | |||
| + | export PYTHONUSERBASE=$PYTHONUSERBASE | ||
| + | export PATH=$PATH | ||
| + | export PYTHONPATH=$PYTHONPATH | ||
| + | |||
| + | python -m pip install --user --upgrade pip | ||
| + | |||
| + | python -m pip install --user -e isaacgym/python | ||
| + | python -m pip install --user -e rsl_rl | ||
| + | python -m pip install --user -e leggedgym | ||
| + | |||
| + | python - <<'PY' | ||
| + | import isaacgym | ||
| + | import torch | ||
| + | import rsl_rl | ||
| + | import legged_gym | ||
| + | |||
| + | print('isaacgym OK') | ||
| + | print('torch', torch.__version__) | ||
| + | print('cuda available', torch.cuda.is_available()) | ||
| + | print('rsl_rl OK') | ||
| + | print('legged_gym OK') | ||
| + | PY | ||
| + | " | ||
| + | |||
| + | echo "Lab 8 setup finished successfully." | ||
| + | |||
| + | </code> | ||