Repository navigation
Warn about PhysX GPU articulation partition aliasing - #8208
Conversation
|
| ) | ||
| if self.root_view._backend is None: | ||
| raise RuntimeError(f"Failed to create articulation at: {root_prim_path_expr}. Please check PhysX logs.") | ||
| self._maybe_warn_gpu_articulation_partition_aliasing() |
There was a problem hiding this comment.
Later sensor views miss warning
If a joint-wrench sensor initializes after the articulation assets and its view takes the scene above 32 instances, this check does not run again. For example, a 20-instance articulation with 65 links followed by a sensor view of 13 other instances meets the stated risk conditions but produces no warning. The tests call the helper directly, so they do not cover this initialization order.
| ): | ||
| return | ||
|
|
||
| logger.warning( |
There was a problem hiding this comment.
Scene warning repeats per asset
Once the thresholds are crossed, each subsequent articulation initialization logs the same scene-level warning. A scene with 100 separately initialized qualifying views can produce 68 warnings in one initialization pass, burying other diagnostics. Deduplicating the warning per scene would avoid that noise.
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!
There was a problem hiding this comment.
This is not an issue since most scene would only have a single view, maybe 2 - 3 at most.
There was a problem hiding this comment.
That’s fair—if qualifying scenes typically contain only a few articulation views, the repetition concern is negligible. The current module-level _gpu_articulation_aliasing_warning_logged flag also limits the warning to once per process, so this is not an actionable issue. You can disregard my comment.
There was a problem hiding this comment.
Isaac Lab Review Bot
The warning gate’s thresholds and message are correct, but a scene-wide diagnostic is currently evaluated during each articulation’s initialization, causing order-dependent counts and potentially repeated warnings. The config access also violates the repository’s direct-attribute rule.
- Design and architecture: Finding 0:
_maybe_warn_gpu_articulation_partition_aliasing()scans the scene-wideSimulationManager.viewsregistry from every asset’s_initialize_impl. Because views are registered incrementally, the count depends on initialization order; after the threshold is crossed, later articulations can emit the same warning repeatedly. Move the check to a manager-level point after view registration is complete, or add a backend-lifecycle latch so it warns at most once with a complete aggregate. - API: No public symbol, signature, configuration field, registry key, or serialized form changes. The new helper and constants are private; the observable API behavior is limited to an added initialization warning.
- Compatibility and deprecation: Breaking changes: none identified. The changes are additive and preserve existing PhysX articulation signatures, defaults, return values, and configuration contracts.
- Implementation: The CUDA, partition-count, total-instance, and maximum-link gates use the intended strict threshold semantics. Finding 1:
getattr(physics_cfg, "gpu_max_num_partitions", 1)silently suppresses the diagnostic if the known PhysX configuration field is missing or renamed. After handlingNone, accessphysics_cfg.gpu_max_num_partitionsdirectly. - Style consistency: Private naming, constant placement, helper ordering, docstring form, and changelog formatting match adjacent patterns. The reflective config read conflicts with the repository rule requiring direct access for known attributes and prohibiting defaults that hide missing required fields.
- Test quality: The two added tests provide distinct positive and negative coverage for the warning gate. The negative parameter rows independently exercise CPU, single partition, the 32-instance boundary, and the 64-link boundary, without duplicating existing coverage. However, the tests do not expose the order-dependent scene count or repeated-warning behavior identified in finding 0.
Minor fixes needed. Posted 2 actionable findings inline.
Automated review; human maintainers own approval decisions.
| ) | ||
| if self.root_view._backend is None: | ||
| raise RuntimeError(f"Failed to create articulation at: {root_prim_path_expr}. Please check PhysX logs.") | ||
| self._maybe_warn_gpu_articulation_partition_aliasing() |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Scene-wide warning runs per articulation init
This scene-level aggregate is invoked from every articulation's _initialize_impl, but SimulationManager.views only contains the views registered so far. Early articulations therefore report an under-counted total_articulation_count, and once the thresholds are crossed every subsequently initialized articulation logs the same message again. Evaluate this once after all views exist (manager-level hook) or latch it so it warns at most once per backend lifecycle.
| def _maybe_warn_gpu_articulation_partition_aliasing(self) -> None: | ||
| """Warn about a known PhysX GPU articulation solver partition issue.""" | ||
| physics_cfg = self._sim_cfg.physics if self._sim_cfg is not None else None | ||
| gpu_max_num_partitions = getattr(physics_cfg, "gpu_max_num_partitions", 1) |
There was a problem hiding this comment.
🔵 Suggestion · Style Consistency — getattr default hides known PhysxCfg field
The coding style requires direct attribute access and forbids getattr defaults for known attributes or to hide a missing required field. gpu_max_num_partitions is a declared PhysxCfg field on this PhysX-only path, so the default of 1 would silently disable the diagnostic forever if the field is renamed. After the existing None guard, read physics_cfg.gpu_max_num_partitions directly.
AntoineRichard
left a comment
There was a problem hiding this comment.
🤖 AI review (Claude Code) — see inline comment.
| if ( | ||
| "cuda" not in self.device | ||
| or physics_cfg.gpu_max_num_partitions <= 1 | ||
| or self.num_instances <= _GPU_ARTICULATION_ALIASING_INSTANCE_THRESHOLD |
There was a problem hiding this comment.
🤖 AI review — generated with Claude Code, posted on behalf of @AntoineRichard. Please verify before acting on it.
Instance threshold is checked per articulation view, not per scene
self.num_instances is the count of this articulation view only. Per #8121, the aliasing triggers when the scene has more than 32 GPU articulations and any of them has more than 64 links. Scenes with several articulation assets will therefore not get the warning.
Example: 20 envs, each with a 65-link robot (Articulation A) plus a small articulated object (Articulation B) → 40 GPU articulations in the scene, which is above the 32-pair aliasing limit, so with the default gpu_max_num_partitions=8 envs can corrupt each other. But A sees num_instances=20 <= 32 and B sees num_bodies <= 64, so neither warns. Same with e.g. 16 large robots + 32 small articulations.
Potential solution: running scene-wide tally
All articulations initialize sequentially inside the single PhysicsEvent.PHYSICS_READY dispatch in PhysxManager.reset(), and both conditions only grow as more articulations initialize (total count up, max link count never down). So the check can stay where it is, but evaluate scene-wide aggregates; whichever articulation initializes last will trip it.
# module level
_GPU_ARTICULATION_ALIASING_LINK_THRESHOLD = 64
_GPU_ARTICULATION_ALIASING_INSTANCE_THRESHOLD = 32
# keyed by the physics sim view so a new stage/sim context starts fresh
_articulation_tally: dict[int, dict[str, tuple[int, int]]] = {}
_gpu_articulation_aliasing_warning_logged = False
def _maybe_warn_gpu_articulation_partition_aliasing(self) -> None:
global _gpu_articulation_aliasing_warning_logged
if _gpu_articulation_aliasing_warning_logged or self._sim_cfg is None:
return
if "cuda" not in self.device or self._sim_cfg.physics.gpu_max_num_partitions <= 1:
return
# key by the view's prim path so re-initialization (stop -> play) overwrites instead of double counting
tally = _articulation_tally.setdefault(id(self._physics_sim_view), {})
tally[self.cfg.prim_path] = (self.num_instances, self.num_bodies)
total = sum(n for n, _ in tally.values())
max_links = max(links for _, links in tally.values())
if total <= _GPU_ARTICULATION_ALIASING_INSTANCE_THRESHOLD or max_links <= _GPU_ARTICULATION_ALIASING_LINK_THRESHOLD:
return
_gpu_articulation_aliasing_warning_logged = True
logger.warning(...)Notes:
id()of the sim view can be reused after it is garbage-collected; clearing the tally inPhysxManager.close()would be more robust.- This only counts articulations wrapped by an Isaac Lab
Articulation. Raw USD articulation roots not managed by an asset still count toward PhysX's limit but are invisible here. A more complete (but heavier) alternative is a one-shot check inPhysxManager.reset()right after thePHYSICS_READYdispatch that countsUsdPhysics.ArticulationRootAPIprims on the stage — at the cost of a full stage traversal at large env counts.
Minor, non-code: the PR body says Fixes #8121, which will auto-close the issue on merge even though the underlying PhysX bug (NVIDIA-Omniverse/PhysX#530) remains. Refs #8121 would keep it open.
There was a problem hiding this comment.
Addressed in ef08bd8: the warning now uses a scene-wide running tally across managed PhysX Articulation assets keyed by the active simulation view, and the tally/warned state is cleared from PhysxManager._invalidate_views(). I also added the known issue and workaround to docs/source/refs/issues.rst and changed the PR body to Refs #8121 so the upstream PhysX issue remains tracked.
|
run-ci |
# Description Adds a one-time PhysX-side warning during articulation initialization when managed Isaac Lab articulation assets in the scene match the known risk shape from #8121: - running on CUDA - `PhysxCfg.gpu_max_num_partitions > 1` - more than 32 total managed articulation instances in the scene - at least one managed articulation has more than 64 links The warning points users to the currently recommended workaround, `PhysxCfg(gpu_max_num_partitions=1)`, and references #8121. This also documents the issue and workaround in `docs/source/refs/issues.rst`. Refs #8121 ## Type of change - Bug fix (non-breaking change which fixes an issue) - Documentation update ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Screenshots N/A ## Validation - `./.venv/bin/python -m py_compile source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py` - `/Users/kellyg/.local/bin/uvx ruff format --check source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py` - `/Users/kellyg/.local/bin/uvx ruff check source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py` - `git diff --check` Not run locally: - `uv run isaaclab --format`: blocked because the current lockfile supports Linux/Windows environments but not this macOS host. - `uv run python -m pytest ...`: blocked by the same lockfile platform constraint; this PR does not add tests. - Docs build: blocked by the same local environment limitation. - `tools/changelog/cli.py check develop`: direct Python execution runs but reports existing pending-fragment issues across the repo; this PR's fragment uses the current `<slug>.fixed.rst` bullet format. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new unintended warnings - [ ] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there (cherry picked from commit a162893)
|
Backported to |
Description
Adds a one-time PhysX-side warning during articulation initialization when managed Isaac Lab articulation assets in the scene match the known risk shape from #8121:
PhysxCfg.gpu_max_num_partitions > 1The warning points users to the currently recommended workaround,
PhysxCfg(gpu_max_num_partitions=1), and references #8121. This also documents the issue and workaround indocs/source/refs/issues.rst.Refs #8121
Type of change
Release backport
developScreenshots
N/A
Validation
./.venv/bin/python -m py_compile source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py/Users/kellyg/.local/bin/uvx ruff format --check source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py/Users/kellyg/.local/bin/uvx ruff check source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py source/isaaclab_physx/isaaclab_physx/physics/physx_manager.pygit diff --checkNot run locally:
uv run isaaclab --format: blocked because the current lockfile supports Linux/Windows environments but not this macOS host.uv run python -m pytest ...: blocked by the same lockfile platform constraint; this PR does not add tests.tools/changelog/cli.py check develop: direct Python execution runs but reports existing pending-fragment issues across the repo; this PR's fragment uses the current<slug>.fixed.rstbullet format.Checklist
pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there