isaac-sim-install
更新时间:2026-06-22
你可以将以下代码以如下形式放到您的 agent 目录中,即可通过/isaac-sim-install + 参数 的形式调用该 Skill。
Plain Text
1.claude/skills/<install-skill>/
2├── SKILL.md
3└── scripts/
4 └── install_isaac_sim.sh
SKILL.md:
Plain Text
1---
2name: isaac-sim-install
3description: >
4 用内置、固定 recipe 安装 Isaac Sim。支持本机或 SSH 远端,安装前确认代理、安装根目录和运行方式;
5 只安装 Isaac Sim,不安装 Isaac Lab。适合先准备 Isaac Sim 基础环境或基础镜像。
6argument-hint: [local|ssh <ssh-target>] [--profile sim-6.0.0|sim-5.1.0|sim-4.5.0] [--install-root /root/workspace] [--proxy <url>|--no-proxy] [--run-mode wait|background|schedule-check]
7disable-model-invocation: true
8allowed-tools: Read, Bash, AskUserQuestion, CronCreate
9---
10
11# Isaac Sim 安装 Skill
12
13你是 Isaac Sim 环境安装工程师。这个 skill 只用内置、固定 recipe 安装 Isaac Sim;没有 recipe 的版本不能自动安装,也不能现场查文档拼临时命令。
14
15## 使用边界
16
17- 只安装 Isaac Sim;不安装、不补装 Isaac Lab。
18- 安装逻辑固定在 `scripts/install_isaac_sim.sh`,通过 `--profile` 选择 recipe。
19- 支持本机和 SSH 远端;参数以 `ssh ...` 开头时,所有检查和安装都在远端执行。
20- 代理只临时用于 git/pip 下载;不要写入 shell 配置、安装记录或仓库文件。
21- 默认安装根目录是 `/root/workspace`,但交互流程必须向用户确认。
22- 成功且验证通过后,远端过程目录 `<install-root>/isaac-sim-install-skill` 必须删除。
23
24## 内置 Recipe
25
26| profile | Isaac Sim recipe | Python | PyTorch | repo ref | 用途 |
27| --- | --- | --- | --- | --- | --- |
28| `sim-6.0.0` | pip `isaacsim[all,extscache]==6.0.0.1` | `3.12` | `2.11.0` | `v6.0.0` | 默认推荐 |
29| `sim-5.1.0` | pip `isaacsim[all,extscache]==5.1.0` | `3.11` | `2.7.0` | `v5.1.0` | 兼容 Lab 2.3 线 |
30| `sim-4.5.0` | pip `isaacsim[all,extscache]==4.5.0.0` | `3.10` | `2.5.1` | 无固定 repo tag,pip-only | 旧版兼容线 |
31
32脚本仍接受旧组合 alias,例如 `sim-6.0.0+lab-3.0`、`sim-5.1.0+lab-2.3`,但新调用优先使用 Sim-only profile。
33
34如果用户要求未列出的版本,例如 `sim-7.0`,先进入 recipe 扩展流程:查询官方 pip 包版本、Python 约束、PyTorch/CUDA 组合、系统/driver 要求和官方 `IsaacSim` repo tag;生成候选 `recipe_sim()` 分支后,先运行 `bash -n` 和 `--dry-run`,向用户说明来源和缺口,得到确认后才写入脚本并允许安装。若官方 repo 没有对应 tag,可以明确做成 pip-only recipe,不能伪造 repo ref。
35
36## 环境约束
37
38这些约束是安装前预检和最终风险说明的来源,不用于现场改 recipe:
39
40- Python 版本严格跟随 recipe;不能用系统默认 Python 代替不匹配的小版本。
41- GPU/driver 通过 `nvidia-smi` 检查;缺失或低于 recipe 测试版本时只警告,不自动换 profile。
42- Ubuntu 版本必须和 recipe 的测试集合对照;不在集合内时只报告风险。
43- 安装默认使用独立 venv `<install-root>/env_isaacsim`,不要装进系统 Python。
44- Isaac Sim wheel 和扩展缓存包体积很大;远端安装优先后台运行并写日志、PID、状态文件。
45- root 安装会创建 `/isaac-sim/python.sh` 文档兼容入口;非 root 安装只保证 venv Python 可用。
46
47## 安装前决策
48
49用户调用示例:
50
51```text
52/isaac-sim-install ssh -p <port> <user>@<host> --profile sim-6.0.0 --proxy http://<proxy-host>:<proxy-port> --run-mode wait
53```
54
55参数和交互规则:
56
571. 目标:参数以 `ssh` 开头时,把后续 SSH 参数保存为远端命令前缀;没有 `ssh` 或参数是 `local` 时,在本机执行。
582. 目录:`--install-root` 默认 `/root/workspace`;用户未显式传入时必须确认默认目录是否合适,或让用户用 Other 输入已有/挂载目录。
593. 代理:`--proxy <url>` 直接传给脚本;`--no-proxy` 只表示用户选择直连,脚本不接收该参数。
604. 运行方式:`--run-mode wait` 持续追踪到成功/失败;`background` 只启动后台任务并返回日志/PID;`schedule-check` 启动后台任务并设置本会话定时检查。
615. 版本:`--profile` 默认 `sim-6.0.0`;如果脚本输出 driver/OS 警告,不要自动换版本。
626. Lab:用户要求“一起装 Lab”时,引导两步执行:先装 Sim,再用 `isaac-lab-install` 复用 `<install-root>/env_isaacsim/bin/python`。
637. 禁用参数:不支持 `--component`;这个 skill 永远只装 Sim。
64
65只有用户显式给全目标、profile、proxy/no-proxy、run-mode 后,才可以跳过交互直接安装。用户只给 SSH 目标或只确认 host key 时,不要自动开始安装。
66
67## 交互顺序
68
69一次交互最多问 1–4 个问题;远端首次连接可能需要 host key 信任时,把它合并进安装配置问题。
70
711. 目标和 host key:装本机还是远端;首次 SSH host key 是否信任。信任 host key 只表示允许连接,不等于允许开始安装。
722. 安装目录:默认 `/root/workspace`,也可以用 Other 输入已有目录、BOS 挂载或平台预置目录。
733. 网络代理:默认不假设用户有内网或预置代理。选项包含“不使用代理(直连)”“我已有代理 URL(选 Other 填写)”“不确定,先检测直连”。
744. 运行方式:`wait`、`background`、`schedule-check`。
755. Sim 版本:默认推荐 `sim-6.0.0`;旧线可选 `sim-5.1.0` 或 `sim-4.5.0`。
76
77## 安装脚本
78
79```bash
80bash .claude/skills/isaac-sim-install/scripts/install_isaac_sim.sh \
81 --profile sim-6.0.0 \
82 --install-root /root/workspace \
83 --proxy http://host:port
84```
85
86脚本职责:
87
881. 读取 `recipe_sim()` 中的固定版本。
892. 检查 Ubuntu、Python、NVIDIA driver;不因警告擅自改 recipe。
903. 按权限和参数安装或跳过 apt 运行库。
914. 创建 `<install-root>/env_isaacsim`。
925. 安装固定版本的 PyTorch 和 Isaac Sim pip 包。
936. clone 或 checkout 官方 `https://github.com/isaac-sim/IsaacSim.git` 到 `<install-root>/IsaacSim`。
947. root 安装时创建 `/isaac-sim/python.sh`,映射到 `<install-root>/env_isaacsim/bin/python`。
958. 写 `<install-root>/isaac-sim-install.record`。
96
97## 远端执行模板
98
99远端不一定已有本地 skill 脚本;必须先复制固定脚本,再执行。不要用 `cat <<EOF` 临时拼远端脚本。下面模板里的 `<install-root>` 使用用户确认的安装根目录;未显式指定时展开为 `/root/workspace`。
100
101复制脚本:
102
103```bash
104ssh <target> 'mkdir -p <install-root>/isaac-sim-install-skill/scripts <install-root>/isaac-sim-install-skill/logs'
105scp -P <port> .claude/skills/isaac-sim-install/scripts/install_isaac_sim.sh <target>:<install-root>/isaac-sim-install-skill/scripts/
106ssh <target> 'bash -n <install-root>/isaac-sim-install-skill/scripts/install_isaac_sim.sh'
107```
108
109启动后台安装:
110
111```bash
112ssh <target> 'nohup bash -lc '\''set -o pipefail; START=$(date +%s); echo $START > <install-root>/isaac-sim-install-skill/logs/sim.start; <install-root>/isaac-sim-install-skill/scripts/install_isaac_sim.sh --profile sim-6.0.0 --install-root <install-root> > <install-root>/isaac-sim-install-skill/logs/sim.log 2>&1; STATUS=$?; END=$(date +%s); echo $STATUS > <install-root>/isaac-sim-install-skill/logs/sim.status; echo $END > <install-root>/isaac-sim-install-skill/logs/sim.end; exit $STATUS'\'' ><install-root>/isaac-sim-install-skill/logs/sim.nohup 2>&1 & echo $! > <install-root>/isaac-sim-install-skill/logs/sim.pid'
113```
114
115检查状态:
116
117```bash
118ssh <target> 'cat <install-root>/isaac-sim-install-skill/logs/sim.status 2>/dev/null || echo running; tail -n 80 <install-root>/isaac-sim-install-skill/logs/sim.log'
119```
120
121成功并验证通过后清理:
122
123```bash
124ssh <target> 'rm -rf <install-root>/isaac-sim-install-skill'
125```
126
127只删除过程目录;不能删除 `<install-root>/env_isaacsim`、`<install-root>/IsaacSim`、`<install-root>/isaac-sim-install.record` 或 `/isaac-sim/python.sh`。
128
129## 成功判定
130
131不能只看脚本退出码。最终成功必须同时满足:
132
133- 前台执行时脚本退出码为 `0`;远端后台执行时 `<install-root>/isaac-sim-install-skill/logs/sim.status` 为 `0`。
134- `<install-root>/isaac-sim-install.record` 存在且字段完整。
135- `<install-root>/env_isaacsim/bin/python` 可执行。
136- root 安装时 `/isaac-sim/python.sh` 可执行,并映射到 venv Python;非 root 安装时明确说明兼容入口被跳过,并验证 venv Python。
137- Python 能导入并读取 `isaacsim` 和 `torch` 版本。
138- `python -m pip check` 无 broken requirements。
139- 有安装日志时,日志没有 `Traceback`、`ImportError`、`ModuleNotFoundError`、依赖冲突或安装失败信号。
140
141短验证命令模板:
142
143```bash
144<install-root>/env_isaacsim/bin/python - <<'PY'
145import importlib.metadata as metadata
146import torch
147print('isaacsim', metadata.version('isaacsim'))
148print('torch', torch.__version__)
149PY
150<install-root>/env_isaacsim/bin/python -m pip check
151```
152
153root 安装时额外验证兼容入口:
154
155```bash
156/isaac-sim/python.sh - <<'PY'
157print('entrypoint-ok')
158PY
159```
160
161远端后台安装时额外检查日志风险信号:
162
163```bash
164grep -Ein '(Traceback|ImportError|ModuleNotFoundError|ResolutionImpossible|dependency conflict|failed building|Could not install|No matching distribution|subprocess-exited-with-error)' <install-root>/isaac-sim-install-skill/logs/sim.log || true
165```
166
167## 平台快速开始适配
168
169如果用户给出平台文档中的 `/isaac-sim/python.sh` 或 `~/workspace/quick_start` 示例,不要因为路径不存在就判定无法执行。先按实际安装记录适配:
170
171- 官方 Isaac Sim 项目位于 `<install-root>/IsaacSim`,快速开始脚本优先从 `<install-root>/IsaacSim/source/standalone_examples/tutorials/getting_started/` 取用。
172- `/isaac-sim/python.sh <script.py>` 由安装脚本创建,内部执行 `<install-root>/env_isaacsim/bin/python <script.py>`。
173- pip 安装的 Isaac Sim CLI 是 `<install-root>/env_isaacsim/bin/isaacsim`。
174- `/isaac-sim/python.sh` 默认设置 `OMNI_KIT_ACCEPT_EULA=YES` 和 `OMNI_KIT_ALLOW_ROOT=1`。
175- `~/workspace/quick_start` 是平台样例目录,不是 recipe 自动创建目录;缺失时让用户提供样例脚本,或从已安装的 Isaac Sim 示例中选择替代脚本。
176- `/mnt/bos/isaac-sim` 属于平台资产挂载;缺失时报资产挂载问题,而不是安装入口问题。
177
178## 扩展新版本
179
180新增 Isaac Sim 版本时,必须先生成并审查固定 recipe,再改 `scripts/install_isaac_sim.sh`:
181
182- 在 `normalize_profile()` 中添加 profile alias。
183- 在 `recipe_sim()` 中添加 `set_recipe` 分支。
184- 从官方包元数据确认 `PYTHON_REQUIRED`。
185- 固定 PyTorch 三件套和 index,不能只写宽松范围。
186- 从官方系统要求确认支持 Ubuntu 和测试 driver。
187- 从官方仓库确认 `ISAACSIM_REPO_REF`;没有对应 tag 时设为空并声明 pip-only。
188
189扩展后先跑:
190
191```bash
192bash scripts/install_isaac_sim.sh --profile <new-profile> --dry-run
193bash -n scripts/install_isaac_sim.sh
194```
195
196## 最终输出要求
197
198最终只输出有效安装记录,不输出大段日志:
199
200- 目标机器。
201- profile。
202- 安装根目录,以及是否使用用户确认的目录或默认 `/root/workspace`。
203- Isaac Sim 版本、venv 路径、Python 路径、官方项目 repo/ref/path。
204- 平台文档入口适配:`/isaac-sim/python.sh` 是否已创建,以及实际 Python 路径。
205- 使用的脚本命令摘要。
206- 安装脚本完成状态。
207- 验证结果;必须包含日志风险扫描结果。
208- 远端过程目录清理结果;成功并验证通过后应已删除。
209- 如果有 OS/driver 警告或依赖冲突,单独列为“风险”。
210
211## Skill 测试报告要求
212
213当用户要求“测试这个 skill”时,最终报告必须包含:
214
215- 测试目标、目标机器、profile。
216- 起止时间和每个阶段耗时。
217- 实际执行的脚本路径和命令摘要。
218- 成功项、失败项、远端日志位置。
219- 失败原因判断:环境问题、网络/SSH 问题、recipe 问题或脚本问题。
220- 已做的 skill 迭代,以及仍需用户或环境侧处理的事项。
install_isaac_sim.sh:
Plain Text
1#!/usr/bin/env bash
2set -euo pipefail
3
4PROFILE="sim-6.0.0"
5INSTALL_ROOT="/root/workspace"
6VENV_NAME="env_isaacsim"
7PYTHON_BIN=""
8PROXY_URL=""
9DRY_RUN=0
10INSTALL_SYSTEM_DEPS=1
11APT_USE_PROXY=0
12ACCEPT_EULA=1
13PIP_FLAGS=(--progress-bar off --no-input)
14ISAACSIM_REPO_BASE_URL="https://github.com/isaac-sim/IsaacSim.git"
15export DEBIAN_FRONTEND=noninteractive
16
17usage() {
18 cat <<'USAGE'
19Install Isaac Sim from a pinned recipe.
20
21Usage:
22 install_isaac_sim.sh [options]
23
24Recipe:
25 --profile <name> Recipe name: sim-6.0.0, sim-5.1.0, sim-4.5.0. Combined aliases are accepted for compatibility.
26 --python <path> Python executable to create the venv. Defaults to recipe Python.
27
28Install location:
29 --install-root <path> Install root directory. Default: /root/workspace
30 --venv-name <name> Virtualenv directory name under install root. Default: env_isaacsim
31
32Network and system deps:
33 --proxy <url> Temporary proxy for git/pip downloads only. Apt uses it only with --apt-use-proxy.
34 --skip-system-deps Do not install apt runtime libraries.
35 --apt-use-proxy Let apt inherit --proxy. Default: apt runs without that proxy.
36
37Execution:
38 --dry-run Print commands without executing.
39 --help Show this help.
40
41Add a new Isaac Sim version by adding one branch in recipe_sim().
42USAGE
43}
44
45log() { printf '[SIM] %s\n' "$*"; }
46warn() { printf '[SIM][WARN] %s\n' "$*" >&2; }
47die() { printf '[SIM][ERROR] %s\n' "$*" >&2; exit 1; }
48
49supported_profiles() {
50 printf 'sim-6.0.0, sim-5.1.0, sim-4.5.0'
51}
52
53normalize_profile() {
54 local profile="$1"
55 profile="$(printf '%s' "$profile" | tr '[:upper:]' '[:lower:]')"
56 case "$profile" in
57 sim6.0|sim-6.0|sim6.0.0|sim-6.0.0|isaacsim6.0.0|isaacsim-6.0.0|sim-6.0.0+lab-3.0|sim-6.0.0+lab-main|arena-0.2)
58 printf 'sim-6.0.0'
59 ;;
60 sim5.1|sim-5.1|sim5.1.0|sim-5.1.0|isaacsim5.1.0|isaacsim-5.1.0|sim-5.1.0+lab-2.3|arena-0.1)
61 printf 'sim-5.1.0'
62 ;;
63 sim4.5|sim-4.5|sim4.5.0|sim-4.5.0|isaacsim4.5.0|isaacsim-4.5.0)
64 printf 'sim-4.5.0'
65 ;;
66 sim[0-9]*|sim-[0-9]*|isaacsim[0-9]*|isaacsim-[0-9]*)
67 printf '%s' "$profile"
68 ;;
69 *)
70 printf '%s' "$profile"
71 ;;
72 esac
73}
74
75run() {
76 if [[ "$DRY_RUN" == "1" ]]; then
77 printf '+ '
78 printf '%q ' "$@"
79 printf '\n'
80 else
81 "$@"
82 fi
83}
84
85run_bash() {
86 if [[ "$DRY_RUN" == "1" ]]; then
87 printf '+ bash -lc %q\n' "$1"
88 else
89 bash -lc "$1"
90 fi
91}
92
93set_recipe() {
94 SIM_PROFILE="$1"
95 SIM_VERSION="$2"
96 ISAACSIM_PIP_VERSION="$3"
97 PYTHON_REQUIRED="$4"
98 TORCH_VERSION="$5"
99 TORCHVISION_VERSION="$6"
100 TORCHAUDIO_VERSION="$7"
101 PYTORCH_INDEX="$8"
102 ISAACSIM_EXTRA="$9"
103 ISAACSIM_REPO_REF="${10}"
104 SUPPORTED_UBUNTU="${11}"
105 TESTED_DRIVER="${12}"
106}
107
108recipe_sim() {
109 local requested_profile="$1"
110 local normalized_profile
111 normalized_profile="$(normalize_profile "$requested_profile")"
112
113 case "$normalized_profile" in
114 sim-6.0.0)
115 set_recipe sim-6.0.0 6.0.0 6.0.0.1 3.12 2.11.0 0.26.0 2.11.0 https://download.pytorch.org/whl/cu128 all,extscache v6.0.0 "22.04 24.04" 580.95.05
116 ;;
117 sim-5.1.0)
118 set_recipe sim-5.1.0 5.1.0 5.1.0 3.11 2.7.0 0.22.0 2.7.0 https://download.pytorch.org/whl/cu128 all,extscache v5.1.0 "22.04 24.04" 580.65.06
119 ;;
120 sim-4.5.0)
121 set_recipe sim-4.5.0 4.5.0 4.5.0.0 3.10 2.5.1 0.20.1 2.5.1 https://download.pytorch.org/whl/cu124 all,extscache "" "20.04 22.04" 535.129.03
122 ;;
123 *)
124 die "No pinned Isaac Sim recipe for '$requested_profile' (normalized: '$normalized_profile'). Supported profiles: $(supported_profiles). Add a recipe_sim() branch before installing this version."
125 ;;
126 esac
127}
128
129version_ge() {
130 [[ "$(printf '%s\n%s\n' "$2" "$1" | sort -V | head -n1)" == "$2" ]]
131}
132
133parse_args() {
134 while [[ $# -gt 0 ]]; do
135 case "$1" in
136 --profile) PROFILE="$2"; shift 2 ;;
137 --install-root) INSTALL_ROOT="$2"; shift 2 ;;
138 --venv-name) VENV_NAME="$2"; shift 2 ;;
139 --python) PYTHON_BIN="$2"; shift 2 ;;
140 --proxy) PROXY_URL="$2"; shift 2 ;;
141 --skip-system-deps) INSTALL_SYSTEM_DEPS=0; shift ;;
142 --apt-use-proxy) APT_USE_PROXY=1; shift ;;
143 --dry-run) DRY_RUN=1; shift ;;
144 --help|-h) usage; exit 0 ;;
145 *) die "Unknown argument: $1" ;;
146 esac
147 done
148}
149
150apply_proxy() {
151 if [[ -n "$PROXY_URL" ]]; then
152 export http_proxy="$PROXY_URL" https_proxy="$PROXY_URL" HTTP_PROXY="$PROXY_URL" HTTPS_PROXY="$PROXY_URL"
153 fi
154}
155
156select_python() {
157 if [[ -n "$PYTHON_BIN" ]]; then
158 if [[ "$DRY_RUN" != "1" ]]; then
159 [[ -x "$PYTHON_BIN" ]] || die "Python executable is not executable: $PYTHON_BIN"
160 fi
161 SELECTED_PYTHON="$PYTHON_BIN"
162 return
163 fi
164
165 if [[ "$DRY_RUN" == "1" ]]; then
166 SELECTED_PYTHON="python${PYTHON_REQUIRED}"
167 return
168 fi
169
170 if command -v "python${PYTHON_REQUIRED}" >/dev/null 2>&1; then
171 SELECTED_PYTHON="python${PYTHON_REQUIRED}"
172 elif command -v python3 >/dev/null 2>&1; then
173 SELECTED_PYTHON="python3"
174 else
175 die "No Python found. Install Python ${PYTHON_REQUIRED} for profile ${SIM_PROFILE}."
176 fi
177
178 local actual
179 actual="$($SELECTED_PYTHON - <<'PY'
180import sys
181print(f"{sys.version_info.major}.{sys.version_info.minor}")
182PY
183)"
184 [[ "$actual" == "$PYTHON_REQUIRED" ]] || die "Profile ${SIM_PROFILE} requires Python ${PYTHON_REQUIRED}, got ${actual} from ${SELECTED_PYTHON}."
185}
186
187check_host() {
188 if [[ -r /etc/os-release ]]; then
189 . /etc/os-release
190 local version_id="${VERSION_ID:-unknown}"
191 if [[ " $SUPPORTED_UBUNTU " != *" $version_id "* ]]; then
192 warn "Ubuntu ${version_id} is not in the tested set for ${SIM_PROFILE}: ${SUPPORTED_UBUNTU}."
193 fi
194 fi
195
196 if command -v nvidia-smi >/dev/null 2>&1; then
197 local driver
198 driver="$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1 | tr -d ' ')"
199 if ! version_ge "$driver" "$TESTED_DRIVER"; then
200 warn "Driver ${driver} is below recipe tested driver ${TESTED_DRIVER}; install can proceed but runtime may fail."
201 fi
202 else
203 warn "nvidia-smi not found; GPU/driver compatibility was not verified."
204 fi
205}
206
207install_system_deps() {
208 [[ "$INSTALL_SYSTEM_DEPS" == "1" ]] || return 0
209 if [[ "$(id -u)" != "0" ]]; then
210 warn "Not root; skipping apt runtime libraries. Re-run as root or install them manually if Isaac Sim cannot start."
211 return 0
212 fi
213
214 local apt_prefix="env -u http_proxy -u https_proxy -u HTTP_PROXY -u HTTPS_PROXY"
215 [[ "$APT_USE_PROXY" == "1" ]] && apt_prefix="env"
216
217 run_bash "$apt_prefix apt-get update"
218 run_bash "$apt_prefix apt-get install -y libgl1 libglu1-mesa libxt6 libxrender1 libxrandr2 libxinerama1 libxcursor1 libxi6 libxkbcommon-x11-0 libsm6 libvulkan1"
219}
220
221create_venv() {
222 run mkdir -p "$INSTALL_ROOT"
223 if [[ ! -d "$VENV_PATH" ]]; then
224 run "$SELECTED_PYTHON" -m venv "$VENV_PATH"
225 fi
226}
227
228python_in_venv() {
229 run "${VENV_PATH}/bin/python" "$@"
230}
231
232accept_eula_value() {
233 if [[ "$ACCEPT_EULA" == "1" ]]; then
234 printf 'YES'
235 else
236 printf 'NO'
237 fi
238}
239
240upgrade_pip() {
241 python_in_venv -m pip install "${PIP_FLAGS[@]}" --upgrade pip
242}
243
244install_pytorch() {
245 python_in_venv -m pip install "${PIP_FLAGS[@]}" \
246 "torch==${TORCH_VERSION}" \
247 "torchvision==${TORCHVISION_VERSION}" \
248 "torchaudio==${TORCHAUDIO_VERSION}" \
249 --index-url "$PYTORCH_INDEX"
250}
251
252install_isaacsim_packages() {
253 run env OMNI_KIT_ACCEPT_EULA="$(accept_eula_value)" \
254 "${VENV_PATH}/bin/python" -m pip install "${PIP_FLAGS[@]}" \
255 "isaacsim[${ISAACSIM_EXTRA}]==${ISAACSIM_PIP_VERSION}" \
256 --index-url https://pypi.org/simple \
257 --extra-index-url https://pypi.nvidia.com
258}
259
260verify_isaacsim_package() {
261 python_in_venv -m pip show isaacsim >/dev/null
262}
263
264install_python_packages() {
265 log "Installing Python packages into ${VENV_PATH}."
266 upgrade_pip
267 install_pytorch
268 install_isaacsim_packages
269 [[ "$DRY_RUN" == "1" ]] || verify_isaacsim_package
270}
271
272checkout_isaacsim_repo() {
273 ISAACSIM_REPO_URL="$ISAACSIM_REPO_BASE_URL"
274 ISAACSIM_REPO_DIR="${INSTALL_ROOT%/}/IsaacSim"
275 if [[ -z "$ISAACSIM_REPO_REF" ]]; then
276 ISAACSIM_REPO_URL=""
277 ISAACSIM_REPO_DIR=""
278 log "No official IsaacSim repo ref is pinned for ${SIM_PROFILE}; using pip packages only."
279 return
280 fi
281 if [[ "$DRY_RUN" == "1" ]]; then
282 log "Would checkout official IsaacSim repo ${ISAACSIM_REPO_REF} into ${ISAACSIM_REPO_DIR}."
283 return
284 fi
285 if [[ ! -d "$ISAACSIM_REPO_DIR/.git" ]]; then
286 run git clone --branch "$ISAACSIM_REPO_REF" "$ISAACSIM_REPO_URL" "$ISAACSIM_REPO_DIR"
287 else
288 run git -C "$ISAACSIM_REPO_DIR" fetch origin --tags
289 run git -C "$ISAACSIM_REPO_DIR" checkout "$ISAACSIM_REPO_REF"
290 fi
291}
292
293install_compat_layout() {
294 local compat_dir="/isaac-sim"
295 if [[ "$DRY_RUN" == "1" ]]; then
296 log "Would create compatibility entrypoint ${compat_dir}/python.sh"
297 return
298 fi
299 if [[ "$(id -u)" != "0" ]]; then
300 warn "Not root; skipping ${compat_dir}/python.sh compatibility entrypoint. Use ${VENV_PATH}/bin/python instead."
301 return
302 fi
303 mkdir -p "$compat_dir"
304 cat > "${compat_dir}/python.sh" <<EOF
305#!/usr/bin/env bash
306set -euo pipefail
307export OMNI_KIT_ACCEPT_EULA=\${OMNI_KIT_ACCEPT_EULA:-YES}
308export OMNI_KIT_ALLOW_ROOT=\${OMNI_KIT_ALLOW_ROOT:-1}
309exec "${VENV_PATH}/bin/python" "\$@"
310EOF
311 chmod +x "${compat_dir}/python.sh"
312}
313
314write_record() {
315 local record_path="$INSTALL_ROOT/isaac-sim-install.record"
316 if [[ "$DRY_RUN" == "1" ]]; then
317 log "Would write install record to ${record_path}"
318 return
319 fi
320 cat > "$record_path" <<EOF
321component=isaac-sim
322profile=${SIM_PROFILE}
323sim_version=${SIM_VERSION}
324isaacsim_pip_version=${ISAACSIM_PIP_VERSION}
325python=${VENV_PATH}/bin/python
326venv=${VENV_PATH}
327repo=${ISAACSIM_REPO_URL}
328repo_ref=${ISAACSIM_REPO_REF}
329repo_path=${ISAACSIM_REPO_DIR}
330compat_python=/isaac-sim/python.sh
331torch=${TORCH_VERSION}
332torchvision=${TORCHVISION_VERSION}
333torchaudio=${TORCHAUDIO_VERSION}
334pytorch_index=${PYTORCH_INDEX}
335tested_driver=${TESTED_DRIVER}
336EOF
337}
338
339print_summary() {
340 log "Isaac Sim installed: ${VENV_PATH}/bin/python"
341 if [[ -n "$ISAACSIM_REPO_REF" ]]; then
342 log "Official IsaacSim repo: ${ISAACSIM_REPO_DIR} (${ISAACSIM_REPO_REF})"
343 else
344 log "Official IsaacSim repo: not pinned for ${SIM_PROFILE}; pip packages only"
345 fi
346 log "Compatibility entrypoint: /isaac-sim/python.sh"
347}
348
349main() {
350 parse_args "$@"
351 recipe_sim "$PROFILE"
352 VENV_PATH="${INSTALL_ROOT%/}/${VENV_NAME}"
353
354 apply_proxy
355 select_python
356 check_host
357
358 log "Using recipe ${SIM_PROFILE}: Isaac Sim ${ISAACSIM_PIP_VERSION}, Python ${PYTHON_REQUIRED}, torch ${TORCH_VERSION}."
359 install_system_deps
360 create_venv
361 install_python_packages
362 checkout_isaacsim_repo
363 install_compat_layout
364 write_record
365
366 [[ "$DRY_RUN" == "1" ]] || print_summary
367}
368
369main "$@"~~~~
评价此篇文章
