Fix benign OmniRtx*API schema errors with newton_rtx + ovphysx - #7653
Conversation
Fixes benign "[omni.rtx] FindAppliedAPIPrimDefinition(...) returned nothing" error logs when the newton_rtx visualizer is used alongside physics=ovphysx. USD's plug registry initializes once per process, typically triggered by the physics backend touching pxr well before any visualizer is constructed; registering ovrtx's schema paths later (inside NewtonViewerRTX) is too late. launch_simulation now prepares the ovrtx runtime up front, whenever newton_rtx is requested via CLI or config, before any physics backend can touch pxr. The prior per-visualizer patch is kept as a defense-in-depth fallback for callers that construct a viewer without going through launch_simulation, and both call sites now share one helper (isaaclab_ov.renderers.prepare_ovrtx_runtime) instead of duplicating the logic.
The implementation is not ready to merge until the existing visualizer-intent test is updated for the newly forwarded key. Findings
|
| "has_kit_streaming_view": any( | ||
| getattr(c, "visualizer_type", None) == "kit" and bool(getattr(c, "streaming_view", False)) for c in cfgs | ||
| ), | ||
| "has_newton_rtx_visualizer": any(getattr(c, "visualizer_type", None) == "newton_rtx" for c in cfgs), |
There was a problem hiding this comment.
Adding has_newton_rtx_visualizer changes the forwarded visualizer_intent mapping from three keys to four. However, test_launch_simulation_passes_visualizer_intent_to_applauncher still compares it with the exact three-key mapping, so the test now fails. Update the expected mapping to include the new key.
There was a problem hiding this comment.
Isaac Lab Review Bot
The early ovrtx schema registration addresses the USD plug-registry ordering issue, but the shared helper introduces an undeclared runtime dependency that can break supported package installations.
- Design and architecture: Calling the helper from both
launch_simulationandNewtonViewerRTXappropriately covers normal launch ordering and direct viewer construction. However, both paths now unconditionally cross intoisaaclab_ov, although the affected packages do not declareisaaclab-ovas a dependency. - API:
prepare_ovrtx_runtimeis exported and documented consistently, and visualizer intent detection covers CLI and config requests. Its use is not dependency-safe: an installation containingisaaclab-visualizers, Newton, and ovrtx but notisaaclab-ovcan now fail withImportErrorrather than applying this best-effort mitigation. - Implementation: The helper preserves the previous Linux path setup and performs schema registration before
ViewerRTXinitialization. Guard theisaaclab_ovimports or declare the required package dependency so the optional log-noise fix does not become a hard runtime requirement.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| # its USD schema/plugin paths with USD's plug registry before ``super().__init__()`` | ||
| # (below) reaches ``ViewerRTX``, which imports ``ovrtx`` and opens a stage referencing | ||
| # ``OmniRtx*API`` schemas. See :func:`~isaaclab_ov.renderers.prepare_ovrtx_runtime` for why. | ||
| from isaaclab_ov.renderers import prepare_ovrtx_runtime |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Unguarded cross-package import of isaaclab_ov
The removed inline logic used only stdlib, so NewtonViewerRTX worked with newton + ovrtx alone. The replacement unconditionally imports isaaclab_ov.renderers, but isaaclab-visualizers declares only isaaclab in the lock metadata (and isaaclab itself declares nothing), so an install without isaaclab-ov now raises ImportError during viewer construction — and in launch_simulation (line 539) — for a purely best-effort log-noise fix. Guard both imports with try/except ImportError or declare the dependency.
- Update the stale 3-key visualizer_intent assertion for the new has_newton_rtx_visualizer key (Greptile). - Guard the new isaaclab_ov.renderers.prepare_ovrtx_runtime imports with try/except ImportError in both launch_simulation and NewtonViewerRTX, since neither isaaclab nor isaaclab_visualizers declares isaaclab_ov as a dependency and this is a best-effort log-noise mitigation, not something a newton_rtx launch should hard-depend on (isaaclab-review-bot).
|
run-ci |
sim_launcher.py already imports OvPhysxCfg and OVRTXRendererCfg from isaaclab_ov unconditionally at module scope, so an install missing isaaclab_ov fails to import this module regardless of the guarded prepare_ovrtx_runtime call; the try/except suggested an optionality that did not exist here. The equivalent guard in NewtonViewerRTX.__init__ (isaaclab_visualizers, which does not depend on isaaclab_ov) is unaffected and stays as-is. Addresses huidongc's review feedback on PR isaac-sim#7653. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
run-ci |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
run-ci |
|
Backported to |
## Summary - Fixes benign `[omni.rtx] FindAppliedAPIPrimDefinition(...) returned nothing` errors when `newton_rtx` is used after another backend has initialized USD. - Treats the current `newton_rtx` viewer and `OVRTXRendererCfg` as OVRTX runtime consumers during the existing config scan. - Rejects incompatible Isaac Sim / Kit combinations before loading OVRTX, then calls OVRTX's own `register_schema_paths()` once before physics or user code can initialize USD. - Removes the public Isaac Lab setup helper, duplicate path resolution, visualizer-to-`isaaclab_ov` dependency, and best-effort fallback. Registration failures now fail at the selected runtime boundary. - Removes the obsolete `NewtonViewerRTX` environment-path workaround; pinned OVRTX 0.4.1 resolves its native library and schema paths itself. The resulting PR is +21 LOC overall and -18 production LOC against its develop base. ## Root cause USD's plugin registry is initialized once per process. `ovrtx.register_schema_paths()` must therefore run before a physics backend or renderer first accesses USD. Previously, OVPhysX could initialize USD before Newton constructed `ViewerRTX`, leaving the `OmniRtx*API` schemas undiscoverable. OVRTX already owns native-library discovery and schema-path publication. Isaac Lab only needs to invoke that primitive at the launch composition root after validating that no incompatible Kit runtime was selected. ## Test plan - `uv run --frozen --extra test python -m pytest source/isaaclab/test/app/test_launch_simulation_require_kit.py -q` — 9 passed. - Related launcher and visualizer suites — 74 passed. - Verified a config-declared `newton_rtx` registers OVRTX before storage setup and user code. - Verified CLI `newton_rtx` with Isaac Sim PhysX is rejected before OVRTX is loaded. - With `LD_LIBRARY_PATH` and `OMNI_USD_PLUGINS_BASE_PATH` unset, verified `ovrtx.register_schema_paths()` publishes the USD plugin path and `ovrtx.Renderer()` constructs successfully. - Changed-file formatting, lint, spelling, RST, and changelog checks pass. ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Octi Zhang <zhengyuz@nvidia.com> (cherry picked from commit eaf85e3)
Summary
[omni.rtx] FindAppliedAPIPrimDefinition(...) returned nothingerrors whennewton_rtxis used after another backend has initialized USD.newton_rtxviewer andOVRTXRendererCfgas OVRTX runtime consumers during the existing config scan.register_schema_paths()once before physics or user code can initialize USD.isaaclab_ovdependency, and best-effort fallback. Registration failures now fail at the selected runtime boundary.NewtonViewerRTXenvironment-path workaround; pinned OVRTX 0.4.1 resolves its native library and schema paths itself.The resulting PR is +21 LOC overall and -18 production LOC against its develop base.
Root cause
USD's plugin registry is initialized once per process.
ovrtx.register_schema_paths()must therefore run before a physics backend or renderer first accesses USD. Previously, OVPhysX could initialize USD before Newton constructedViewerRTX, leaving theOmniRtx*APIschemas undiscoverable.OVRTX already owns native-library discovery and schema-path publication. Isaac Lab only needs to invoke that primitive at the launch composition root after validating that no incompatible Kit runtime was selected.
Test plan
uv run --frozen --extra test python -m pytest source/isaaclab/test/app/test_launch_simulation_require_kit.py -q— 9 passed.newton_rtxregisters OVRTX before storage setup and user code.newton_rtxwith Isaac Sim PhysX is rejected before OVRTX is loaded.LD_LIBRARY_PATHandOMNI_USD_PLUGINS_BASE_PATHunset, verifiedovrtx.register_schema_paths()publishes the USD plugin path andovrtx.Renderer()constructs successfully.Release backport
develop