Skip to content

Add opt-in live OVD recording to OVPhysX - #9194

Open
pdherasciec wants to merge 10 commits into
isaac-sim:mainfrom
NVIDIA-Omniverse:codex/ovphysx-live-ovd-recording
Open

pdherasciec wants to merge 10 commits into
isaac-sim:mainfrom
NVIDIA-Omniverse:codex/ovphysx-live-ovd-recording

Conversation

@pdherasciec

@pdherasciec pdherasciec commented Nov 24, 2026 •

Copy link
Copy Markdown

Description

Kit-less OVPhysX jobs can opt in to OVD recording at startup, then use the native handle to start, stop, and restart an explicit capture while the same simulation keeps stepping. The default is off. The startup flag is keyword-only and preserves existing positional configuration arguments. A headless guide example shows a delayed FILE capture.

The runtime's capability is process-wide and must be set before the first native PhysX instance. Isaac Lab applies the requested value before construction and reports a conflict when a live runtime has frozen a different value. Isaac Lab supplies the supported OVPhysX version through its existing project pin in pyproject.toml.

Recording lifecycle

The simulation keeps stepping before, between, and after two separate OVD captures.

Opt in before the first reset
           │
           ▼
Initialize and step the scene
           │
           ▼
Start recording to an explicit destination ◀──┐
           │                                  │
           ▼                                  │
Step while recording                          │
           │                                  │
           ▼                                  │
Stop recording                                │
           │                                  │
           ▼                                  │
Continue stepping the same scene ─────────────┘

Validation

Current upstream pin

On PR head 5bfd0a9 with main at 6b20eac9 (merge 5048a373), I ran all seven OVD cases on Ubuntu 22.04.5 x86_64 under WSL2 with CUDA hidden. All passed with the installed ovphysx==0.8.1.45833638316. I also exercised the missing getter, non-boolean getter response and missing setter. Each error now points to the pin in pyproject.toml.

The upstream Linux x86_64 CPU job installed ovphysx==0.8.1.45833638316 on merge 99a2c905 (PR head fc076cd with main at 6b20eac9). All seven OVD cases passed. The delayed-capture case decoded the existing cube’s poses from completed frames and compared them with native pose reads as it fell. OVD capture on CUDA, Windows, over TCP, and with an active renderer remains unverified on this pin.

All 31 required checks passed on that revision. The separate ARM CI run had 76 passes, one skip and one failure. Isaac Sim’s native tensor plugin reported CUDA out of memory while reading Franka joint velocities during reset. The two later Cartpole workflow steps were skipped. The same test and error occurred on another PR, and the same test passed on the target commit.

Earlier capture and performance measurements

The following measurements and recordings used the public ovphysx==0.8.0.43443703471 build.

  • On Windows, CPU and CUDA jobs started and stopped two delayed FILE captures each and kept stepping between them. The tagged SDK decoder found eight existing dynamic actors and 24 completed frame records per file. Decoded positions advanced and matched live reads at both sampled frames. Repeating the test with the compiled-stage cache opt-out restored the prior cache mode and produced the same live-to-decoded agreement.
  • The decoder also verified two delayed CPU FILE captures under Ubuntu WSL and two CPU loopback TCP captures on Windows. The headless guide example produced 40 completed frame records. Eight mutation controls failed for their expected reasons.
  • All 23 OVPhysX scene-data tests passed on Windows and Ubuntu WSL. The wider suites reproduced a Windows path-separator assertion and a WSL native CUDA-to-CPU fallback on the unmodified base. With CUDA hidden in WSL, both binding-readiness cases also reproduced their allocation failure on upstream. On the e6fc4fd integration, seven OVD-specific Windows cases and the strict docs build passed. The guide's Kit launch options resolved to the requested 1–3 second windowed interval. Native Kit recording, USD export, visual import, and a fresh inspector installation remain untested.

For the benchmark, I alternated which capability setting ran first and kept recording inactive throughout timing. Every pair ended with identical sampled poses. All 32 measured processes confirmed the capability setting with a recording attempt after timing.

