Repository navigation
Pin the OVRTX render product to the renderer's CUDA device - #7347
kellyguo11 merged 2 commits into
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot
The change threads an optional CUDA device index through the OVRTX USD builders and pins each renderer-created RenderProduct to the device used by its Warp kernels. Both legacy and ovstage initialization paths are wired, while callers that omit the new argument retain automatic OVRTX device assignment.
- Design and architecture: Reusing
OVRTXRenderer._device_id, already used for constrained binding maps, keeps render-product allocation and kernel execution aligned without widening the shared renderer specification. The existing PPISP clone remains available when a mapped HDR buffer does not land on the output device. - API:
build_render_scope_usdandbuild_render_product_as_stringadd a trailing optionaldevice_id: int | None = Noneparameter with corresponding documentation. Existing callers remain compatible, and omitting the parameter leavesdeviceIdsunauthored as before. - Implementation: The
uint[] deviceIdsauthoring was traced through both renderer initialization paths, and tests cover the parsed USD type/value, omission behavior, and legacy renderer wiring from acuda:1specification. The package changelog is present. Residual validation risk is limited to the reported multi-GPU hardware scenario, which was not exercised directly; the patch validates the USD and producer wiring instead.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
Greptile SummaryThe PR pins OVRTX render products to the renderer’s CUDA device so mapped render buffers and consuming Warp kernels use the same GPU.
Confidence Score: 5/5The PR appears safe to merge, with both render-product creation paths consistently pinning OVRTX buffers to the renderer’s CUDA device. The new parameter is backward compatible, produces valid typed USD, is wired through both initialization implementations, and no reachable changed-code failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CameraRenderSpec device] --> B[OVRTXRenderer device index]
B --> C[RenderProduct deviceIds]
C --> D[OVRTX render-var buffers]
B --> E[Warp extraction kernels]
D --> F[Same-device tile extraction]
E --> F
Reviews (1): Last reviewed commit: "Pin the OVRTX render product to the rend..." | Re-trigger Greptile |
The RenderProduct was authored without a deviceIds attribute, so OVRTX picked the render device itself and returned render var buffers on CUDA 0. The tile extraction kernels launch on the simulation device, so on a multi-GPU machine running with device cuda:1 they read a CUDA-0 DLPack buffer. Without peer access between the two GPUs that is an illegal memory access (CUDA error 700); with peer access it silently reads across the link. Author deviceIds from the same CUDA index already used to constrain the transform bindings' binding.map() calls, on both the legacy and ovstage initialization paths, so every OVRTX buffer the renderer reads is allocated on the device its kernels run on.
a93587b to
574cb0e
Compare
|
I have put in the PR description to backport this to |
Backports #7347 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 | `a2db45885453779bdec71f57b3c5d91f958b713f` | | Release base used | `def4b80288de2a8bac3abad4d2e7cdb80b849a4f` | | Proposed backport | `7db3a4902c045a56b31345c231e4afb430f2da29` | --------- Co-authored-by: Matthew Taylor <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
…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]>
Description
IsaacLab creates its OVRTX
RenderProductwithout authoringdeviceIds. OVRTX therefore picks the render device itself, places the render product on CUDA 0, and correctly returns a CUDA-0 DLPack buffer fromrender_var.map(device=Device.CUDA). The camera tile extraction kernels, however, launch withdevice=self._device— the simulation device. On a multi-GPU machine running with--device cuda:1,extract_all_tiles_kernelthen reads a CUDA-0 buffer from CUDA 1. On a machine without peer access between the two GPUs that is an illegal memory access and the run aborts with CUDA error 700; where peer access is available it silently reads across the link instead of failing.This authors
uint[] deviceIds = [<cuda index>]on the render product, resolving the index with the same helper the attribute mappings use (ovrtx_mapping.cuda_device_id, promoted from_cuda_device_idso both callers share one parser). Both initialization paths — legacy and ovstage — pass it, so every OVRTX buffer the renderer reads is allocated on the device its kernels launch on. The generated prim matches the form OVRTX documents in its owndoc-pin-render-product-to-gpu-0-usdasnippet:device_id=Nonekeeps OVRTX's automatic assignment, so the USD builders behave exactly as before for any caller that does not pass a device.This also resolves the
FIXMEin_prepare_ppisp_hdr_source, whose stated precondition ("until render var mapping can be constrained like transform bindings") is now met. Itswp.clonestays as a fallback for the case OVRTX logs as "deviceIds ... not in the active device set" and reverts to automatic assignment; the comment is updated to say so.Fixes # (issue)
Type of change
Release backport
developTesting
Three tests added, each verified to fail on the unfixed sources and pass with the fix:
test_render_product_pins_device_ids_to_the_requested_cuda_device— parses the authored snippet throughSdf.Layerand assertsdeviceIdsis aUIntArrayequal to[1].test_render_product_omits_device_ids_when_no_device_is_given— nothing authored when no device is given.test_create_render_data_pins_the_render_product_to_the_spec_device— covers the wiring: a spec oncuda:1produces a render product pinned to device 1._make_ovrtx_renderer_without_backendbypasses__init__, so it now sets_deviceto the same default__init__uses.Not verified here: the multi-GPU, no-peer-access machine from the report. The change is validated at the USD authoring and renderer wiring level only.
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.mdor my name already exists there