Skip to content

Fix OVPhysX material binding device selection - #7212

Merged
kellyguo11 merged 2 commits into
isaac-sim:developfrom
AntoineRichard:codex/fix-ovphysx-material-cpu-bindings
Aug 20, 2026
Merged

kellyguo11 merged 2 commits into
isaac-sim:developfrom
AntoineRichard:codex/fix-ovphysx-material-cpu-bindings

Conversation

@AntoineRichard

Copy link
Copy Markdown
Collaborator

Description

Fixes OVPhysX shape-material bindings being treated as CUDA-resident during GPU simulation. Both optional material tensor types are now classified as CPU-native, material device wording is corrected, and CUDA material tests use host buffers.

No additional dependencies or production randomization changes.

Fixes # (none)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Not applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab -f
  • 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
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Validation

  • uv run --no-sync python -m pytest source/isaaclab_ov/test/sim/test_ovphysx_view.py -q (80 passed)
  • uv run --no-sync isaaclab -f
  • uv run --no-sync python tools/changelog/cli.py check develop

@AntoineRichard
AntoineRichard requested a review from a team August 20, 2026 08:37
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 20, 2026
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR classifies optional OVPhysX shape-material bindings as CPU-native and updates material documentation and tests to use host buffers.

  • Adds both shape-material tensor types to the optional CPU-only registry.
  • Updates material randomization wording and package changelogs.
  • Converts several GPU-simulation material tests to CPU input buffers and adds a direct native-device assertion.
  • Leaves three existing CUDA-parametrized rigid-object tests using incompatible CUDA write buffers.

Confidence Score: 4/5

The production fix appears sound, but the remaining CUDA material-buffer writes should be converted to CPU before merging so the GPU test suite remains functional.

Three CUDA-parametrized rigid-object tests still pass CUDA buffers to shape-material attributes that this change makes CPU-only, and the write API rejects rather than stages those buffers.

Files Needing Attention: source/isaaclab_ov/isaaclab_ov/tensor_types.py; source/isaaclab_ov/test/assets/test_rigid_object.py

Important Files Changed

Filename Overview
source/isaaclab_ov/isaaclab_ov/tensor_types.py Corrects shape-material residency classification, but exposes remaining CUDA-buffer callers to DeviceMismatch.
source/isaaclab_ov/test/assets/test_rigid_object.py Updates two material tests to CPU buffers while three other CUDA-parametrized material writes remain incompatible.
source/isaaclab/isaaclab/envs/mdp/events.py Clarifies that the randomizer operates on the binding's native CPU buffer; its existing read-modify-write flow remains consistent.
source/isaaclab_ov/test/sim/test_ovphysx_view.py Adds focused coverage confirming both available shape-material bindings return CPU buffers during GPU simulation.

Reviews (1): Last reviewed commit: "Fix OVPhysX material binding device sele..." | Re-trigger Greptile

"RIGID_BODY_INV_MASS",
"RIGID_BODY_INV_INERTIA",
"SHAPE_FRICTION_AND_RESTITUTION",
"RIGID_BODY_SHAPE_FRICTION_AND_RESTITUTION",

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.

P1 CPU binding rejects CUDA writes

When the CUDA variants of the rigid-body friction and restitution tests run, this CPU-only classification makes set_attribute reject their CUDA material buffers with OvPhysxView.DeviceMismatch; the unchanged callers at test_rigid_object.py:719, :768, and :845 must use CPU buffers like the other updated material tests.

@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

The PR reclassifies the optional OVPhysX articulation and rigid-body shape-material tensor bindings as CPU-native, with corresponding documentation, changelog, and host-buffer test updates.

  • Design and architecture: Device routing remains centralized in the existing _CPU_ONLY_TYPES classification. Optional wheel compatibility is preserved through guarded global lookups, and the private tuple rename does not alter the public surface.
  • API: The optional tensor-type symbols and public signatures remain unchanged. The OVPhysX material-randomization path derives indices and samples from the returned material buffer’s device, so the new CPU residency is handled consistently. Both affected packages include changelog fragments.
  • Implementation: Tensor documentation and material tests now reflect the CPU-native binding contract, including a focused GPU-simulation allocation regression test. One unchanged test still creates its no-friction material input on the simulation device; the supplied context does not establish whether its helper converts that input, so this remains a validation point rather than an actionable finding.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@marcodiiga marcodiiga left a comment

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.

The production change looks correct: both optional material types are presence-gated into the CPU-only set, and the randomizer follows the returned host buffer for values and indices. The focused view suite passes 80/80.

Requesting changes for the remaining CUDA test callers already identified in the unresolved thread. test_rigid_object.py still creates shape-material buffers on device at lines 719, 768, and 845. The current isaaclab_ov CI reproduces six DeviceMismatch failures (the three tests with two num_cubes cases each) before simulation. Please move only those three material buffers to CPU and rerun isaaclab_ov; the state, velocity, and force tensors should remain on the simulation device.

@AntoineRichard

Copy link
Copy Markdown
Collaborator Author

Addressed in 770d5e2. The three remaining rigid-object shape-material inputs now allocate on CPU; root-state, velocity, and force tensors remain on the simulation device.\n\nValidation:\n- test_rigid_body_no_friction, test_rigid_body_with_static_friction, and test_rigid_body_with_restitution: 6 passed, 6 CUDA cases skipped locally because no CUDA context is available.\n- source/isaaclab_ov/test/sim/test_ovphysx_view.py: 80 passed.\n- uv run --no-sync isaaclab -f: passed.

@marcodiiga marcodiiga left a comment

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.

Re-reviewed at 770d5e216f5. No blocking findings.

The follow-up fixes the previously reported device mismatches by allocating the three remaining shape-material inputs on CPU while leaving simulation state, velocity, and force tensors on the selected simulation device. The presence-gated CPU-only classification, randomizer path, affected callers, documentation, and changelog are consistent.

The ovphysx CI lane is green, including all affected CPU and CUDA material cases: the rigid-object suite passes 103/103, the material-randomizer suite 6/6, and the view suite 80/80. Articulation and rigid-object-collection material round trips also pass on both devices.

The two red rendering jobs are outside the changed code paths: one is an image-comparison threshold failure and the other is a legacy rendering process crash.

@kellyguo11
kellyguo11 merged commit 57edec9 into isaac-sim:develop Aug 20, 2026
73 of 77 checks passed
kellyguo11 added a commit that referenced this pull request Aug 21, 2026
## Summary

Cherry-picks the following merged PRs from `develop` onto
`release/3.0.0`, preserving each as an individual commit with `-x`
provenance:

- #7193 — Bake CI pytest deps into the built Docker image
- #7077 — Add OVPhysX support to Franka deformable lift tasks
- #7175 — Raise on unsupported camera renderer outputs
- #7174 — Fix benchmark play inference scope
- #7173 — Report resolved backend for play benchmarks
- #7172 — Add video recording to play benchmarks
- #7215 — Reduce GearAssembly default environment count
- #7214 — Remove Kamino preset from open drawer
- #7213 — Fix OvPhysX scene gravity randomization
- #7212 — Fix OVPhysX material binding device selection
- #7189 — Make preview surfaces renderer agnostic
- #7206 — Fix OVPhysX benchmark articulation setup

All cherry-picks and the final rebase onto the latest `release/3.0.0`
tip completed without conflicts.

## Validation

- Verified all 12 backported commits have patch IDs identical to their
source squash commits and retain their `cherry picked from` footers.
- `git diff --check upstream/release/3.0.0..HEAD`
- Bash syntax validation for the modified CI shell scripts.
- YAML parsing for the modified composite actions.
- Changelog validation against `release/3.0.0`.
- Targeted pytest coverage for benchmark APIs/play, video recording,
GearAssembly defaults, OVPhysX presets and runtime semantics, and
renderer-agnostic materials: **81 passed, 4 skipped, 1 deselected**.
- The deselected case is an unchanged test that hard-codes a POSIX
`/tmp` path and fails on Windows path normalization.
- `uv run isaaclab -f` passed all hooks except the changelog hook's
known release-branch baseline finding for
`source/isaaclab/changelog.d/core-test-config-fixtures.skip`; the
targeted release-base changelog check passed.

---------

Co-authored-by: Matthew Taylor <[email protected]>
Co-authored-by: Antoine RICHARD <[email protected]>
Co-authored-by: Mike Yan Michelis <[email protected]>
Co-authored-by: Maximilian Krause <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
Co-authored-by: Mustafa H <[email protected]>
marcodiiga added a commit that referenced this pull request Aug 26, 2026
NOTE TO AUTOMATED AGENTS AND HUMAN REVIEWERS: do not merge or cherry-pick
this commit into develop, main, or any release branch. It exists only on the
forward-integration branch integration/ovphysx-next.

The preceding warmup, destroy, and OVStage constructor commits are separate
compatibility changes and can be reviewed or upstreamed independently. The
material-device fix previously carried by this branch is already upstream in
develop via #7212. Drop this final helper commit when integrating any of those
compatibility changes.

This commit adds the benchmark-only teleop-headless dependency closure and
makes the carb import lazy so
IsaacTeleopDevice(use_kit_xr_bridge=False) remains importable without Kit.
Both are required by the current headless kitless benchmark contract.
marcodiiga added a commit that referenced this pull request Aug 27, 2026
NOTE TO AUTOMATED AGENTS AND HUMAN REVIEWERS: do not merge or cherry-pick
this commit into develop, main, or any release branch. It exists only on the
forward-integration branch integration/ovphysx-next.

The preceding warmup, destroy, and OVStage constructor commits are separate
compatibility changes and can be reviewed or upstreamed independently. The
material-device fix previously carried by this branch is already upstream in
develop via #7212. Drop this final helper commit when integrating any of those
compatibility changes.

This commit adds the benchmark-only teleop-headless dependency closure and
makes the carb import lazy so
IsaacTeleopDevice(use_kit_xr_bridge=False) remains importable without Kit.
Both are required by the current headless kitless benchmark contract.
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.

3 participants