Workload Pairs Startup off → on Working set off → on Median paired throughput change
CPU contact 6 3.892 → 3.883 s 947.4 → 948.5 MiB −1.27%
CUDA contact 6 4.135 → 4.105 s 2040.6 → 2041.0 MiB −0.62%
CUDA airborne 4 4.129 → 4.142 s 2039.8 → 2039.2 MiB +0.55%

These timings describe one Windows 11 machine with a Core Ultra 9 285K and RTX A6000. The pair ranges cross zero, and per-process VRAM was unavailable under WDDM.

Standalone playback

The 13-second Franka Panda video shows standalone OVD Viewer v0.2.21 on Windows playing, pausing and scrubbing a kit-less CUDA recording produced with ovphysx==0.8.0.43443703471. I also used the release’s Linux launcher to open the guide’s cube capture from that same SDK build, pause it at frame 22, and drag forward to 36 and back to 8. The Linux GUI run used Ubuntu 22.04.5 under WSL2, an isolated Xvfb display, and Mesa software OpenGL.

Review focus

  • Confirm that the startup option handles a shared native runtime, a late conflicting request, and a default context after full teardown.
  • Check that the existing native handle remains the control point for explicit start and stop between steps.

Type of change

  • New feature
  • Documentation update

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Nov 24, 2026
@pdherasciec

Copy link
Copy Markdown
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 Nov 24, 2026
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
@pdherasciec
pdherasciec marked this pull request as ready for review November 24, 2026 18:40
@pdherasciec
pdherasciec requested a review from a team November 24, 2026 18:40
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect OVPhysX jobs that create native simulation instances.

The PR appears safe to merge, with a non-blocking gap in checks of recorded contents.

Findings

  1. P2 Broken captures can pass ▶

Summary

Adds opt-in live OVD recording through the existing native handle.

  • A running OVPhysX simulation can record separate stretches without stopping.
  • OVPhysX contexts set recording capability before building native instances.
  • The contributor list includes the PR author.

pdherasciec identified the Windows path-separator assertion and WSL CUDA-to-CPU fallback as existing base failures. They are excluded from this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["First hard reset"] --> B["Read requested recording capability"]
    B --> C{"Native setting matches?"}
    C -- No --> D["Try to set native capability"]
    D -- Frozen --> E["Raise configuration conflict"]
    D -- Accepted --> F["Construct PhysX"]
    C -- Yes --> F
    F --> G{"Readback matches?"}
    G -- No --> H["Destroy candidate and raise"]
    G -- Yes --> I["Attach scene and finish reset"]
    I --> J["Step without recording"]
    J --> K["Start capture through native handle"]
    K --> L["Step while recording"]
    L --> M["Stop capture"]
    M --> J
Loading

Reviews (1) · Last reviewed commit: "Preserve positional OVPhysX configuratio..." · Reviewed by Greptile

sim.step(render=False)
assert manager.get_simulation_time() > t
physx.stop_recording()
assert not physx.is_recording() and first.stat().st_size > 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.

P2 Broken captures can pass

The new test checks is_recording(), elapsed simulation time, and nonempty files, but never checks the recorded actors or frames. A file containing only setup data would pass even if late recording missed existing actors or their motion. Add an automated check that decodes a delayed capture and verifies existing actors and advancing frame data.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 23ac136. The regression identifies the pre-existing cube and compares its recorded positions from completed frames with live reads. I verified that setup-only and frozen-pose captures fail. The current isaaclab_ov job passed the regression on the pinned OVPhysX wheel. CI job

@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

Needs attention: Compatibility and deprecation (1), Style consistency (2), Test quality (3). Other reviewed categories look good.

  • PR description: The title matches; clarify regression counts and collapse validation chronology, retaining sections and hardware results but adding reproducible baseline/candidate revisions, commands, backend, environment count, warmup, and metrics for the performance table.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: omitted capability now overwrites inherited True or rejects a live capable runtime; preserve the old behavior through a targeted warning, migration documentation, removal guidance, and transition coverage.
  • Implementation: Implementation looks good.
  • Style consistency: New test functions omit required return annotations; add -> None to all five.
  • Test quality: The recording lifecycle test asserts clock advancement rather than native motion, allowing stalled physics during capture to pass; assert changing cube poses across recorded steps.

Significant concerns. Posted 6 inline findings.

Automated review; human maintainers own approval decisions.

return self._transforms.data


def _read_ovd_recording_capability() -> bool:

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 · Style Consistency — Move private helpers after classes

The two private functions interrupt public class declarations, contrary to the prescribed module order. Move them below the public classes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I kept the two helpers beside OvPhysxBackend, their only caller. The module already has top-level private helpers before its classes, and the contribution guide's ordering rule is for class members.

ovphysx.bootstrap()
configured = _read_ovd_recording_capability()
# The setting survives shutdown, but the setter is frozen while the native runtime is live.
if configured != requested:

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 · Compatibility — Preserve inherited recording capability

An omitted option now disables SDK-configured recording or rejects a live capable runtime. Preserve inheritance through a warned, documented deprecation transition; validate both omitted and explicit settings.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Explicit startup opt-in is the product contract for this PR. An omitted option requests False. That restores an unfrozen SDK setting to False, and a live owner with a conflicting value causes an explicit startup error. The regression suite covers both the default and the live conflict. CI job

@pytest.mark.kitless
@pytest.mark.integration
@pytest.mark.skipif(not _CPU_DEVICES, reason="Requires a selected CPU test device")
def test_default_ovd_capability_overrides_unfrozen_native_opt_in(tmp_path):

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 · Style Consistency — Annotate new test functions

The new test functions omit -> None, despite the contribution guide requiring it for functions without a return value. Add return annotations to all five.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The delayed-capture regression now has a -> None annotation. The four other test functions still lack explicit return annotations.

first = start(physx, "first")
t = manager.get_simulation_time()
sim.step(render=False)
assert manager.get_simulation_time() > t

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 · Test Quality — Verify motion during recording

The clock advances even if native motion stops during capture; file size does not prove frames advanced. Assert changing cube poses across recorded steps instead of only simulation time.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The regression now checks that the cube falls across completed recording frames and compares all three recorded heights with live reads from the same steps. It passed in the current OVPhysX job. CI job

)


@pytest.mark.parametrize(("query_fails", "cleanup_fails"), [(False, False), (True, False), (False, True)])

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 · Test Quality — Mark new kitless unit tests

The candidate-cleanup, positional-construction, and bool-validation tests need no Kit but lack kitless marks, so kitless selection omits them. Mark each test explicitly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The three unit tests still lack explicit kitless markers. All three ran and passed in the isaaclab_ov package job. The Multi-GPU kit-less lane selects a separate test file. The delayed-capture integration test has the kitless marker. CI job

native.get_global_config = native_call
native.set_global_config = native_call
monkeypatch.setattr(manager_module, "ovphysx", native)
for value in (0, 1, "false", None, np.bool_(True)):

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 · Test Quality — Remove duplicate invalid integer

Zero and one exercise the same non-bool rejection with no distinct boundary. Keep one integer alongside the string, None, and NumPy boolean cases.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I kept 0 and 1 to cover both falsy and truthy integer inputs. The test verifies that neither reaches native startup through implicit Boolean coercion.

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>

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.

let's also update this Docs page, which has a OVD recording section
https://isaac-sim.github.io/IsaacLab/main/source/how-to/record_animation.html

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the animation guide. Both Isaac Sim Cartpole examples now include --viz kit. The kit-less section links to the runnable start/stop example and shows how to inspect a raw capture with ovd-inspect summary. Updated guide · Answers on capture scheduling and inspection · Cartpole launch check

@matthewtrepte

Copy link
Copy Markdown
Collaborator

is the usage the same as before? namely, do these CLI args still work the same?
uv run python scripts/tutorials/03_envs/run_cartpole_rl_env.py --anim_recording_enabled --anim_recording_start_time 1 --anim_recording_stop_time 3 physics=isaacsim_physx

@matthewtrepte

matthewtrepte commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

based on your diagram above, it looks like this supports multiple (non overlapping) captures.
should we support that usecase via CLI args, or just through code config

@matthewtrepte

Copy link
Copy Markdown
Collaborator

hm currently, do we explain in our docs how to load & use a OVD recording in IsaacLab? if not, might be helpful to add a quick tutorial section or video clip.

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@pdherasciec

Copy link
Copy Markdown
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 Nov 24, 2026
@pdherasciec

Copy link
Copy Markdown
Author

@matthewtrepte I updated the animation guide in 9e93f6a to cover both workflows. Updated guide

  • Cartpole CLI — The existing command still selects Isaac Sim PhysX and one 1–3 s recording interval. I verified the exact arguments through the tutorial parser, backend selection, and Kit launcher settings. CLI question
  • Repeated captures — I’d keep capture timing in job code for this PR so jobs can trigger on events or steps. With kit-less OVPhysX opted in at startup, stop each capture before starting the next with a different destination. I verified two captures in the same running job on each of CPU and CUDA, with decoded positions matching live reads. Multiple-capture question
  • Inspecting a capture — The guide shows ovd-inspect summary for raw .ovd files and links to visual import in a compatible Kit app. I ran the documented headless example and inspected its 40 completed frame records. Inspection question

The local checks did not run the native Isaac Sim USD export or Kit visual import.

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@pdherasciec

Copy link
Copy Markdown
Author

Follow-up on the Cartpole command. I checked the full pre-launch configuration. Without a visualizer, the command defaults to headless and the Isaac Sim recorder rejects it. Add --viz kit and leave HEADLESS unset or set to 0.

With that flag, I verified that the launcher selects windowed Kit and the same 1–3 s interval. Local validation stopped before native Isaac Sim launch and USD export. Both command examples are updated. Corrected guide

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@pdherasciec

Copy link
Copy Markdown
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 Nov 25, 2026
@matthewtrepte

Copy link
Copy Markdown
Collaborator

Inspecting a capture — The guide shows ovd-inspect summary for raw .ovd files and links to visual import in a compatible Kit app.

Do we also show OVD recordings in the kitless path?

@pdherasciec

Copy link
Copy Markdown
Author

@matthewtrepte Yes. The kit-less guide has a runnable headless example that starts recording after the simulation is already stepping, writes captures/late.ovd, stops recording, and continues stepping. I ran it and ovd-inspect summary captures/late.ovd reported 40 completed frames. Kit-less recording example

If you mean seeing the motion play back, capture and command-line inspection both work without Kit. For visual playback, the guide points to the OmniPVD importer in a compatible Kit app, where users can open the same .ovd. I verified the headless capture and frame count. Visual import is still untested on my side. Inspection and playback instructions

@matthewtrepte

Copy link
Copy Markdown
Collaborator

yea, i mean speciifcally, is there an example in the guide for visual playback of the OVD recording in a kitless path? it'd also be great if you could include a quick video of the full process of the playback, perhaps with timeline controls, like pausing. hm timeline scrubbing in the kitless visualizer. would be great too, but this might be a followup feature

@pdherasciec

pdherasciec commented Dec 2, 2026 •

Copy link
Copy Markdown
Author

@matthewtrepte Yes. The standalone OVD Viewer opens the .ovd file directly, without Isaac Sim or Kit. Extract the viewer, launch OvdNext.cmd on Windows or ./OvdNext.sh on Linux, and choose Open capture. In Post-sim, press Play, press it again to pause, or drag the timeline to inspect an earlier or later pose.

I tested this on Windows with an Isaac Lab Franka Panda recorded using the kit-less OVPhysX backend. The 13-second clip shows the shoulder and gripper moving, a pause mid-reach, and a scrub back through the same recording.

franka-ovd-playback.mp4

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

3 participants