Skip to content

[BUG] Fix Isaac Sim 6.0 streaming crash from prebundle torch shadowing#6288

Merged
kellyguo11 merged 1 commit into
isaac-sim:developfrom
hujc7:jichuanh/fix-sim6-prebundle-torch-streaming
Jun 29, 2026
Merged

[BUG] Fix Isaac Sim 6.0 streaming crash from prebundle torch shadowing#6288
kellyguo11 merged 1 commit into
isaac-sim:developfrom
hujc7:jichuanh/fix-sim6-prebundle-torch-streaming

Conversation

@hujc7

@hujc7 hujc7 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

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.

@hujc7
hujc7 requested a review from pascal-roth as a code owner June 29, 2026 04:05
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team infrastructure labels Jun 29, 2026
@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes a Docker image build-time crash where Isaac Sim 6.0's prebundled PyTorch (omni.isaac.ml_archive/extsDeprecated/.../torch) contains libtorch_cuda.so that references an NCCL symbol absent from its co-bundled NCCL, causing streaming launchers that bypass isaaclab's sys.path guard to crash. The fix removes the broken artifact during docker build, mirrors the existing Dockerfile.curobo pattern, and adds a regression test.

  • docker/Dockerfile.base: Adds rm -rf for the extsDeprecated/ (Isaac Sim 6.0) and exts/ (Isaac Sim 5.x) torch prebundle paths, followed by an unconditional pip reinstall from bootstrap.pypa.io to recover pip vendor files deleted as a side-effect.
  • test_install.py: New regression test test_no_shadowing_prebundled_torch_in_isaac_sim walks all pip_prebundle/torch directories under the Isaac Sim root and asserts none are real (non-symlink) directories; skips gracefully when Isaac Sim is not installed.
  • Dockerfile.curobo (unchanged by this PR) only removes the exts/ path, leaving the extsDeprecated/ gap present for curobo images built against Isaac Sim 6.0.

Confidence Score: 4/5

The 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

Filename Overview
docker/Dockerfile.base Adds two RUN layers: one removes the broken prebundled torch from both extsDeprecated/ (Isaac Sim 6.0) and exts/ (Isaac Sim 5.x) paths; a second reinstalls pip via bootstrap.pypa.io to recover pip vendor files deleted as a side-effect. Pattern mirrors the existing Dockerfile.curobo approach. Minor concern: the pip reinstall runs unconditionally even when no torch was removed.
docker/Dockerfile.curobo Not changed by this PR but has a gap: only removes torch* from the Isaac Sim 5.x exts/ path, not from the extsDeprecated/ path used by Isaac Sim 6.0. This means curobo images built against Isaac Sim 6.0 would still crash on streaming launches.
source/isaaclab/test/cli/test_install.py Adds a regression test that walks all pip_prebundle/torch directories under the Isaac Sim root and asserts none are real directories (as opposed to symlinks). Correctly skips when Isaac Sim is not installed. Test logic and use of extract_isaacsim_path(required=False) are correct.
source/isaaclab/changelog.d/jichuanh-fix-sim6-prebundle-torch-streaming.rst New changelog entry accurately describes the root cause and fix.

Reviews (1): Last reviewed commit: "Add regression test for prebundled torch..." | Re-trigger Greptile

Comment thread docker/Dockerfile.base Outdated
Comment on lines +171 to +174
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.
@hujc7
hujc7 force-pushed the jichuanh/fix-sim6-prebundle-torch-streaming branch from 3eba695 to c55f164 Compare June 29, 2026 05:07
@hujc7 hujc7 changed the title Fix Isaac Sim 6.0 streaming crash from broken prebundled torch Fix Isaac Sim 6.0 streaming crash from prebundle torch shadowing Jun 29, 2026
@hujc7 hujc7 changed the title Fix Isaac Sim 6.0 streaming crash from prebundle torch shadowing [BUG] Fix Isaac Sim 6.0 streaming crash from prebundle torch shadowing Jun 29, 2026
@kellyguo11
kellyguo11 merged commit f5c80a8 into isaac-sim:develop Jun 29, 2026
39 of 40 checks passed
kellyguo11 pushed a commit that referenced this pull request Jun 29, 2026
## 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.
mardigiorgio pushed a commit to mardigiorgio/IsaacLab that referenced this pull request Jul 2, 2026
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.
hujc7 added a commit that referenced this pull request Jul 8, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants