Skip to content

Fix per-sensor render products in OVRTX - #7860

Merged
StafaH merged 8 commits into
isaac-sim:developfrom
pbarejko:pbarejko/multi-render-product
Sep 21, 2026
Merged

StafaH merged 8 commits into
isaac-sim:developfrom
pbarejko:pbarejko/multi-render-product

Conversation

@pbarejko

@pbarejko pbarejko commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Description

OVRTX camera sensors sharing a renderer previously reused the first sensor’s render product and camera bindings. This caused sensors to receive images from the same product, while pose updates could overwrite another sensor’s viewpoint.

Each sensor now owns a separate tiled render product and camera bindings, while sharing the renderer and scene. For example:

  • env0/cam0, env1/cam0 → RP0
  • env0/cam1, env1/cam1 → RP1

The change supports independent resolutions, output types, and pose updates on both the default and external-ovstage paths. OVRTXRenderData.cleanup() owns per-camera resource teardown, allowing other sensors to continue rendering.

Addresses the camera-ownership portion of #7772. Temporal instability remains a separate investigation, so this PR should not close that issue.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • 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 (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Release backport

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

@pbarejko
pbarejko requested a review from a team September 16, 2026 23:39
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 16, 2026
@pbarejko pbarejko self-assigned this Sep 16, 2026
@pbarejko

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 Sep 16, 2026
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule violations identified.

Summary

This PR separates OVRTX camera-sensor resources while preserving a shared renderer and scene.

  • Assigns each camera sensor its own tiled render product and transform binding or query.
  • Registers additional products dynamically on both legacy and external-ovstage paths.
  • Makes per-camera cleanup independent and idempotent.
  • Adds integration coverage for differing resolutions, output types, pose updates, and cleanup.
  • Documents the resulting ownership model and initialization requirement.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    RC[Render context] --> OR[Shared OVRTX renderer and scene]
    OR --> RP0[Camera sensor 0 render product]
    OR --> RP1[Camera sensor 1 render product]
    RP0 --> B0[Sensor 0 transform binding/query]
    RP0 --> O0[Sensor 0 output buffers]
    RP1 --> B1[Sensor 1 transform binding/query]
    RP1 --> O1[Sensor 1 output buffers]
    C0[Cleanup sensor 0] --> RP0
    C0 --> B0
    RP1 --> CONT[Sensor 1 continues rendering]
Loading

Reviews (1) · Last reviewed commit: "Mutli camera rendering for ovrtx"

@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 per-sensor render-product and pose-binding model addresses independent OVRTX camera rendering, but two ownership/API inconsistencies remain: the first camera’s embedded render product is not removed during camera cleanup, and the render-var path helper still reports only the default /Render scope.

  • Design and architecture: Per-camera OVRTXRenderData ownership is coherent for cameras registered through _register_camera. However, the first camera remains asymmetric: its pose resources move into the per-camera ExitStack, while its render product stays embedded in the shared stage until renderer shutdown, despite camera cleanup removing its bookkeeping entry.
  • API: The trailing render_scope_name="Render" parameters preserve existing callers and default paths. However, render_var_prim_paths_by_source() still documents and returns fixed /Render/Vars/... paths even though subsequent cameras author render vars under RenderCamera_N; the helper must become scope-aware or explicitly document its restricted meaning.
  • Implementation: Per-product rendering, camera relationship updates, pose bindings, and idempotent per-camera buffer cleanup are implemented for both legacy and ovstage paths. The remaining implementation issue is that only dynamically registered camera products receive removal callbacks, so cleaning up the initial camera leaves its native product resident until the shared renderer closes.

Minor fixes needed. Posted 2 actionable findings inline.

Automated review; human maintainers own approval decisions.

if not self._initialized_scene:
self._initialize_from_spec(spec)
return OVRTXRenderData(spec, self._device)
render_data.render_product_path = self._render_product_paths[0]

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 · Design Architecture — First camera's render product is never released

The initial product is authored into the combined stage string by _initialize_from_spec, so only its path and pose handle are moved into render_data. Unlike cameras added via _register_camera, no removal callback is registered, so cleanup() drops bookkeeping while the native product stays resident until close(). Register an equivalent product-removal callback for the first camera, or author it as a removable reference like the others.


render_var_configs = get_render_var_configs(data_types)
render_var_configs = [

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.

🔵 Suggestion · Api — Render-var path helper stale for per-camera scopes

Render vars are now rewritten into /{render_scope_name}/Vars/..., but render_var_prim_paths_by_source() still returns fixed /Render/... paths and documents them as "the authored RenderVar prim path of every OVRTX render-var source". That statement now holds only for the first camera; cameras in RenderCamera_N scopes author elsewhere. Make the lookup scope-aware or document the restriction.

@pbarejko

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 Sep 17, 2026
Comment on lines +591 to +595
self._renderer.open_usd_from_string(self._exported_usd_string)
self._exported_usd_string = None # Free memory
reference = self._renderer.add_usd_reference_from_string(
f'#usda 1.0\n(defaultPrim = "{scope}")\n' + render_product_string, f"/{scope}"
)

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.

I am not sure I understand this mechanics correctly. My understanding was that render products references the exported usd stage, so I thought we should open usd from render_product_string and add usd reference from _exported_usd_string.

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.

This is a question to be clear.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think you understood the issue in another comment. This function has weird name, initialization. I made a small change to rename initialize to initialize_camera_render_data but for the interface change we would have to tackle that as a separate PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added few renames, but the interface rename needs to be addressed in a separate PR.

@mataylor-nvidia

Copy link
Copy Markdown
Contributor

I reproduced a failure with two camera sensors and two environments on 0e4e5f6c using a cfg-driven kitless Newton scene with default cloning contexts, without explicit USD replication.

Camera._initialize_impl() discovers camera paths from the source USD stage. Logging the actual specification during InteractiveScene initialization showed num_instances=2 but only ("/World/envs/env_0/wrist_camera",) in camera_prim_paths. The environment 1 copy exists in OVRTX's cloned scene. The first sensor's initializer expands the paths across environments, but _register_camera() uses the source-only list directly. In the real scene, sim.reset() then fails when updating the second sensor's poses:

tensor shape[0] (2) must equal binding prim count (1)

The existing integration test supplies all environment paths manually. The test change below retains that case and adds source-stage discovery using the same lookup as Camera._initialize_impl().

GPU verification (NVIDIA A40, OVRTX 0.4.1.364340):

  • Current PR: both source-only cases fail. The default path returns inf depth for environment 1 instead of 3.5; the external-stage path raises INVALID_ARGUMENT because omni:resetXformStack receives two values for one prim.
  • With the proposed fix applied temporarily in the local checkout: all four combinations pass (expanded/source-only paths × default/external-stage), including the independent-pose and cleanup checks.

Regression test:

diff --git a/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py b/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py
index d8b860810a..e0fd9e58aa 100644
--- a/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py
+++ b/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py
@@ -139,9 +139,11 @@ def test_ovrtx_supported_output_types_key_set():
 @pytest.mark.integration
 @pytest.mark.rendering
 @pytest.mark.parametrize("use_ovstage", [False, True])
-def test_ovrtx_multiple_cameras_render_independent_views(monkeypatch, use_ovstage, tmp_path):
+@pytest.mark.parametrize("source_only_paths", [False, True], ids=["expanded", "source-only"])
+def test_ovrtx_multiple_cameras_render_independent_views(monkeypatch, use_ovstage, source_only_paths, tmp_path):
     """Check independent camera batches and save RGB/depth frames under pytest's temporary directory.
 
+    Cover both expanded camera paths and Newton's source-only USD camera paths.
     Use ``--basetemp=/tmp/ovrtx-camera-frames`` to choose where pytest writes the captures.
     Depth PNGs use a shared 0-8 m range (near is white); NPY files retain the raw depths [m].
     """
@@ -151,6 +153,7 @@ def test_ovrtx_multiple_cameras_render_independent_views(monkeypatch, use_ovstag
 
     from isaaclab.cloner.clone_plan import ClonePlan
     from isaaclab.renderers.camera_render_spec import CameraRenderSpec
+    from isaaclab.sim import find_matching_prims
     from isaaclab.utils.math import convert_camera_frame_orientation_convention
     from isaaclab.utils.warp import ProxyArray
 
@@ -221,11 +224,16 @@ def test_ovrtx_multiple_cameras_render_independent_views(monkeypatch, use_ovstag
                 ["rgb", "distance_to_image_plane"] if index == 0 else ["rgb", "distance_to_image_plane", "normals"]
             )
             cfg.height, cfg.width = height, width
+            cfg.prim_path = f"/World/envs/env_[^/]+/cam{index}"
+            camera_paths = tuple(f"/World/envs/env_{i}/cam{index}" for i in range(2))
+            if source_only_paths:
+                # Match Camera._initialize_impl: discover paths in the source USD stage.
+                camera_paths = tuple(str(prim.GetPath()) for prim in find_matching_prims(cfg.prim_path, stage))
             spec = CameraRenderSpec(
                 cfg=cfg,
                 device="cuda:0",
                 num_instances=2,
-                camera_prim_paths=tuple(f"/World/envs/env_{i}/cam{index}" for i in range(2)),
+                camera_prim_paths=camera_paths,
                 view_count=2,
                 camera_path_relative_to_env_0=f"cam{index}",
             )

Proposed fix: construct the paths for all cloned environments after validating the source path, matching first-sensor initialization.

diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
@@ -974,6 +974,9 @@ class OVRTXRenderer(BaseRenderer):
         camera_paths = list(spec.camera_prim_paths)
         if not camera_paths or not camera_paths[0].startswith("/World/envs/env_0/"):
             raise ValueError("OVRTX cameras must be under /World/envs/env_0/.")
+        camera_paths = [
+            f"/World/envs/env_{i}/{spec.camera_path_relative_to_env_0}" for i in range(spec.num_instances)
+        ]
         scope = f"RenderCamera_{self._next_camera_id}"
         data_types = list(spec.cfg.data_types or ["rgb"])
         if spec.cfg.isp_cfg is not None and "rgb_hdr" not in data_types:

Run the new cases with:

uv run --extra ovrtx --extra test python -m pytest \
  source/isaaclab_ov/test/test_ovrtx_renderer_contract.py \
  -k 'multiple_cameras_render_independent_views and source-only' -q

@pbarejko
pbarejko force-pushed the pbarejko/multi-render-product branch from 0e4e5f6 to bdb0319 Compare September 21, 2026 16:47
@pbarejko

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 Sep 21, 2026
@pbarejko

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 Sep 21, 2026
@pbarejko

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 Sep 21, 2026
@StafaH
StafaH merged commit eaab09f into isaac-sim:develop Sep 21, 2026
82 of 84 checks passed
ooctipus added a commit to ooctipus/IsaacLab that referenced this pull request Sep 21, 2026
Resolve the OVRTX conflicts with per-sensor render products from isaac-sim#7860.
Keep calibration bindings in each camera's resource stack and reuse its
ovstage pose query for intrinsic updates. Preserve direct and renderer-led
cleanup and independent camera selection in the contract tests.

Validation: 46 OVRTX contract, rendered behavior, and architecture checks
passed; full formatting and merge-content audits passed.
StafaH pushed a commit that referenced this pull request Sep 22, 2026
Backports #7860 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 | `eaab09fd0a61ea1fe84067d25172797abc30b89a` |
| Release base used | `5da679fe1cef93813e5fc52dce0db81b6faae19e` |
| Proposed backport | `8889ead77e32eb4257b4925ba059c603ced9b901` |

Co-authored-by: Piotr Barejko <[email protected]>
@pbarejko pbarejko mentioned this pull request Sep 22, 2026
8 tasks
pbarejko added a commit that referenced this pull request Sep 22, 2026
# Description

* Update left overs related to `/Render` scope prefix that hasn't been
addressed in the previous PR
#7860
* Address breaking change in the integration between 0.4 and 0.5.
Previously we looked up outputs using Labels, now we need to use full
path to get access to RenderVarOutput.
* Refactor core functions and tests related to the logic above.

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (existing functionality will not work without user
modification)
- Documentation update

## Release backport

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

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [ ] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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 (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
StafaH pushed a commit to StafaH/IsaacLab that referenced this pull request Sep 23, 2026
# Description

* Update left overs related to `/Render` scope prefix that hasn't been
addressed in the previous PR
isaac-sim#7860
* Address breaking change in the integration between 0.4 and 0.5.
Previously we looked up outputs using Labels, now we need to use full
path to get access to RenderVarOutput.
* Refactor core functions and tests related to the logic above.

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (existing functionality will not work without user
modification)
- Documentation update

## Release backport

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

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [ ] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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 (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

(cherry picked from commit 446f841)
ooctipus added a commit that referenced this pull request Sep 24, 2026
…ng docs (#7957)

Backports the three changes from the September 20–23 `develop` audit
that are missing from `release/3.0.0`, alongside the existing
cloning-guide backport:

- #7722 (`4cf439dfeb`): reject a second `SimulationContext` construction
instead of silently discarding its configuration. Includes the original
fixture cleanup and regression coverage.
- #7893 (`22fcd71bc4`): validate DelayBuffer lag values before mutating
its live configuration.
- #7947 (`6e9ef17f59`): make `v3.0.0-EA` the default documentation
version in deployment and local multi-version builds.
- #7129 (`354168560f`): clarify that `replicate_physics=False` skips the
active physics context while other declared replication contexts still
run.

**Compatibility:** repeated `SimulationContext(...)` calls now raise.
Retrieve the live context with `SimulationContext.instance()`, or call
`clear_instance()` before constructing a replacement. The original major
changelog fragment includes this migration.

The runtime and test files match current `develop`. The docs-default
backport adapts the release branch's existing redirect template,
validates the target page, and preserves explicit overrides. The
cloning-guide backport preserves the current release APIs; its obsolete
sections were already removed.

## Release audit

Checked all **35 PRs** merged into `develop` from **2026-09-20 16:43:18
UTC** through `cff81e8473` (September 23), against release head
`5d3e0b695e`. **32 are already covered; the remaining three are included
here.** Git history, patch equivalence, GitHub's merged PR list, and
remaining file differences were checked. Branch-specific
version/changelog compilation and existing release-only changes are
preserved.

<details>
<summary>Already covered PRs</summary>

26 have an equivalent patch in release: #7919, #7922, #7923, #7924,
#7925, #6758, #7928, #7902, #7927, #7891, #7931, #7691, #7861, #7929,
#7916, #7939, #4609, #7942, #7940, #7948, #7937, #7955, #7960, #7961,
#7970, #7958.

Six were squash-merged or adapted: #7530 and #7899 in #7926; #7637 in
#7933; #7860 in #7936; #7954 and #7950 in #7964. Their implementation
differences were checked against the current release tree.

</details>

## Validation

- **276 tests passed**: SimulationContext (51, including CPU/CUDA),
headless context construction (15), nine schema/fragment suites (165),
four manager suites (38), and DelayBuffer (7).
- Both backported regressions reproduce with the original release
implementations.
- Docs redirect recipe: local/deployment EA defaults, explicit override,
and missing-target rejection passed with a stubbed Sphinx builder.
- All 22 changed files match the intended backport scope; `uv run
isaaclab -f` and `git diff --check` passed.
- Fresh Sphinx validation (`-b dummy -W --keep-going`): passed without
warnings, excluding static assets as the HTML builder does. Full HTML
documentation CI is running.

Local runtime validation used PyTorch 2.12.0, CUDA 13.0, Isaac Sim
6.0.1.0, and an RTX 5090. Existing runtime/deprecation warnings
occurred; the CI jobs validate the pinned environments.

The previous [docs CI
failure](https://github.com/isaac-sim/IsaacLab/actions/runs/35795116307/job/106972539281)
was an external connection reset fetching the Omniverse intersphinx
inventory, producing one warning under `-W`. That URL returned HTTP 200
when rechecked. This update starts a fresh docs build.

---------

Co-authored-by: hujc <[email protected]>
Co-authored-by: Zihan Xu <[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