Skip to content

[Bug Report] Windows: Newton CUDA graph capture hangs in a Warp allocation (regression from #8058, not fixed by #8316) #8342

Closed

Description

@egolubev-nvda

Describe the bug

On Windows, the first Newton physics step of an MJWarp camera task can hang forever while Isaac Lab records the CUDA graph. The main thread blocks in a Warp allocation (cuMemAllocAsync) inside NewtonManager.capture_graph. The GPU goes idle and the process never makes progress.

Stack at 1d5a8fc (py-spy, main thread, innermost first):

allocate (warp\_src\context.py:5044)
_init_new (warp\_src\types.py:3901)
__init__ (warp\_src\types.py:3418)
empty (warp\_src\context.py:9869)
make_constraint (mujoco_warp\_src\constraint.py:4873)
fwd_position (mujoco_warp\_src\forward.py:668)
forward (mujoco_warp\_src\forward.py:1349)
step (mujoco_warp\_src\forward.py:1371)
_mujoco_warp_step (solvers\mujoco\solver_mujoco.py:4153)
step (solvers\mujoco\solver_mujoco.py:4176)
_step_solver (isaaclab_newton\physics\newton_manager.py:1531)
_run_solver_substeps (isaaclab_newton\physics\newton_manager.py:1680)
_simulate_physics_only (isaaclab_newton\physics\newton_manager.py:1757)
capture_graph (isaaclab_newton\physics\newton_manager.py:269)
_capture_graph (isaaclab_newton\physics\newton_manager.py:1661)
step (isaaclab_newton\physics\newton_manager.py:761)
step (isaaclab\sim\simulation_context.py:584)

Stack at 382cbc6 (#8058): the same path, but stuck in _convert_contacts_to_mjwarp -> _create_inverse_shape_mapping -> wp.full -> allocate.

The same per-step allocations were already inside the recorded graph before #8058 without hanging. So another part of #8058 probably matters too, for example its replacement of the relaxed external capture on a dedicated non-blocking stream with wp.ScopedCapture. We have not isolated this.

Steps to reproduce

git checkout 1d5a8fce0eb3fdf2ba4eb0f5a441c61794c3fed1
uv sync --frozen
# OVRTX 0.6.0 / OVStage 0.3.0 Python packages and native libraries on the path (see note below)
$env:ISAAC_LAB_OVRTX_USE_OVSTAGE = '0'
$env:ISAAC_LAB_OVRTX_READ_GPU_TRANSFORMS = '1'
python -m isaaclab.benchmark.entrypoints.runtime --task Isaac-Lift-KukaAllegro-Camera --num_envs 8192 `
    --num_steps 3 --warmup_steps 3 --seed 42 --device cuda:0 `
    presets=newton_mjwarp,ovrtx,single_camera,simple_shading_full_mdl64

A good run finishes in 0.5 to 1.5 minutes. A hung run prints [INFO]: Completed setting up the environment... and then nothing more. Run it several times: the hang is intermittent. ISAAC_LAB_OVRTX_USE_OVSTAGE=1 hangs too.

The attached zip contains a PowerShell script that automates the runs, classifies each one from a py-spy stack and records the loaded OVRTX/OVStage DLLs, plus logs and stacks from all runs.

Note: we reproduced this with OVRTX 0.6.0 / OVStage 0.3.0 built from source. We have not tried the versions in uv.lock (ovrtx 0.5.0.377615, ovstage 0.2.0.377349).

System Info

  • Commit: 1d5a8fc (also 382cbc6 and every later commit we tested, up to c9a40a1)
  • Isaac Sim Version: not used (kitless Isaac Lab with OVRTX)
  • OS: Windows 11 Enterprise 10.0.26200
  • GPU: RTX 6000 Ada (driver 596.72); also L40 (driver 596.86)
  • CUDA: from uv.lock (torch 2.12.0+cu130, warp-lang 1.17.0, mujoco-warp 3.12.0)
  • GPU Driver: 596.72 and 596.86

Additional context

  • One full benchmark on Linux (L40, driver 595.91.07) at c9a40a1 did not hang.
  • A workaround that ran one physics step eagerly before every capture let the camera smoke step pass once at c9a40a1. Per-step allocations stay inside the recording, so this is not expected to be reliable.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • Isaac-Lift-KukaAllegro-Camera with presets=newton_mjwarp,ovrtx,... passes repeated runs on Windows without hanging in Newton graph capture
  • No Warp allocation happens inside the Newton graph recording on Windows, or capture uses a mode that tolerates it

Activity

  1. egolubev-nvda commented on Oct 6, 2026

    @egolubev-nvda
    ContributorAuthor
  2. RandomOakForest commented on Oct 7, 2026

    @RandomOakForest
    Collaborator

    Thank you for posting this. Is it possible to update to v3.0.0 EA (ae37b02)? However, it seems those commits you used should be good enough. The team is reviewing this. Thank you.

  3. added
    bug
    on Oct 7, 2026
  4. shi-eric commented on Oct 9, 2026

    @shi-eric

    Our traces point to a Windows CUDA driver bug in virtual-address placement. An early allocation-only capture avoided the hang in our tests and looks like a practical workaround.

    What we found

    We reproduced the hang on an A40 running Windows 11 build 26100, WDDM, driver 595.97, at Isaac Lab 1d5a8fc, with Warp 1.17.0 and the public OVRTX 0.5.0.377615 / OVStage 0.2.0.377349 packages. The reporter’s source builds are not required.

    The first captured allocation reserves a graph-memory virtual-address range, observed here as 96 GiB. This is an address reservation, not physical GPU memory consumption. An earlier managed allocation from OVStage/Cubric initializes UVM-Lite. If graphics reservations occupy CUDA’s candidate address, the driver retries placement 2 MiB higher each time. Each failed attempt takes 1 to 3.8 seconds of kernel CPU time to release its UVM-Lite reservation. The GPU stays idle while the CPU works through this loop.

    We reproduced the same stall using only CUDA Python bindings and ctypes, without Warp or a renderer: one managed allocation, a GPU address reservation outside CUDA, then one captured 32 KiB cuMemAllocAsync. A 16 MiB obstacle caused a 15 to 18 second stall in 14 of 18 fresh processes. The other four placed the range elsewhere. Without managed memory, the same obstacle took about 1 ms. An early captured allocation also avoided the stall.

    The internal reservation failure is inferred from these experiments; we have not identified the exact renderer allocation occupying the range.

    Why the eager warm-up did not help

    Eager allocations use the ordinary pool; captured allocations create graph-owned memory nodes, as described in the CUDA Driver API. Warming up physics eagerly leaves the first graph-memory reservation until capture.

    #8058 moved kitless capture from environment creation to the first physics step, after the conflicting reservations appear. The previous kitless path already used standard wp.ScopedCapture.

    A fresh nonblocking stream still hung. With OVStage, ISAAC_LAB_OVRTX_READ_GPU_TRANSFORMS=0 also hung in both tested runs because the managed allocation remained. Disabling Warp’s memory pool causes captured allocations to fail.

    Recommended workaround

    Capture one tiny allocation during startup, before creating the environment, OVStage, and renderer:

    import warp as wp
    
    
    def reserve_graph_memory(device="cuda:0"):
        with wp.ScopedCapture(device=device, force_module_load=False):
            scratch = wp.empty(1, dtype=wp.int32, device=device)
            del scratch
    
    
    wp.init()
    reserve_graph_memory("cuda:0")
    
    # Create the environment, OVStage, and renderer after this point.

    Call it once per simulation CUDA device, outside any existing capture, and keep Warp’s memory pool enabled. It requires no graph replay and does not advance physics. On the tested driver, later captures reused the range after the warm-up graph was discarded.

    Validation and limits

    Interleaved fresh-process runs of the original 8,192-environment camera benchmark gave:

    Variant Runs that hung
    Unmodified baseline 6 / 8
    Tiny capture at entry to gym.make, before environment creation 0 / 6
    Tiny capture during solver setup, at Newton’s former capture point 0 / 6

    The traces showed no new range-placement attempt during physics capture in any warm-up run. We recommend the earlier placement because it precedes managed-memory initialization and graphics reservations.

    Validation so far covers this A40 and the short smoke benchmark. We have not tested v3.0.0 EA (ae37b02), the reporter’s RTX 6000 Ada/L40, or long training and recapture. Later creation of CUDA contexts, pools, or additional address windows could encounter the same driver path.

    The early capture should be validated on the affected systems. A CUDA driver bug report using the reduced reproducer is the appropriate follow-up for addressing the underlying behavior.

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions