[BUG] Fix Isaac Sim 6.0 streaming crash from prebundle torch shadowing#6288
Conversation
Greptile SummaryFixes a Docker image build-time crash where Isaac Sim 6.0's prebundled PyTorch (
Confidence Score: 4/5The base image fix is correct and validated. The curobo image has a parallel gap that would expose Isaac Sim 6.0 curobo users to the same streaming crash. The Dockerfile.base change correctly removes the broken prebundle from both the Isaac Sim 6.0 (extsDeprecated/) and 5.x (exts/) paths and the regression test is sound. However, Dockerfile.curobo only removes the exts/ path and would still leave the extsDeprecated/ prebundle in place on Isaac Sim 6.0, meaning curobo-image streaming launches would still crash with the same undefined-symbol error this PR is fixing. docker/Dockerfile.curobo — the extsDeprecated/ removal added to Dockerfile.base was not applied here, leaving a gap for curobo + Isaac Sim 6.0 streaming builds. Important Files Changed
Reviews (1): Last reviewed commit: "Add regression test for prebundled torch..." | Re-trigger Greptile |
| RUN rm -rf ${ISAACSIM_ROOT_PATH}/kit/python/lib/python3.12/site-packages/pip* && \ | ||
| wget -q https://bootstrap.pypa.io/get-pip.py && \ | ||
| ${ISAACLAB_PATH}/_isaac_sim/kit/python/bin/python3 get-pip.py && \ | ||
| rm get-pip.py |
There was a problem hiding this comment.
Network fetch of
get-pip.py introduces build-time internet dependency
wget https://bootstrap.pypa.io/get-pip.py is called unconditionally during every image build, even when neither extsDeprecated/ nor exts/ torch* paths exist (e.g. Isaac Sim 5.x without curobo, where the first rm -rf is a no-op and pip was never disturbed). If bootstrap.pypa.io is unreachable or the script is updated with a breaking change the build silently breaks at this step. Consider guarding the pip reinstall with a check for whether the prior rm -rf actually removed anything, or pin to a known-good hash of the script.
Launching the Isaac Sim streaming app (isaac-sim.streaming.sh / runheadless.sh) from an Isaac Lab install against Isaac Sim 6.0 crashed with "undefined symbol: ncclDevCommCreate". The cause is a cross-stack NCCL collision, not a broken Isaac Sim package. Isaac Sim's deprecated omni.isaac.ml_archive prebundle ships a self-consistent torch + NCCL, and Isaac Lab installs a different pinned torch + NCCL in site-packages. torch's RTLD_GLOBAL CUDA preload resolves libnccl.so.2 by sys.path order before libtorch_cuda.so's RPATH, so on launch paths that do not import isaaclab (which otherwise deprioritizes the prebundle), the older pip NCCL is loaded and the prebundle torch binds to it, missing ncclDevCommCreate. _repoint_prebundle_packages already prevents this by symlinking the prebundle to the active environment, but silently no-opped inside the Docker image build: the prebundle is on an overlayfs lower layer where os.rename raises EXDEV and shutil.rmtree raises EINVAL (its dir_fd walk), both swallowed as warnings. It works on the host (single filesystem), which is why only the Docker image was affected. Make repoint overlayfs-safe with a single uniform path: replace the rename-to-.bak plus shutil.rmtree with plain-path os.unlink/os.rmdir (which create the proper overlayfs whiteout) and a symlink, and fail loudly if a real prebundled torch still shadows the pip torch. Add a regression test asserting no shadowing prebundle torch, and update the repoint unit tests for the no-backup behavior. Fixes nvbugs 6343978.
3eba695 to
c55f164
Compare
## 1. Summary - Cherry-picks #6288 onto `release/3.0.0-beta2`. - Prevents Isaac Sim 6.0 streaming launches from loading prebundled torch against the older pip-installed NCCL. - Makes prebundle repointing work on overlayfs and fail loudly when a shadowing torch copy remains. ## 2. Validation - [x] `69 passed` in the touched install CLI test modules. - [x] Release Docker image invariant failed before repointing and passed afterward. - [x] Exact NVBug 6343978 streaming command reached the Isaac Sim 6.0.1 full-streaming marker after the fix. - [x] `./isaaclab.sh -f`. ## 3. Related - Cherry-pick of #6288. - Fixes NVBug 6343978.
isaac-sim#6288) ## Summary Fixes a crash (nvbugs 6343978) when launching the Isaac Sim streaming app (`isaac-sim.streaming.sh` / `runheadless.sh`) from an Isaac Lab install against Isaac Sim 6.0: ``` [Error] [isaacsim.core.deprecation_manager.api] Import error: .../omni.isaac.ml_archive/pip_prebundle/torch/lib/libtorch_cuda.so: undefined symbol: ncclDevCommCreate ``` ## Root cause (corrected after investigation) Not a broken Isaac Sim package — a **cross-stack NCCL collision**: - Isaac Sim 6.0's deprecated `omni.isaac.ml_archive` prebundle ships a *self-consistent* torch + NCCL (torch 2.11 + nccl 2.28.9, which **does** export `ncclDevCommCreate`). - Isaac Lab installs its own pinned torch (2.10) + nccl (2.27.5) into site-packages. - torch's Python-side CUDA preload resolves `libnccl.so.2` by `sys.path`/namespace order (`RTLD_GLOBAL`), *before* `libtorch_cuda.so`'s RPATH. On launch paths that **don't import `isaaclab`** (the streaming app — `isaaclab/__init__.py` deprioritizes the prebundle only on import), the older pip nccl 2.27.5 loads, the prebundle torch 2.11 binds to it, and `ncclDevCommCreate` is missing → crash. LD_DEBUG confirms the pip nccl wins the load. `_repoint_prebundle_packages()` already exists to prevent this (it symlinks the prebundle to the active env, collapsing to one stack), but it **silently no-op'd inside the Docker image build**: the prebundle is on an overlayfs lower layer where `os.rename`→`.bak` raises `EXDEV` and `shutil.rmtree` raises `EINVAL` (its `dir_fd` walk), both swallowed as warnings. It works on the host (single filesystem), which is why only the Docker image was affected. ## Fix Make `_repoint_prebundle_packages()` overlayfs-safe via a single uniform path: - Replace rename-to-`.bak` + `shutil.rmtree` with `_force_remove` (plain-path `os.unlink`/`os.rmdir`, which create the proper overlayfs whiteout) + symlink. No `.bak` (the env copy is the symlink target), no subprocess, no fallback. - Add a fail-loud post-check: raise if a real prebundle `torch` still shadows the pip torch, so the broken state can't ship silently again. This collapses the two torch/nccl stacks into one on every launch path, host and Docker. ## Validation (x86 RTX A6000, exact `isaac-lab` container) - Before: streaming crashes at ~19s with `undefined symbol: ncclDevCommCreate`. - After (repoint runs at build): prebundle torch → symlink to env 2.10; streaming boots to `Isaac Sim Full Streaming Version: 6.0.0-rc.47`, 0 `ncclDevCommCreate`. ## Tests - `test_no_shadowing_prebundled_torch_in_isaac_sim` (filesystem invariant): RED on the un-fixed image (real prebundle torch), GREEN on the fixed image / host (symlink). - Updated `_repoint_prebundle_packages` unit tests: no `.bak`; new fail-loud test. Fixes nvbugs 6343978.
…undle deletion, pin-pink) (#6329) # Description Fixes the Docker-only error flood in nvbugs 6343978 (follow-up to #6288): streaming starts, but the log carries 438 `[Error]` lines and 14 Isaac Sim extensions fail to load. uv installs are unaffected. Two independent causes, both Isaac Lab's install mutating packages that Isaac Sim's extensions rely on. ## Summary - **`packaging` deleted from a shared prebundle.** The vestigial `packaging<24` bound in `isaaclab_rl` forced a downgrade; pip (which sees prebundle paths through `python.sh`'s environment) uninstalled `packaging-26.0` from the `omni.isaac.core_archive` prebundle. `omni.services.pip_archive` shares that package as per-file symlinks, so the deletion dangled the farm and cascaded into 13 extension startup failures. Fixed by relaxing the bound (no consumer requires it; now in the root `pyproject.toml` after the #6009 centralization), plus a **fail-loud invariant**: the install aborts if pip leaves a prebundled package with a dangling `__init__.py`. - **`pin-pink==3.1.0` too old for Isaac Sim 6.x.** `isaacsim.robot_motion.pink` needs `pink.exceptions.NoSolutionFound` (pink ≥ 3.3.0). Isaac Sim bundles pink 4.2.0, but the install replaces it with the kit-site-packages copy, pinned to 3.1.0 since pink 3.4+ broke the `pink_ik` task API (#5846). Bumped to **3.3.0**, which satisfies both consumers (`DampingTask.set_target_from_configuration` verified present on both wheels). The pin lives once in the root `pyproject.toml`; the install CLI now derives its force-install stack from those entries instead of a hardcoded copy. - **Impact**: an image rebuilt with this PR runs the exact reported command with **0 errors / 0 tracebacks / 0 extension failures** (broken image and the customer's attached log: 438 / 34 / 14). ## 1. Design notes 1. **Invariant scoping (empirical).** Every docker build routinely replaces prebundled dists (numpy, the cmeel/pinocchio stack, scipy, …) and leaves ~42 dangling links to files Python never imports at startup (test modules, `WHEEL`/license files, cmake hooks) — none of them `__init__.py`. The harmful class (this bug) dangles package `__init__.py` files, making the package unimportable for every extension that loads it. The install therefore fails only on a new dangling `__init__.py` and warns on other new dangling links. 2. **Considered and rejected: hiding prebundles from pip.** Routing pip to the concrete kit interpreter also prevents deletions, but changes dependency resolution build-wide: deps previously satisfied by prebundled copies get freshly resolved into kit site-packages, and the `isaacteleop` step then downgraded numpy to 2.3.5 and pin to 3.9.0 — CI measured the `rsl_rl` export flow at ~4.4× baseline (600s timeouts vs 168s). Prebundle-visible resolution is kept as-is, with the invariant as the guard. ## 2. Validation - **End-to-end on a fresh image built from this PR** (Isaac Sim base digest `99e4e4cfae17…`): `isaac-sim.streaming.sh --allow-root` reaches streaming at ~34 s, stays alive to timeout, with 0 Kit errors, 0 tracebacks, 0 extension-startup failures. Baked state: `packaging` 26.0 resolves from the prebundle, pink 3.3.0 imports from kit site-packages, 0 dangling `__init__.py` anywhere in the prebundles. - **Customer log cross-check**: the attached `isaaclab_streaming_20260702.log` has the identical 438-error class set as the local broken reproduction — both roots, no third issue. - **Invariant**: catches the packaging cascade in-container (RuntimeError naming the broken `omni.services.pip_archive` links) and passes the routine-residue case. - **Tests**: install CLI suites 148 passed / 1 skipped (invariant + derived-stack tests); `test_pink_ik_components.py` with pink 3.3.0 — 21 passed. CI fully green; the export flow runs at its 168 s baseline. Fixes nvbugs 6343978.
Summary
Fixes a crash (nvbugs 6343978) when launching the Isaac Sim streaming app
(
isaac-sim.streaming.sh/runheadless.sh) from an Isaac Lab install against Isaac Sim 6.0:Root cause (corrected after investigation)
Not a broken Isaac Sim package — a cross-stack NCCL collision:
omni.isaac.ml_archiveprebundle ships a self-consistenttorch + NCCL (torch 2.11 + nccl 2.28.9, which does export
ncclDevCommCreate).libnccl.so.2bysys.path/namespace order(
RTLD_GLOBAL), beforelibtorch_cuda.so's RPATH. On launch paths that don't importisaaclab(the streaming app —isaaclab/__init__.pydeprioritizes the prebundle only onimport), the older pip nccl 2.27.5 loads, the prebundle torch 2.11 binds to it, and
ncclDevCommCreateis missing → crash. LD_DEBUG confirms the pip nccl wins the load._repoint_prebundle_packages()already exists to prevent this (it symlinks the prebundle tothe active env, collapsing to one stack), but it silently no-op'd inside the Docker image
build: the prebundle is on an overlayfs lower layer where
os.rename→.bakraisesEXDEVand
shutil.rmtreeraisesEINVAL(itsdir_fdwalk), both swallowed as warnings. It workson the host (single filesystem), which is why only the Docker image was affected.
Fix
Make
_repoint_prebundle_packages()overlayfs-safe via a single uniform path:.bak+shutil.rmtreewith_force_remove(plain-pathos.unlink/os.rmdir, which create the proper overlayfs whiteout) + symlink. No.bak(the env copy is the symlink target), no subprocess, no fallback.
torchstill shadows the pip torch,so the broken state can't ship silently again.
This collapses the two torch/nccl stacks into one on every launch path, host and Docker.
Validation (x86 RTX A6000, exact
isaac-labcontainer)undefined symbol: ncclDevCommCreate.Isaac Sim Full Streaming Version: 6.0.0-rc.47, 0ncclDevCommCreate.Tests
test_no_shadowing_prebundled_torch_in_isaac_sim(filesystem invariant): RED on theun-fixed image (real prebundle torch), GREEN on the fixed image / host (symlink).
_repoint_prebundle_packagesunit tests: no.bak; new fail-loud test.Fixes nvbugs 6343978.