Skip to content

browser-demos-v4

@cyanseek cyanseek tagged this 13 Oct 18:44
# Description

`IsaacLabTorchRLWrapper(env, device="cpu")` could reset a CUDA
environment but crashed on the first step: observations had moved to the
wrapper device while the terminal-selection mask remained on CUDA.

Move the combined `done` mask to the wrapper device before selecting
terminal observations. Extend the existing wrapper test matrix to
exercise CPU output with captured terminal observations and the NaN
fallback, while retaining the default same-device path. The current
training CLI defaults are unchanged.

Fixes #8239

## Type of change

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

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Validation

Revalidated after merging `develop` at
`5afb1f7949e8ab02d9b97253caf2e71b5aabfd45` on 2026-10-09. The fixture
now uses the current `launch_simulation(cfg)` interface.

Real Newton/MJWarp Cartpole simulation on an RTX 4090, Ubuntu 24.04.3,
driver 580.126.09, Python 3.12.13, PyTorch 2.11.0+cu130, Warp 1.17.0,
TorchRL 0.14.0 and TensorDict 0.14.2; seed 42. Dependencies used the
versions in `uv.lock`, including Newton commit
`5ea82eef6f7911388025a8df6ccdb172e2fed286`.

- CPU-output regression cases against the original wrapper: **2
failed**. Both failures were the expected CUDA/CPU mismatch.
- Complete `source/isaaclab_rl/test/test_wrappers.py`, with the `test`,
`torchrl`, `rl-games`, `sb3` and `skrl` extras: **10 passed**, no skips.

Command: `uv run --frozen --no-sync python -m pytest
source/isaaclab_rl/test/test_wrappers.py -q` (`--no-sync` uses the
already prepared locked environment). Official Cartpole assets were
cached without modification via `ISAACSIM_ASSET_ROOT`.

This verifies wrapper correctness, not training throughput. PhysX,
multi-GPU transfers, and rendering were not tested. The test run reports
existing dependency/backend warnings; it is not warning-free.

## Checklist

- [x] Read the contribution guidelines and applied the test-audit
criteria.
- [x] Ran `pre-commit` through `isaaclab --format` (all applicable hooks
passed).
- [x] Existing `device` documentation describes the restored behavior;
no API change.
- [x] Validated the changed behavior and adjacent wrappers with real GPU
simulation.
- [x] Added an `isaaclab_rl` changelog fragment.
- [x] Added the contributor name to `CONTRIBUTORS.md`.
Assets 2
Loading