Repository navigation
Description
Summary
Replace the disk-based USD export in `OvPhysxManager` with an in-memory transfer. Currently the USD stage is exported to a temp file and reloaded — this disk round-trip is unnecessary overhead.
Current Flow
- `stage.Export(tmp_path)` — write USD to disk
- `physx.add_usd(tmp_path)` — read USD from disk
Desired Flow
- `stage.ExportToString()` — serialize to string in memory
- `physx.add_usd_from_string(string)` — load directly from memory
OVPhysX Blocker for @marcodiiga
Add `physx.add_usd_from_string()` (or `add_usd_from_bytes()`) to the ovphysx Python API. The C++ side likely already parses USD from a buffer — this just needs a Python binding.
IsaacLab-Side Changes
~10 lines in `ovphysx_manager.py` — replace file export/load with string export/load, remove temp file cleanup.
Spec
Full design spec: `docs/superpowers/specs/2026-04-20-ovphysx-usd-integration-design.md`
Parent issue: #5315
📋 Full Design Spec (click to expand)
OVPhysX USD Integration Improvement — Design Spec
Issue: #5324 — [OVPHYSX] Improve USD integration to avoid disk dumps
Date: 2026-04-20
Status: Draft
Summary
Currently, OvPhysxManager exports the USD stage to a temporary file on disk and then loads it back into the ovphysx PhysX instance. This disk round-trip is unnecessary overhead and introduces temp file management complexity. The goal is to pass the USD stage directly to ovphysx without writing to disk.
Current Problem
From OvPhysxManager._warmup_and_load():
- The in-memory USD stage is exported to a temp
.usdafile viastage.Export() - ovphysx loads the file via
physx.add_usd(temp_path) - The temp file persists until process exit
Issues:
- Performance: Disk I/O is slow for large scenes (many environments, complex assets)
- Reliability: Temp file may not be cleaned up on crash
- Containerization: Some container environments have limited temp storage
- Security: USD file on disk may contain sensitive scene data
Desired State
Pass the USD stage directly to ovphysx via an in-memory API, eliminating the disk round-trip entirely.
Approach Options
Option A: In-memory USD string (ovphysx API addition)
Add an ovphysx API that accepts a USD string/bytes instead of a file path:
# Current
physx.add_usd("/tmp/exported_scene.usda")
# Proposed
usd_string = stage.ExportToString()
physx.add_usd_from_string(usd_string)Or using flatbuffers/binary format:
usd_bytes = stage.Flatten().ExportToString() # or binary format
physx.add_usd_from_bytes(usd_bytes)Option B: Shared memory / file descriptor
Use a file descriptor or shared memory segment instead of a named file:
import io
buffer = io.BytesIO()
stage.Export(buffer) # if pxr supports stream export
physx.add_usd_from_fd(buffer.fileno())Risk: USD's Export() may only support file paths, not streams.
Option C: Direct scene graph transfer
Instead of going through USD serialization at all, transfer the scene graph directly:
- Iterate prims in the USD stage
- Call ovphysx APIs to create physics objects directly
- Skip serialization entirely
Risk: High complexity, essentially reimplementing USD loading in Python.
Recommendation
Option A (in-memory USD string) is the cleanest. It requires @marcodiiga to add add_usd_from_string() or similar to the ovphysx Python API. The IsaacLab side change is minimal (replace stage.Export(path) + physx.add_usd(path) with stage.ExportToString() + physx.add_usd_from_string(string)).
Blocker for @marcodiiga: Add an in-memory USD loading API to ovphysx. The C++ side likely already parses USD from a buffer — this just needs a Python binding that passes the buffer directly instead of reading from a file path.
Implementation Steps
- @marcodiiga adds
physx.add_usd_from_string()to ovphysx wheel - Update
OvPhysxManager._warmup_and_load():- Replace
stage.Export(tmp_path)withstage.ExportToString() - Replace
physx.add_usd(tmp_path)withphysx.add_usd_from_string(usd_string) - Remove temp file creation and cleanup
- Replace
- Remove the
atexittemp file cleanup handler
Dependencies
- Requires ovphysx API addition (
add_usd_from_stringor equivalent) - Requires PR ovphysx backend integration #4852 merged
- Independent of all other specs
Estimated Scope
- IsaacLab-side changes: ~10 lines in
ovphysx_manager.py - ovphysx-side: new Python binding for in-memory USD loading
Activity
Add all OVPhysX integration design specs
Add all OVPhysX integration design specs
AntoineRichard commentedon Aug 27, 2026
Thanks for catching this, @AntoineRichard — the disk round-trip is gone.
OvPhysxManagernow serializes the stage in memory vialayer.ExportToString()and hands the string straight to OVPhysX; see_serialize_selected_stageinsource/isaaclab_ov/isaaclab_ov/physics/ovphysx_manager.py. No temp files or reload path remain in that flow, and the parent tracking issue #5315 is closed.Closing — please reopen if a temp-file path ever resurfaces on a current release.
🤖 This issue was reviewed as part of an AI-assisted triage of the Isaac Lab backlog, with automated verification against the current codebase. If we got this wrong, please reopen — we'd rather hear about it!