Skip to content

Fix OvPhysX 0.4 compatibility#5545

Merged
pbarejko merged 1 commit intoisaac-sim:developfrom
marcodiiga:ovphysx-04-isaaclab-fixes
May 8, 2026
Merged

Fix OvPhysX 0.4 compatibility#5545
pbarejko merged 1 commit intoisaac-sim:developfrom
marcodiiga:ovphysx-04-isaaclab-fixes

Conversation

@marcodiiga
Copy link
Copy Markdown

Summary

  • Fixes OvPhysX backend compatibility with the upcoming ovphysx 0.4 API by using active_cuda_gpus and explicit DirectGPU Carbonite settings when supported, while preserving the older gpu_index constructor path.
  • Fixes CPU-only OvPhysX tensor binding reads into GPU-backed articulation buffers.
  • Uses raw Warp buffers for OvPhysX articulation write views instead of ProxyArray wrappers.
  • Adds the ovphysx physics 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,rgb

Description

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 ovphysx physics 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_index keep the previous constructor path.

Fixes # (not applicable)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Screenshots

Not applicable.

Checklist

  • 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

@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels May 8, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR fixes several OvPhysX 0.4 API compatibility issues in IsaacLab: the PhysxManager class-name guard in sensor_base.py, CPU-only tensor reads into GPU-backed articulation buffers, raw Warp buffer usage for write views, and DirectGPU Carbonite settings for new ovphysx constructor signatures.

  • ovphysx_manager.py: Uses inspect.signature to detect the new active_cuda_gpus API surface and passes explicit PhysXConfig(carbonite_overrides=…) for GPU mode, while falling back to the legacy gpu_index path for older wheels.
  • articulation_data.py: Introduces _read_binding_into_view that routes CPU-only bindings through a per-type CPU scratch buffer before wp.copy into GPU-backed views; the three existing read helpers are consolidated through this new method.
  • articulation.py: Accesses private _applied_torque, _joint_pos_target, and _joint_vel_target directly to obtain raw wp.array pointers instead of ProxyArray wrappers, which do not expose .ptr.

Confidence Score: 4/5

The 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

Filename Overview
source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py Adds runtime API detection via inspect.signature to dispatch between ovphysx 0.4 (active_cuda_gpus + PhysXConfig) and older (gpu_index) constructor paths; CPU mode no longer passes gpu_index.
source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation_data.py Introduces _read_binding_into_view to route CPU-only bindings through a CPU scratch buffer before wp.copy to GPU-backed views; consolidates three existing read helpers through this new method.
source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py Switches write-view construction from public ProxyArray-wrapped properties to raw private wp.array attributes so that wp.array(ptr=...) correctly captures the underlying buffer pointer.
source/isaaclab/isaaclab/sensors/sensor_base.py Tightens prim-deletion guard from substring match to exact class name comparison, preventing OvPhysxManager from triggering a PhysX-only callback registration.
source/isaaclab_ovphysx/test/assets/test_articulation_data.py Adds a new test verifying that BODY_COM_POSE (a CPU-only type) is correctly staged through a CPU scratch buffer when reading into a CUDA-backed articulation buffer.
source/isaaclab_tasks/isaaclab_tasks/direct/cartpole/cartpole_camera_presets_env_cfg.py Adds ovphysx = OvPhysxCfg() preset to the cartpole camera presets task, enabling the --presets=ovphysx training path for that environment.

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
Loading

Reviews (1): Last reviewed commit: "Fix OvPhysX 0.4 compatibility" | Re-trigger Greptile

Comment thread source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py
Comment thread source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py Outdated
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.
@marcodiiga marcodiiga force-pushed the ovphysx-04-isaaclab-fixes branch from 5318097 to 6f33d74 Compare May 8, 2026 12:09
@pbarejko pbarejko merged commit 24f2cc0 into isaac-sim:develop May 8, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants