Skip to content

Fix Windows hangs by warming up Newton before CUDA graph capture - #8316

Merged
StafaH merged 1 commit into
isaac-sim:developfrom
StafaH:fix/newton-eager-before-capture
Oct 6, 2026
Merged

StafaH merged 1 commit into
isaac-sim:developfrom
StafaH:fix/newton-eager-before-capture

Conversation

@StafaH

@StafaH StafaH commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Description

MuJoCo-Warp's first lazy GPU allocation can hang on Windows when Newton's first physics step is recorded inside a CUDA graph, a regression introduced by #8058.

Run the first requested physics step eagerly, then record the graph for subsequent steps. The same ordering applies after graph invalidation. This initializes lazy GPU resources outside capture while preserving exactly one physics advance per requested step. Updated the capture lifecycle documentation and added a changelog fragment. No dependencies or tests added.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Validation

  • Existing first-step/recapture cases for MJWarp with RTX capture and Kamino with standard capture, plus stateful actuator trajectories across decimation changes: 3 passed.
  • Formatting and lint hooks passed. uv run isaaclab -f reports changelog errors against the fork's stale origin/develop; the same changelog validation passed against the current upstream develop diff.
  • Windows hang verification remains outstanding.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • My name already exists in CONTRIBUTORS.md

@StafaH
StafaH requested a review from a team October 6, 2026 03:46
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 6, 2026
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Reorders when physics simulation graph is captured.

The PR appears safe to merge, though repeatable Windows CUDA validation would better protect the targeted fix.

Findings

  1. P2 Windows regression coverage missing ▶

Summary

The PR runs Newton’s first requested physics step eagerly before capturing a CUDA graph, applies the same order after graph invalidation, and updates the configuration documentation and changelog.

  • Existing first-step and recapture tests cover capture modes, but Windows-specific validation of the reported hang remains outstanding.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Graph pending] --> B[Run requested step eagerly]
  B --> C[Capture subsequent-step graph]
  C --> D[Replay graph on later steps]
  D --> E{Graph invalidated?}
  E -- Yes --> A
  E -- No --> D
Loading

Reviews (1) · Last reviewed commit: "Warm up Newton physics before CUDA graph..."

cls._simulate_physics_only()
PhysicsManager._sim_time += physics_dt

# Run the requested step eagerly before capture so lazy GPU allocations happen outside recording.

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 Windows regression coverage missing The new ordering is meant to fix a Windows-only hang, but the existing first-step and recapture tests cover capture modes without testing Windows CUDA. Those tests could pass even if the hang remains or returns. A repeatable Windows CUDA test of the first step and recapture would protect this fix.

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!

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

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.

Isaac Lab Review Bot

All reviewed code categories look good.

  • PR description: The description matches the three-file diff and makes no measurable performance claim; replace “3 passed” with exact test paths and commands while retaining the outstanding Windows validation.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: Style consistency looks good.
  • Test quality: Test quality looks good.

No blocking issues. No inline findings.

Automated review; human maintainers own approval decisions.

@StafaH

StafaH commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 6, 2026
@StafaH
StafaH merged commit 1d5a8fc into isaac-sim:develop Oct 6, 2026
92 of 93 checks passed
isaaclab-bot Bot pushed a commit that referenced this pull request Oct 6, 2026
# Description

MuJoCo-Warp's first lazy GPU allocation can hang on Windows when
Newton's first physics step is recorded inside a CUDA graph, a
regression introduced by #8058.

Run the first requested physics step eagerly, then record the graph for
subsequent steps. The same ordering applies after graph invalidation.
This initializes lazy GPU resources outside capture while preserving
exactly one physics advance per requested step. Updated the capture
lifecycle documentation and added a changelog fragment. No dependencies
or tests added.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- Documentation update

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Validation

- Existing first-step/recapture cases for MJWarp with RTX capture and
Kamino with standard capture, plus stateful actuator trajectories across
decimation changes: **3 passed**.
- Formatting and lint hooks passed. `uv run isaaclab -f` reports
changelog errors against the fork's stale `origin/develop`; the same
changelog validation passed against the current upstream `develop` diff.
- Windows hang verification remains outstanding.

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] My name already exists in `CONTRIBUTORS.md`

(cherry picked from commit 1d5a8fc)
@isaaclab-bot

isaaclab-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 2bf268f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants