Skip to content

fix: Cache the resolved Warp device on the OVRTX renderer - #7169

Merged
kellyguo11 merged 4 commits into
isaac-sim:developfrom
pv-nvidia:pv/ovrtx-warp-device-cache
Aug 27, 2026
Merged

kellyguo11 merged 4 commits into
isaac-sim:developfrom
pv-nvidia:pv/ovrtx-warp-device-cache

Conversation

@pv-nvidia

@pv-nvidia pv-nvidia commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

The OVRTX renderer re-derived its CUDA device per call site from the device string, which split a bare "cuda" across GPUs on multi-GPU processes: attribute mappings parsed it to device 0 while Warp enqueued the fill kernels and resolved sync streams on its current CUDA device.

The renderer now resolves the Warp device once in create_render_data, normalizes its device string from it, and derives every mapping device id and CUDA sync stream (transform mappings, particle ASYNC writes, render-var reads) from the cached device. map_attribute_for_warp_writes takes the resolved Warp device instead of a string, so the mapped device and the sync stream cannot diverge at a call site. The device's current stream is still read at use time rather than cached — the stream legitimately changes (e.g. CUDA graph capture), the device does not.

Type of change

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

Release backport

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

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • 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

@pv-nvidia pv-nvidia self-assigned this Aug 19, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Aug 19, 2026
@pv-nvidia
pv-nvidia force-pushed the pv/ovrtx-warp-device-cache branch from 42c833b to 852b810 Compare August 20, 2026 12:10
@pv-nvidia
pv-nvidia marked this pull request as ready for review August 20, 2026 14:39
@pv-nvidia
pv-nvidia requested a review from a team August 20, 2026 14:39
@pv-nvidia
pv-nvidia force-pushed the pv/ovrtx-warp-device-cache branch from 852b810 to bc80b83 Compare August 20, 2026 14:39
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR resolves and caches the OVRTX renderer's Warp device when render data is created, then consistently uses that resolved device for CUDA mappings and synchronization streams.

  • Normalizes the renderer device string from the resolved Warp device.
  • Uses the cached device ordinal for mapped attribute writes.
  • Reads the cached device's current stream at each synchronization point.
  • Updates renderer contract and deformable-binding tests for the resolved-device interface.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The cached device is established before affected renderer operations, shared cameras use the same simulation-level device, and mappings and synchronization streams now consistently derive from that resolved device.

Important Files Changed

Filename Overview
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_mapping.py Replaces device-string parsing with a resolved Warp device, keeping mapping ordinals and commit streams aligned.
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py Caches the resolved device during render-data creation and consistently derives mapping and synchronization state from it.
source/isaaclab_ov/test/test_ovrtx_renderer_contract.py Updates mapping and render-variable synchronization tests to exercise resolved device ordinals and streams.
source/isaaclab_ov/test/test_ovrtx_deformable_bindings.py Updates geometry-write tests to provide the renderer's cached Warp device and verify stream propagation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Spec[Camera render spec device] --> Resolve[wp.get_device]
    Resolve --> Cache[Cached Warp device]
    Cache --> Normalized[Normalized device string]
    Cache --> Ordinal[CUDA mapping device ordinal]
    Cache --> Stream[Current CUDA stream]
    Stream --> Writes[OVRTX asynchronous writes]
    Stream --> Reads[Render-variable synchronization]
    Stream --> Unmap[Mapped-attribute commit]
Loading

Reviews (1): Last reviewed commit: "Cache the resolved Warp device on the OV..." | Re-trigger 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

The renderer now resolves and caches a Warp device in create_render_data, then consistently derives mapping ordinals and current CUDA streams from it. This addresses the bare "cuda" multi-GPU mismatch, but the exported mapping helper’s incompatible parameter change needs compatibility handling or explicit breaking-change migration guidance.

  • Design and architecture: Resolving the device at the render-spec boundary and using the cached wp.context.Device for OVRTX mappings and synchronization removes the previous divergence between mapped GPU and producer stream. Reading the device’s current stream at each use preserves stream changes while keeping device selection stable.
  • API: map_attribute_for_warp_writes changes its second parameter from a device string to a resolved Warp device, so existing string callers fail when .ordinal is accessed. Because the helper is exposed as a package-level API, it should either continue accepting strings and normalize them internally or be documented as breaking with migration guidance.
  • Implementation: The changed mapping, particle, cable, camera, and render-variable paths consistently use the cached device’s ordinal or current stream. The cached device is initialized through create_render_data before the traced binding-backed paths execute; the actionable implementation issue is preserving compatibility for callers of the changed helper.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two changes requested:

  1. Preserve compatibility for the exported mapping helper.

map_attribute_for_warp_writes is part of the public isaaclab_ov.renderers API, but this PR changes both the accepted type and the keyword name of its second parameter. Existing positional callers passing a string fail at .ordinal, while callers using device= fail with an unexpected keyword. Repository policy requires a deprecation before breaking a public API. Please retain the device parameter and accept str | wp.Device, resolving string inputs once with wp.get_device(); internal renderer callers can continue passing the cached device.

  1. Use the public Warp device type.

The project pins Warp 1.16.0, where wp.context is not exposed and wp.Device is the public type. Postponed annotations mean this does not break normal renderer execution, but typing.get_type_hints() and other annotation-resolving tooling fail with AttributeError. Please replace wp.context.Device with wp.Device in ovrtx_mapping.py and ovrtx_renderer.py.

The device/stream synchronization flow itself looks consistent. I ran the full pre-commit suite successfully against this head. The two focused OVRTX test files were collected locally but skipped because the optional OVRTX runtime was unavailable; the PR CI package and rendering checks are green.

@pv-nvidia
pv-nvidia changed the base branch from develop to release/3.0.0-beta2 August 22, 2026 12:26
@pv-nvidia
pv-nvidia changed the base branch from release/3.0.0-beta2 to develop August 22, 2026 12:26
@pv-nvidia
pv-nvidia changed the base branch from develop to release/3.0.0-beta2 August 22, 2026 12:27
@pv-nvidia
pv-nvidia changed the base branch from release/3.0.0-beta2 to develop August 22, 2026 12:27
@pv-nvidia
pv-nvidia force-pushed the pv/ovrtx-warp-device-cache branch 2 times, most recently from bc79aa3 to b76771f Compare August 24, 2026 12:44
create_render_data resolves the Warp device once and normalizes the
renderer's device string from it, so a bare "cuda" pins to Warp's
current CUDA device instead of being re-interpreted per call site --
previously the render-product device ids parsed it to device 0 while
Warp enqueued fill kernels and resolved sync streams on its current
device, splitting the work across GPUs on multi-GPU processes.

The render-product device ids and every CUDA sync stream -- object,
cable, particle and camera attribute writes on both the legacy and
ovstage paths, plus render-var reads -- now derive from the cached
device. The device's current stream is still read at use time, not
cached: the stream can legitimately change (e.g. CUDA graph capture),
the device cannot.
@pv-nvidia
pv-nvidia force-pushed the pv/ovrtx-warp-device-cache branch from b76771f to 311fe35 Compare August 26, 2026 11:08
map_attribute_for_warp_writes lost its last production caller when GPU
transform updates moved to caller-owned buffers (isaac-sim#7233), and this branch
removed the renderer's remaining cuda_device_id uses. Mapping OVRTX
attribute memory for per-frame GPU writes is also an anti-pattern worth
not keeping a polished helper for: each map/unmap cycle hides a
cudaMalloc/cudaFree, and the API is deprecated in ovrtx and refused in
BORROW attach mode. The changelog fragment carries the migration note.
Tests that call _initialize_from_spec directly bypass create_render_data,
which owns the device resolution, so the fixture now supplies the
resolved-device invariant. The render-product pinning test named a second
GPU this box may not have; Warp's resolution is faked so the test stays
about the render product, not the machine's GPU count -- rejecting a
nonexistent device at create_render_data is the new, intended behavior.
The pinned Warp 1.16 does not expose wp.context; wp.Device is the public
name for the same class. Postponed annotations kept the wrong path from
failing at runtime, but annotation-resolving tooling and any future move
of the annotation to a signature would hit AttributeError.
@pv-nvidia
pv-nvidia requested a review from StafaH as a code owner August 26, 2026 14:12

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@kellyguo11
kellyguo11 merged commit d7a73ee into isaac-sim:develop Aug 27, 2026
46 of 48 checks passed
kellyguo11 added a commit that referenced this pull request Sep 4, 2026
# Description

Backports the following merged `develop` PRs to `release/3.0.0`:

- #7220 — prune unused Docker volumes on package-test runners
- #7169 — cache the resolved OVRTX Warp device
- #6889 — move the OVPhysX collider cache out of the Python interpreter
directory
- #7345 — document the registered XR camera PiP tasks
- #7050 — update and reorganize the LEAPP documentation
- #7473 — register external RSL-RL tasks before agent discovery
- #7467 — update the China storage profile to Isaac Sim 6.1
- #7385 — accept legal float scale values when seeding Fabric frame
views from USD
- #7517 — use lazy exports in `isaaclab_rl`

The duplicate #7517 in the original request is included once.

Seven source commits replayed cleanly. Two required release-specific
reconciliation:

- #7169 retains the release branch's mapped OVRTX write path, which was
removed separately on `develop`, while resolving and caching one Warp
device for render-product IDs, mappings, and CUDA streams.
- #7050 preserves the #7494 export-backend clarification that is already
present on the release branch while applying the broader LEAPP
documentation overhaul.

No new dependencies are added.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- Performance improvement
- Documentation update
- CI/infrastructure update

## Release backport

- [ ] <!-- backport-active-release --> This PR already targets the
active release branch; do not backport it again.

## Validation

- `uv run --no-project --with pytest python -m pytest -q
.github/actions/run-package-tests/test_cleanup_docker_storage.py` — 10
passed
- Nine isolated `isaaclab_rl` namespace/lazy-import regression cases
passed
- Resolved-device OVRTX mapping behavior check passed with Warp 1.16.0
- `uv run --no-project python -m compileall -q` on all changed Python
modules and tests
- `uv run --no-project python tools/changelog/cli.py check` against the
exact `upstream/release/3.0.0` base
- `pre-commit==4.6.2 run --all-files` passed all available hooks
- `git diff --check upstream/release/3.0.0..HEAD`

The full project test environment and documentation build cannot resolve
on this macOS/arm64 host because the release lockfile supports Linux and
Windows only. The Git LFS hook was also unavailable because `git-lfs` is
not installed; none of the changed paths are LFS-tracked. Linux CI
remains authoritative for simulator, OVRTX, Fabric, and full
documentation validation.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the available formatting and static checks
- [x] I have included the corresponding documentation changes
- [x] Each touched source package includes its original changelog
fragment
- [x] Every backported commit records its source commit with `cherry
picked from commit`
- [x] The original contributors are preserved as commit authors

---------

Signed-off-by: Zeng Qingcheng <[email protected]>
Co-authored-by: myurasov-nv <[email protected]>
Co-authored-by: Peter Verswyvelen <[email protected]>
Co-authored-by: pv-nvidia <[email protected]>
Co-authored-by: hujc <[email protected]>
Co-authored-by: hougantc-nvda <[email protected]>
Co-authored-by: Frank Lai NV <[email protected]>
Co-authored-by: peterd-NV <[email protected]>
Co-authored-by: Sheikh Dawood <[email protected]>
Co-authored-by: Zeng Qingcheng <[email protected]>
Co-authored-by: Antoine RICHARD <[email protected]>
Co-authored-by: Mustafa H <[email protected]>
kellyguo11 pushed a commit that referenced this pull request Sep 4, 2026
…used buffer (#7233) (#7566)

# Description

Backport of #7233 (*Replace map transforms with pre-owned and reused
buffer*) to `release/3.0.0`.

This supersedes #7300, which was the original cherry-pick by @pbarejko.
That PR was approved on 2026-08-24 but has been unmergeable
(`mergeable=false`, `dirty`) ever since, so the fix never reached the
release branch. Authorship of the commit is preserved as @pbarejko.

## Why it conflicted

`ovrtx_renderer.py` diverged structurally between `develop` and
`release/3.0.0`. The backport of #7347 (landed as #7353) was not a
line-for-line cherry-pick — on `develop` #7347 changed 11 lines of that
file, while the release-side version changed 1348 (240+/1108−) and
restructured code that now only exists in that shape on the release
branch:

- `_close_legacy` was rewritten from explicit per-binding unbinds into a
`for attr, name in (...)` loop
- `except Exception as e` was renamed to `as exc`
- the close dispatch was restructured

The three-week-old cherry-pick was written against the pre-#7353 shape,
hence the conflicts.

## Conflict resolution

- The four renderer conflicts covering the buffer-write change itself
take the #7233 side.
- `_close_legacy` keeps **the release branch's** loop form and adds only
#7233's semantic contribution (`self._object_transform_buffer = None`).
Taking `develop`'s shape here would have silently reverted #7353.
- The test-file conflict was an add/add at the same line; all three
tests are kept.
- The follow-up `Reformat` commit was a single blank line already
covered by the resolution, so it drops out as a no-op.

## One deliberate change from the original PR

#7233 predates #7169, so it wrote
`cuda_stream=wp.get_stream(self._device).cuda_stream`. `release/3.0.0`
has since taken #7169 and standardized on
`self._warp_device.stream.cuda_stream` — that caching *is* #7169's fix.
Applying the original patch verbatim would have reintroduced a per-call
device lookup into the per-frame transform path, partially undoing a fix
already on the branch.

Both new call sites and the two new tests are aligned to the release
idiom instead. This is the one substantive delta from what was approved
on #7300 and is the part most worth a reviewer's attention.

## Type of change

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

## Release backport

This PR targets `release/3.0.0` directly; the change is already on
`develop` via #7233.

## Testing

- `source/isaaclab_ov/test/test_ovrtx_deformable_bindings.py` — 19
passed
- `source/isaaclab_ov/test/test_ovrtx_renderer_contract.py` — 37 passed
- Both new tests (`test_update_transforms_writes_caller_owned_buffer`,
`test_update_camera_writes_without_mapping`) were confirmed to **fail**
against the unpatched release renderer and pass with the change.

## 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
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

Co-authored-by: Piotr Barejko <[email protected]>
ooctipus added a commit that referenced this pull request Sep 26, 2026
…rer goldens (#8061)

# Description

Aligns `release/3.0.0` with `develop` for the remaining source behavior
and coordinated renderer baselines:

- Backports #8011 from merged commit
`5d208f81d4f8895b4e564ebebce232031171a3e8`, preserving its recursive
local/remote USD dependency resolution and regression coverage.
- Completes the applicable OVRTX cleanup from #7169 by removing the
now-unused `ovrtx_mapping` module and `map_attribute_for_warp_writes`
public export, plus their obsolete contract tests and API entry. Later
renderer backports already moved release to persistent caller-owned
buffers, so no production caller remains.
- Backports the coordinated portion of #7896: the updated Isaac Sim
nightly image digest and its matching Newton Cartpole RGB/RGBA golden
images. The associated SO-101 test change is already present on the
release branch through #8057.

The OVRTX removal includes a major changelog fragment with migration
guidance: use a persistent caller-owned Warp buffer with
`binding.write(..., cuda_stream=...)`; if mapping is unavoidable, pass
the producer stream to `unmap(stream=...)`.

After this update, a source-tree comparison against `develop` reports no
production-source differences other than the allowed package-version
fields in `pyproject.toml`.

## Type of change

- Bug fix / release backport
- Breaking removal of an unused public OVRTX helper
- Test-infrastructure baseline refresh

## Release backport

- [x] This PR targets `release/3.0.0`; no further backport is needed.

## Validation

- 27 kit-free asset tests passed for the #8011 change, including its
three MDL dependency parsing regressions.
- All changed-file pre-commit hooks passed, including Ruff, formatting,
codespell, RST checks, changelog validation, YAML validation, and Git
LFS pointer validation.
- Python compilation passed for the updated OVRTX contract test, and
`git diff --check` passed.
- The OVRTX source/API/test files, Isaac Sim digest, Cartpole golden
pointers, and golden-image skip fragment match `develop` exactly.
- The production-source comparison against `develop` is empty after
excluding branch-specific version metadata.
- `uv run isaaclab -f` and the full documentation build cannot resolve
on this macOS ARM64 host because the release lockfile supports Linux
x86_64/aarch64 and Windows AMD64. Simulator-backed rendering coverage
remains for Linux CI.

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run all locally available pre-commit checks.
- [x] Public API documentation and migration guidance were updated for
the OVRTX removal.
- [x] The touched source packages have appropriate changelog fragments.
- [x] The golden images are paired with the Isaac Sim image digest that
produced them.
- [x] The original #8011 contributors and commit remain preserved.

---------

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

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants