Skip to content

[Backport] PR #8539 to release/3.0.0 - #8547

Merged
kellyguo11 merged 1 commit into
release/3.0.0from
backport/release/3.0.0/pr-8539
Oct 14, 2026
Merged

kellyguo11 merged 1 commit into
release/3.0.0from
backport/release/3.0.0/pr-8539

Conversation

@isaaclab-bot

@isaaclab-bot isaaclab-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Backports #8539 to release/3.0.0.

The original cherry-pick conflicted. An NVIDIA inference model proposed this resolution, and deterministic validation confirmed that it changes no paths outside the original PR. Because conflict resolution cannot be certified as an exact patch replay, this PR is intentionally a draft and requires release-maintainer review.

Field Commit
Original merged change c647410de088139054199f41bb71b451602a5fe7
Release base used 34ba08a104f370fa22d6136bb4e64a1190096c5a
Proposed backport ae4599d5cd4d2ce592459ffe3cf5b978af18ec1d

On Windows, the first CUDA graph capture after the renderer's first
frame can stall for many minutes. This PR applies the workaround from
@shi-eric's analysis in #8342: record one tiny allocation in a CUDA
graph when `SimulationContext` is created, so the CUDA driver reserves
graph memory before anything can block its placement.

Fixes #8342. Supersedes #8528.

- The first allocation recorded in a CUDA graph makes the driver reserve
a large virtual-address range for graph memory (96 GiB on our machine).
- Cubric allocates managed memory, which creates a 52 GiB managed-memory
window. The driver places the graph-memory range directly above that
window.
- When a rendered frame already occupies those addresses, the driver
retries placement 2 MiB higher each time, at about 0.8 s of kernel CPU
per attempt. The GPU stays idle; getting past the blocked range takes
about 15 minutes.
- #8058 moved Newton's first capture to the first physics step, after
the first frame. MuJoCo-Warp allocates temporaries on every step, so the
capture contains allocations.

- `isaaclab.utils.device.reserve_cuda_graph_memory(device)`: records one
`wp.empty(1)` inside `wp.ScopedCapture`, once per CUDA device. It skips
non-CUDA devices, devices with the Warp memory pool disabled, and
devices that are already capturing. A failure is logged as a warning and
never blocks startup.
- `SimulationContext.__init__` calls it right after selecting the
device, before physics backends and renderers are created. Every entry
point (environments, benchmarks, tests) goes through this path.
- Runs on all platforms; on platforms without the driver issue the extra
capture is harmless.

Windows 11, RTX 6000 Ada, driver 596.72,
`Isaac-Lift-KukaAllegro-Camera`, 1024 envs, `newton_mjwarp`, capture
watchdog 8–15 s:

| Setup | `develop` | This PR |
|---|---|---|
| OVRTX (kitless),
`presets=newton_mjwarp,ovrtx,single_camera,simple_shading_full_mdl64` |
about 70% of runs stalled | 0 / 10 |
| Kit with Isaac Sim RTX,
`presets=newton_mjwarp,isaacsim_rtx,single_camera` | 7 / 8 stalled | 0 /
8 |

The Kit result means this stall is not limited to OVRTX: Kit with Newton
physics hits it too.

Other checks with the same workaround (applied at `gym.make`,
physics-only task, 8192 envs):

- A graph-memory trim right before Newton's capture does not release the
early reservation (0 / 8 stalls).
- Physics step, full environment step and peak GPU memory are within
noise of `develop`.

- Under Kit, Kit's renderer starts before `SimulationContext`, so the
reservation cannot precede it. It still precedes Cubric's managed memory
and the next rendered frame, which was enough in the measurements above.
- OvPhysX imports `ovstage` in `_prepare_stage_creation`, before this
call. OvPhysX with OVRTX was not measured.
- Linux, L40, and long training runs were not tested here.
- Kit with PhysX physics was not tested.

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

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

- [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` (ruff check and format on the changed files)
- [ ] 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
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

(cherry picked from commit c647410)
@isaaclab-bot

isaaclab-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

run-ci

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Oct 14, 2026
@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 14, 2026
@kellyguo11
kellyguo11 marked this pull request as ready for review October 14, 2026 00:42
@kellyguo11
kellyguo11 requested a review from a team October 14, 2026 00:42
@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge based on the inspected code.

Summary

Adds an early CUDA graph allocation to avoid long Windows stalls after rendering starts.

  • Simulation startup reserves CUDA graph memory before creating backends.

Reviews (1) · Last reviewed commit: "Reserve CUDA graph memory when the simul..." · Reviewed by Greptile

@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

Needs attention: Style consistency (1). Other reviewed categories look good.

  • PR description: The body explains provenance but does not substantiate “deterministic validation” or the measurable stall claim; provide or link revisions, command, workload, hardware, backend, environment count, warmup, metric, and validation result.
  • 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: The module docstring now omits graph-memory setup, obscuring the module’s responsibility; widen it to cover device selection and device-level initialization.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 1 inline finding.

Automated review; human maintainers own approval decisions.

wp.set_device(warp_device)


def reserve_cuda_graph_memory(device: str) -> None:

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.

🟡 Warning · Style Consistency — Module docstring no longer covers contents

The module docstring says "Internal utilities for selecting compute devices", but reserve_cuda_graph_memory selects nothing; it reserves a driver address range. Widen the module docstring to cover device selection and device-level setup.

@kellyguo11
kellyguo11 merged commit 286c039 into release/3.0.0 Oct 14, 2026
58 checks passed
@kellyguo11
kellyguo11 deleted the backport/release/3.0.0/pr-8539 branch October 14, 2026 01:35
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