Skip to content

[Fix] Cherry-pick Isaac Sim 6.0 streaming crash fix - #6295

Merged
kellyguo11 merged 1 commit into
isaac-sim:release/3.0.0-beta2from
hujc7:jichuanh/cherrypick-6288-release-3.0.0-beta2-codex
Jun 29, 2026
Merged

kellyguo11 merged 1 commit into
isaac-sim:release/3.0.0-beta2from
hujc7:jichuanh/cherrypick-6288-release-3.0.0-beta2-codex

Conversation

@hujc7

@hujc7 hujc7 commented Jun 29, 2026 •

Copy link
Copy Markdown
Collaborator

1. Summary

2. Validation

  • 69 passed in the touched install CLI test modules.
  • Release Docker image invariant failed before repointing and passed afterward.
  • Exact NVBug 6343978 streaming command reached the Isaac Sim 6.0.1 full-streaming marker after the fix.
  • ./isaaclab.sh -f.

3. Related

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.

(cherry picked from commit c55f164)
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jun 29, 2026
@hujc7 hujc7 changed the title [Fix] Backport Isaac Sim 6.0 streaming crash fix [Fix] Cherry-pick Isaac Sim 6.0 streaming crash fix Jun 29, 2026
@greptile-apps

greptile-apps Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This backport fixes the undefined symbol: ncclDevCommCreate streaming crash (NVBug 6343978) by making Isaac Sim's prebundled torch neutralization work correctly inside Docker image builds (overlayfs) and by failing loudly if any real prebundled torch directory survives the process.

  • Replaces shutil.rmtree / rename-to-.bak with a new _force_remove helper that uses plain os.unlink/os.rmdir syscalls, which correctly create overlayfs whiteouts where the dir_fd-relative variant raised EINVAL.
  • Adds a post-loop invariant that raises RuntimeError when a real (non-symlink) prebundled torch directory is detected, preventing the broken NCCL state from shipping silently.
  • Updates unit and integration tests to match the new behavior (no .bak, new RuntimeError path).

Confidence Score: 4/5

Safe to merge; the only finding is a stale docstring line that was not updated to reflect the removal of the .bak rename strategy.

The core logic change — swapping shutil.rmtree and rename-to-.bak for a plain os.unlink/os.rmdir recursive helper and a fail-loud post-loop guard — is correct and well-tested. The overlayfs reasoning is sound: dir_fd-relative operations are the specific source of the EINVAL/EXDEV errors inside Docker image builds, and the new helper avoids them. The shadowing check is correctly gated on use_symlinks and on torch being present in the active environment. Tests cover idempotency, the stale-symlink update path, the Windows copy path, and the new RuntimeError path. The one issue is that the docstring still says 'moved to <name>.bak' after the backup strategy was removed.

source/isaaclab/isaaclab/cli/commands/install.py — docstring at lines 738–739 should be updated to describe the in-place removal behavior.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/cli/commands/install.py Introduces _force_remove (overlayfs-safe recursive delete using plain os.unlink/os.rmdir) and a post-loop fail-loud guard that raises RuntimeError when a real prebundled torch directory survives repointing; the .bak rename strategy is fully replaced. One stale docstring line remains.
source/isaaclab/test/cli/test_install_commands.py Unit tests updated: .bak assertion removed, new test_raises_when_prebundled_torch_not_neutralized correctly verifies the RuntimeError path by mocking _force_remove as a no-op.
source/isaaclab/test/cli/test_install.py Adds integration regression test test_no_shadowing_prebundled_torch_in_isaac_sim that walks the real Isaac Sim tree and asserts no unlinked prebundled torch directory exists; skips cleanly when Isaac Sim is absent.
source/isaaclab/changelog.d/jichuanh-fix-sim6-prebundle-torch-streaming.rst New changelog entry accurately describes the NCCL crash root cause, the overlayfs-safe fix, and the fail-loud invariant.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[_repoint_prebundle_packages] --> B{Isaac Sim found?}
    B -- No --> Z[return early]
    B -- Yes --> C[Discover all pip_prebundle dirs]
    C --> D{Any pip_prebundle dirs?}
    D -- No --> Z
    D -- Yes --> E[For each pkg in _PREBUNDLE_REPOINT_PACKAGES]
    E --> F{venv_pkg exists?}
    F -- No --> E
    F -- Yes --> G{Already symlinked to correct target?}
    G -- Yes --> E
    G -- No --> H[_force_remove prebundled\nos.unlink / os.rmdir\nno dir_fd — overlayfs safe]
    H --> I{use_symlinks?}
    I -- Yes --> J[prebundled.symlink_to venv_pkg]
    I -- No --> K[shutil.copytree venv_pkg prebundled]
    J --> E
    K --> E
    H -- OSError --> L[print_warning, skip]
    L --> E
    E -- all done --> M{use_symlinks AND torch in site-packages?}
    M -- No --> N[Done]
    M -- Yes --> O{Any real prebundle/torch directory remaining?}
    O -- No --> N
    O -- Yes --> P[raise RuntimeError]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[_repoint_prebundle_packages] --> B{Isaac Sim found?}
    B -- No --> Z[return early]
    B -- Yes --> C[Discover all pip_prebundle dirs]
    C --> D{Any pip_prebundle dirs?}
    D -- No --> Z
    D -- Yes --> E[For each pkg in _PREBUNDLE_REPOINT_PACKAGES]
    E --> F{venv_pkg exists?}
    F -- No --> E
    F -- Yes --> G{Already symlinked to correct target?}
    G -- Yes --> E
    G -- No --> H[_force_remove prebundled\nos.unlink / os.rmdir\nno dir_fd — overlayfs safe]
    H --> I{use_symlinks?}
    I -- Yes --> J[prebundled.symlink_to venv_pkg]
    I -- No --> K[shutil.copytree venv_pkg prebundled]
    J --> E
    K --> E
    H -- OSError --> L[print_warning, skip]
    L --> E
    E -- all done --> M{use_symlinks AND torch in site-packages?}
    M -- No --> N[Done]
    M -- Yes --> O{Any real prebundle/torch directory remaining?}
    O -- No --> N
    O -- Yes --> P[raise RuntimeError]
Loading

Comments Outside Diff (1)

  1. source/isaaclab/isaaclab/cli/commands/install.py, line 738-739 (link)

    P2 The docstring still describes the old .bak rename strategy. The implementation no longer creates any backup — it removes the prebundled copy in place via _force_remove.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "Fix Isaac Sim 6.0 streaming crash from p..." | Re-trigger Greptile

@kellyguo11
kellyguo11 merged commit 4c6aac2 into isaac-sim:release/3.0.0-beta2 Jun 29, 2026
37 checks passed
hujc7 added a commit that referenced this pull request Jul 10, 2026
…etion, pin-pink) (#6436)

# Description

Cherry-pick of #6329 onto `release/3.0.0-beta2` — the follow-up to #6295
for NVBug 6410989 (continuation of NVBug 6343978): Docker streaming
works but the log floods with 438 `[Error]` lines and 14 Isaac Sim
extensions fail to load. uv installs are unaffected.

## 1. Summary

- Relaxed the vestigial `packaging<24` bound in `isaaclab_rl` — it
forced pip to downgrade `packaging` and delete it from the
`omni.isaac.core_archive` prebundle, dangling the per-file symlink farm
`omni.services.pip_archive` shares with it (13 extension startup
failures).
- Bumped `pin-pink` `3.1.0` → `3.3.0` at every pin site —
`isaacsim.robot_motion.pink` needs `pink.exceptions.NoSolutionFound`
(pink ≥ 3.3.0); pink 3.4+ stays excluded (pink_ik task-API break,
#5846). The wheel spec's `pin-pink>=2.3.6` also becomes `==3.3.0` (it
currently resolves to 4.x).
- Added the fail-loud post-install invariant: the install aborts when
pip leaves a prebundled Isaac Sim package with a dangling `__init__.py`;
other new dangling links only warn.

## 2. Backport adaptations vs #6329

This branch predates the #6009 dependency centralization, so:

- Pin edits land in `source/isaaclab/setup.py`,
`source/isaaclab_rl/setup.py`, and
`tools/wheel_builder/res/python_packages.toml` instead of the root
`pyproject.toml`.
- The install CLI keeps its hardcoded `_PINK_IK_STACK` (bumped to
3.3.0); the pyproject-derived stack from #6329 and its tests are not
ported — the derivation would `KeyError` here since the root
`pyproject.toml` has no pin entries on this branch.
- `import pytest` added to `test_install_prebundle.py` (develop had it
from an intermediate commit not on this branch).

## 3. Heads-up: the invariant can surface latent arm64 breakage

On develop, the first nightly image build containing #6329 failed its
arm64 leg because the invariant caught a real prebundle breakage (Pillow
deleted from `omni.kit.pip_archive`). If this release branch's arm64
docker build has a similar latent issue, the invariant will turn a
silently-broken image into a failed build — that is by design, but worth
knowing before merging.

## 4. Test plan

- [x] `source/isaaclab/test/cli/` — 141 passed locally (prebundle
invariant tests included).
- [ ] PR CI green.

---------

Co-authored-by: Piotr Barejko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants