Fix OvPhysX 0.4 compatibility#5545
Conversation
Greptile SummaryThis PR fixes several OvPhysX 0.4 API compatibility issues in IsaacLab: the
Confidence Score: 4/5The changes are well-scoped bug fixes with no cross-cutting regressions; the main area worth a closer look is the ovphysx constructor dispatch in the manager. The CPU-only tensor staging, write-view raw-pointer fix, and sensor class-name guard are all straightforward and correctly implemented. The only open questions are whether older ovphysx wheels require gpu_index even for CPU-mode instantiation, and whether the active_cuda_gpus string format matches the published 0.4 spec. Both are low-impact edge cases but warrant a quick confirmation before merge. source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py — the dual-path constructor dispatch and the active_cuda_gpus string representation deserve a final check against the ovphysx 0.4 API surface. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[OvPhysxManager._warmup_and_load] --> B{ovphysx_device == gpu?}
B -- No --> C[physx_kwargs = device:cpu]
B -- Yes --> D{active_cuda_gpus in PhysX signature?}
D -- Yes, new 0.4 API --> E[kwargs += active_cuda_gpus + PhysXConfig]
D -- No, old API --> F[kwargs += gpu_index]
C --> G[ovphysx.PhysX instantiated]
E --> G
F --> G
subgraph Read path in ArticulationData
H[_read_binding_into_view] --> I{CPU_ONLY_TYPES AND view.device != cpu?}
I -- Yes --> J[binding.read to CPU scratch]
J --> K[wp.copy: CPU scratch to GPU view]
I -- No --> L[binding.read directly into view]
end
subgraph sensor_base.py
M[Register callbacks] --> N{physics_mgr_cls.__name__ == PhysxManager?}
N -- Yes --> O[Register prim-deletion callback]
N -- No --> P[Skip prim-deletion]
end
Reviews (1): Last reviewed commit: "Fix OvPhysX 0.4 compatibility" | Re-trigger Greptile |
Update the OvPhysX backend for the upcoming ovphysx 0.4 API while preserving the older constructor path. Fix CPU-only tensor binding reads into GPU buffers, use raw Warp buffers for write views, and add the OvPhysX preset to the cartpole camera task.
5318097 to
6f33d74
Compare
Summary
active_cuda_gpusand explicit DirectGPU Carbonite settings when supported, while preserving the oldergpu_indexconstructor path.ProxyArraywrappers.ovphysxphysics preset to the cartpole camera presets task.Validation
./isaaclab.sh -f./isaaclab.sh -p -m pytest source/isaaclab_ovphysx/test/assets/test_articulation_data.py source/isaaclab_ovphysx/test/assets/test_articulation.py./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task Isaac-Cartpole-Direct-v0 --num_envs 64 --max_iterations 2 --headless presets=ovphysx./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task Isaac-Ant-Direct-v0 --num_envs 64 --max_iterations 2 --headless presets=ovphysx./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task Isaac-Humanoid-Direct-v0 --num_envs 64 --max_iterations 2 --headless presets=ovphysx./isaaclab.sh -p scripts/reinforcement_learning/rl_games/train.py --task=Isaac-Cartpole-Camera-Presets-Direct-v0 --num_envs=32 --max_iterations=2 --headless --enable_cameras presets=ovphysx,ovrtx_renderer,rgbDescription
This PR fixes several small IsaacLab-side issues needed for the OvPhysX backend to run the supported direct cartpole, ant, and humanoid tasks with the upcoming ovphysx 0.4 wheel. It also enables the cartpole camera presets task to select the
ovphysxphysics preset.The OvPhysX manager now detects the new constructor surface and passes explicit DirectGPU settings for GPU simulations. Older public wheels that still use
gpu_indexkeep the previous constructor path.Fixes # (not applicable)
Type of change
Screenshots
Not applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there