Skip to content

[MGPU] Add multi-GPU training smoke tests - #6946

Merged
kellyguo11 merged 50 commits into
isaac-sim:developfrom
hujc7:jichuanh/mgpu-camera-smoke-xfail
Sep 3, 2026
Merged

kellyguo11 merged 50 commits into
isaac-sim:developfrom
hujc7:jichuanh/mgpu-camera-smoke-xfail

Conversation

@hujc7

@hujc7 hujc7 commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

1. Summary

Nothing in CI exercised multi-GPU rendering. This adds real four-rank training runs that do,
chosen to catch renderer device-selection defects: every runnable physics/renderer stack, each run
both with the host's default device order and with four GPUs exposed as 3,1,2,0.

2. Type of change

  • New feature (non-breaking change which adds functionality)

3. Design notes

Why a reordered device list. CUDA_VISIBLE_DEVICES renumbers devices for CUDA but not for the
graphics stack, so a run is only exposed to a selection defect when the visible devices are
reordered — with 3,1,2,0 no rank's CUDA index matches its graphics index, and no rank can be
recovered by assuming the list is sorted or contiguous. The unmasked case is the baseline it is read
against: it passes even when selection is wrong. Four ranks rather than two, because with two a
wrong device can still land on a visible GPU by chance.

The grid. 3 physics × 3 renderers. Two cells cannot run at all — isaacsim_physx,ovrtx and
ovphysx,isaacsim_rtx are rejected before launch by sim_launcher._validate_runtime, since OVRTX
and OvPhysX are kitless and cannot share a process with Kit. The Newton renderer pairs with every
physics backend, because NewtonManager.get_model builds a shadow model when the active backend is
not Newton. That leaves 7 runnable stacks × 2 device orders, plus one unparameterised physics-only
case = 15 cases.

Two images, not two wheel installs. ov[all] cannot be installed into the Isaac Sim image:
ovphysx declares Requires-Dist: packaging<24,>=20, and the pip-style path honours it, downgrading
packaging and destroying Isaac Sim's prebundle. The kit-less stacks therefore run in
docker/Dockerfile.kitless, built from ubuntu with no Isaac Sim and so no prebundle to break, and
the kitless pytest marker routes each stack to the image carrying its runtime. Keeping them
separate also means a fault in the kit-less renderer cannot take down Kit-renderer coverage.

The kit-less image installs from uv.lock. Only the lock applies [tool.uv] override-dependencies, the table holding packaging above ovphysx's <24 pin; the pip-style path
ignores it. Its interpreter lives outside ISAACLAB_PATH because CI bind-mounts the checkout over
that path, and UV_PYTHON pins the system interpreter so uv sync reuses the venv rather than
rebuilding it against a downloaded one the runtime stage never receives.

ovphysx,ovrtx runs like the other six. It did not complete under ovphysx 0.5.10 — measured on 8× L40 (four ranks) ovphysx,newton_renderer trained in 11.4 s and newton_mjwarp,ovrtx in 27.3 s, while this pairing had not reached the first iteration at 900 s — so it was carried as an xfail. develop has since bumped to ovphysx 0.5.11, which fixes it, and the xfail is gone. All seven runnable stacks are now plain tests.

Pass criterion and hangs. A pass requires Training time: in the output, not merely exit 0 — a
run that OOMs still exits 0 through the launcher. Silence is the hang signal, and startup and steady
state get separate budgets because they have different silence profiles: Kit boot, Warp kernel
compilation and OVRTX pipeline compilation are legitimately silent for minutes, while silence
between logged iterations is a real hang. Nothing gates on how long a run takes. The child is killed
by process group, since killing only the wrapper leaves rank workers holding GPU memory.

Trigger scope. The smoke gate fires only on the actual dependencies of
Isaac-Cartpole-Camera-Direct — the core runtime, the physics/renderer backends, the RL entry
point, the training script, CI actions, Docker images, dependency files, and CARTPOLE_CFG.
Unrelated manager, contrib, mimic/teleop and experimental tasks do not pay for a multi-GPU run.

4. Validation

Runs on the 4× A10G multi-GPU CI pool. Sized for it: at 1024 envs a single rank reached 20.72 GiB of
the 23 GiB card, so the smoke value is 512.

Lane Cases Result Where
Kit (-m "not kitless") 7 7 passed, 431.63 s local, published Isaac Lab image
Kit (-m "not kitless") 7 7 passed, 795.93 s CI, 4× A10G
Kit-less (-m kitless) 8 8 passed, 555.52 s local, image built from docker/Dockerfile.kitless
Kit-less (-m kitless) 8 pending — run in flight CI, 4× A10G

Both lanes were reproduced locally under CI's container contract — the mount set and
--user <uid>:<gid> from .github/actions/run-tests/run_tests.sh. That foreign uid is the
condition the OVRTX shader-cache chmod exists to survive.

Independently of this PR, the multi-GPU smoke exposed that rsl_rl's broadcast_parameters leaves
~1.27 GiB per rank of CUDA context on foreign GPUs — reported upstream as
rsl_rl#231 and fixed by
rsl_rl#233. That waste is why 1024 envs did not
fit; the 512 value here is correct regardless of how that is resolved.

5. Screenshots

None.

6. Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation — no public API change
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog — .skip, this is tests and CI only
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Release backport

  • Backport this pull request to the active release branch after it merges into develop

hujc7 added 2 commits August 6, 2026 10:58
The multi-GPU workflow parametrizes each test over one device per shard,
which cannot express a job that owns two GPUs at once. Nothing in CI
therefore exercised multi-GPU rendering, and NVBUG#6565122 -- a heap
corruption in Kit's Isaac Sim RTX renderer that only fires when the two
GPUs span a cross-socket boundary -- shipped uncaught.

Add smoke tests that launch real two-rank training runs and choose their
GPU pair by interconnect class rather than taking whatever cuda:0,cuda:1
happens to be. On a two-socket 8-GPU host the default pick is a
same-switch pair, so a fixed choice would never exercise the failing
path.

Each class is handled on its own terms: same-switch is strict and is the
regression guard, cross-socket is expected-fail for the two Kit-renderer
stacks and strict for the kitless newton_mjwarp,ovrtx stack, and the
unmeasured PXB/PHB/NODE classes skip rather than assert either verdict.
A physics-only case runs on any two visible devices so the step is never
vacuous when every camera case skips.

The expected-failure marker is applied only after the documented
signature is confirmed, so an OOM or an argument error on a cross-socket
pair is not recorded as the known crash.
@github-actions github-actions Bot added isaac-lab Related to Isaac Lab team infrastructure labels Aug 6, 2026
hujc7 added 9 commits August 7, 2026 02:43
The smoke step ran docker with no volume mount, so `cd /workspace/isaaclab`
landed in the image's baked-in copy rather than the PR checkout. pytest
collected 0 items and the step failed with 'file or directory not found'.

Mount $PWD and run as the host user, matching what
multi_gpu_host_launcher.sh already does for the sharded runs. Without
--user the container writes root-owned files into the runner workspace.

Also surface a ::warning:: when the runner's GPU topology cannot exercise
a case, so a run that skips the NVBUG#6565122 coverage does not read as a
normal green run.
The smoke step hand-rolled its own `docker run`, duplicating a fraction of
the container contract that .github/actions/run-tests already provides --
and getting parts of it wrong. It had no workspace mount (so pytest
collected 0 items against the image's baked-in copy), and once that was
added, `--user` without a writable HOME failed on /root/.cache.

Passing a file path rather than `tools` skips the conftest sharding
orchestrator, so this is still a plain single pytest run on all GPUs, with
no device restriction -- the tests continue to pick their own GPU pair per
interconnect class. What it gains is the standard contract: writable HOME
plus XDG_CACHE_HOME/XDG_DATA_HOME, the Isaac Sim cache mounts, warp cache,
and junit results collected into reports/. Previously --junitxml wrote to
/tmp inside a --rm container, so the smoke step contributed nothing to the
aggregated test report.

What remains smoke-specific is the topology report, split out into
multi_gpu_topology_report.sh: the tests skip when the host offers no
qualifying GPU pair, which is correct but silent, so the run summary needs
to say the coverage was not exercised. Its guard now matches the matrix
rows only -- `nvidia-smi topo -m` prints a legend naming every class, so
grepping the whole output found SYS and PIX on a host that had neither and
the warning never fired.

Also reword the topology skip so "unreadable topology" is distinguishable
from "no qualifying pair on this host"; the old message sent readers
looking for a parsing bug that was not there.
CUDA_VISIBLE_DEVICES renumbers devices for CUDA but not for the graphics
stack. AppLauncher passed the same masked index to both /physics/cudaDevice
and /renderer/activeGpu, so whenever the visible devices did not begin at
zero the renderer requested a device outside the visible set, failed to
create it, and the run aborted with CUDA error 700.

Translate only the renderer index to a physical one. physics_gpu stays
masked because /physics/cudaDevice is resolved by CUDA itself. Masks that
already begin at zero are unaffected, and UUID or MIG masks fall back to
the previous behavior since no physical index can be derived from them.
/renderer/activeGpu indexes the graphics device list, which
CUDA_VISIBLE_DEVICES does not filter, so passing the CUDA device index
there selected the wrong GPU whenever the visible devices did not start
at zero. The renderer then failed to create a device and the run aborted
with CUDA error 700 from a Warp launch.

Select the device through /renderer/multiGpu/activeCudaGpus instead,
which takes CUDA indices and is translated by the renderer itself, and
stop setting activeGpu -- the translation is only applied when no
explicit graphics index is given. physics_gpu is unchanged, since
/physics/cudaDevice is resolved by CUDA.
Setting active_gpu to None was redundant: SimulationApp already defaults
it to None and only emits --/renderer/activeGpu when it is set, so not
assigning it leaves the renderer at its own -1 default, which is what the
CUDA index translation requires. It also stops overriding an active_gpu
passed by the caller.

Move the device selection tests into the existing app launcher argv
suite, which already covers the arguments handed to Kit.
The camera cases picked their GPU pair by interconnect class, which never
selected anything: the multi-GPU runner is four GPUs on one NUMA node with
every pair PHB, so it has neither a same-switch nor a cross-socket pair and
all six cases skipped. The class also does not decide the outcome -- a pair
is exercised by whether CUDA_VISIBLE_DEVICES reorders it, since that
renumbers devices for CUDA but not for the graphics stack.

Pick the devices by order instead: one case with no mask, one exposing four
GPUs as 3,1,2,0 so no rank's CUDA index matches its graphics index. Both run
on any four-GPU host, including the runner.

Drop gpu_pairs_by_topology() and its tests with the classification, and the
workflow's topology report with them. Separately, the parser returned nothing
on any real host: nvidia-smi underlines the header even into a pipe, so
\bGPU0\b matched nothing, the header came up a column short and the last row
tripped the partial-matrix guard.

Split the stacks across two steps by what each needs installed, since ovrtx
ships in neither image and would otherwise fail the whole step.
@hujc7 hujc7 changed the title Add multi-GPU training smoke tests with cross-socket xfail Add multi-GPU training smoke tests Aug 13, 2026
@hujc7 hujc7 mentioned this pull request Aug 13, 2026
5 of 6 tasks
hujc7 added 2 commits August 13, 2026 17:12
Matches how the isaaclab_ov job provisions it: the ov extra is in
MANUAL_EXTRA_FEATURES and the images do not carry it, so the pins are
resolved and installed per run rather than baked into the image, which
would bypass the wheelhouse path ovphysx uses.
The ov extra is in MANUAL_EXTRA_FEATURES, so neither a bare --install nor
-i all selects it and the image cannot import ovrtx. The ovrtx renderer is
a supported backend, so install it as its own step, leaving the default
selector untouched.

This lets the kitless smoke step run on the same image as the rest of the
job instead of resolving and installing the pins per run.
ooctipus added a commit that referenced this pull request Aug 15, 2026
## Review Map

- The "Exact changes" link pins a stacked PR's own commit range; its PR
page shows the cumulative diff of the whole dependency chain.
- SHA links can go stale after a branch update; this PR's copy is
refreshed first.

| PR | Status | Depends on | Exact changes |
|---|---|---|---|
| 📌 #7057 — select the renderer device by CUDA index (1/2) (this PR) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/7057?label=)
| — | — |
| #6946 — multi-GPU training smoke tests (2/2) (draft) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6946?label=)
| #7057 |
[33d65ab..2931ce8](https://github.com/isaac-sim/IsaacLab/pull/6946/changes/33d65ab615d03f7ba07be8674c18f5d78d2d10b7..2931ce80a9448c26aada6cd02557d52dcbb0564e)
|

## 1. Summary

Multi-GPU rendering fails whenever `CUDA_VISIBLE_DEVICES` does not begin
at zero (`1,2`, `4,5,6,7`, …), aborting with `CUDA error 700`.
`AppLauncher` passed the masked CUDA index to `/renderer/activeGpu`,
which indexes the graphics device list that the mask never filtered.
Select the device by CUDA index instead — 4 lines, 17 configurations
validated at 2-8 ranks.

## 2. Type of change

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

## 3. Design notes

`CUDA_VISIBLE_DEVICES` renumbers devices for CUDA but not for the
graphics stack, so everything selecting *through* CUDA was always
correct: torch, Warp, PhysX via `/physics/cudaDevice`, and the kitless
`ovrtx` renderer. `/renderer/multiGpu/activeCudaGpus` takes CUDA indices
and is translated by the renderer itself (Kit MR !42520); `activeGpu` is
no longer set, since that translation only applies when no explicit
graphics index is given. `physics_gpu` is unchanged.

Dropping `activeGpu` entirely, or passing Kit's `-1` auto value, also
stops the crash — but every rank then auto-selects the same device and
the renderers stack: 380% memory spread at 8 ranks, 26.4 GB on GPU0
against 6.9 GB per peer. Auto-selection is per-process and cannot know
the rank.

## 4. Validation

8x L40S, same command throughout, varying only the mask and rank count:

```bash
CUDA_VISIBLE_DEVICES=<mask> ./isaaclab.sh -p \
  scripts/reinforcement_learning/train_multigpu.py --num_gpus <ranks> \
  --log_all_ranks --master_port <port> --rl_library rsl_rl \
  --task Isaac-Cartpole-Camera-Direct presets=isaacsim_physx,isaacsim_rtx \
  --num_envs 64 --max_iterations 5
```

17 configurations, all pass. Ranks 2-8; offset, interleaved (`0,4,1,5`)
and reversed (`7,6,5,4,3,2,1,0`) masks, each of which fails before this
change; identity masks at 2/3/4/8 ranks as regression checks. Per-GPU
memory spread is 99-102% throughout (100% is even) and host RAM is flat
at ~6.4 GB/rank, both matching the identity controls — the change costs
nothing on either axis.

## 5. Screenshots

None.

## 6. Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation — no public
API change
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog — `source/isaaclab/changelog.d/`;
`config/extension.toml` is left to the version-bump job per `AGENTS.md`
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Octi Zhang <[email protected]>
hujc7 added 7 commits August 19, 2026 12:42
isaac-sim#7057 landed on develop as e8dc0bf, so the branch no longer needs its
renderer changes: the orphaned extra_args entry (develop selects the device
through _resolve_kit_args instead) and the changelog fragment, which the
compile job already folded into the changelog.
Installing the ov extra into the Isaac Sim image resolves ovphysx's
packaging<24 cap with pip, which has no override mechanism, so it replaces
the prebundled packaging 26.0 that a dozen Kit extensions symlink into.
The install guard then aborts the build with 12 broken prebundled packages,
which is what turned three CI workflows red and skipped ~20 test jobs.

The kit-less image already installs ov[all] safely: with no Isaac Sim there
is no prebundle to overwrite. Route the kitless tests there instead.
Collapse the four near-identical camera tests into one case parametrized
over a stack table and the two device orders, so adding a backend is one
line instead of a method.

The grid is 3 physics x 3 renderers. Only isaacsim_physx,ovrtx and
ovphysx,isaacsim_rtx cannot run: OVRTX and OvPhysX are kitless and cannot
share a process with Kit. The Newton renderer pairs with every physics
backend because NewtonManager.get_model builds a shadow model when the
active backend is not Newton, so it appears three times.

Measured on 8x L40, four ranks: isaacsim_physx,newton_renderer 17.3 s,
newton_mjwarp,newton_renderer 16.9 s, ovphysx,newton_renderer 11.4 s.
ovphysx,ovrtx is the one pairing that does not complete and stays xfailed.

Kitless stacks get a wider silence budget: OVRTX compiles ray-tracing
pipeline objects for minutes on a cold shader cache while reporting
progress only to its own log, so stdout goes quiet on a healthy run.
Add a kit-less image build so each stack runs in the image carrying its
runtime: Kit stacks in the base image, kitless stacks in the kit-less one,
which already ships ov[all]. This replaces the per-run ovrtx wheel install.
Both builds run on the multi-GPU pool because the ECR cache repo is
resolved per runner pool, so an image built elsewhere is invisible here.

Replace the workflow-level paths filter with two detect-changes gates. The
sharded device tests keep the narrow trigger; the training smoke drives a
real multi-rank run, so it is gated on the whole core library. Gating in a
job rather than a paths filter also keeps the check reported when skipped,
which a required check needs.

Raise the timeout to 120 minutes: the smoke matrix adds roughly 30 minutes
on top of the shards.
@hujc7 hujc7 changed the title Add multi-GPU training smoke tests [MGPU] Add multi-GPU training smoke tests Aug 26, 2026
hujc7 added 2 commits August 26, 2026 01:52
The smoke tests exercise exactly two gym ids, Isaac-Cartpole-Direct and
Isaac-Cartpole-Camera-Direct, but the gate matched all of isaaclab_tasks
and isaaclab_assets, so an unrelated manager task, contrib task or robot
asset cost a full multi-GPU run.

Match their own sources instead, traced from the imports: the direct
Cartpole envs and their registration, the Cartpole agent configs, the
preset resolution the presets= selector goes through, and CARTPOLE_CFG.
The manager cfgs and the cartpole mdp/ subdir are excluded -- the direct
envs do not reference them.

Runtime patterns are unchanged: a multi-rank run loads the whole core
library, both backends and the RL integration regardless of task.
…failure

The cases run sequentially in one CI job and every one launched torchrun on
the default port 29500. A killed rank releases the port asynchronously, so
the next case aborted with "The server socket has failed to listen on any
local network address", which the harness then reported as a training
failure. Three of the six CI failures were this. Bind an ephemeral port per
case instead.

The remaining two failed inside the OVRTX renderer with a 36 MB CUDA
allocation error, which the logs cannot explain: they carry the size of the
failed allocation but not the device it ran on, so a full GPU and one too
small for the workload look identical. Print the per-GPU model and memory
alongside the captured output when a case does not pass.
@hujc7

hujc7 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot removed the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Aug 30, 2026
hujc7 added 2 commits August 30, 2026 00:31
CI checks out with lfs: true and bind-mounts that tree into the container. Any git
call then invokes the LFS filter, which without the binary fails with 'the remote
end hung up unexpectedly' -- rsl_rl records code state via git at startup, so every
kit-less case died before allocating any GPU memory (all four GPUs idle at ~130 MiB).

Dockerfile.base inherits git-lfs from the Isaac Sim base, which is why the Kit lane
passes 7/7 while the kit-less lane failed 0/8.
@hujc7 hujc7 added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Aug 30, 2026
hujc7 added 4 commits August 30, 2026 01:04
Forces run_install_tests / run_kitless_tests / should_run to 'false' in the
install-ci, kitless-docker and arm-ci detect-changes jobs so their gated jobs
skip via the existing if-guards. Keeps the multi-GPU pytest workflow as the
only heavy lane running per push.

Must be reverted before final review.
The kit-less smoke ran as a step inside 'Multi-GPU unit tests', which listed
build-kitless in its needs. A kit-less image build that failed - or a runner
that died under it - therefore took down the Kit-renderer lane as well, even
though that lane uses a different image and has no dependency on the kit-less
one.

Move the kit-less ECR pull and smoke step into test-multi-gpu-smoke-kitless,
needing only build-kitless, and drop build-kitless from the Kit job's needs.
The lanes now fail and retry independently, and the check name identifies which
one broke. Where two multi-GPU runners are free they overlap; where only one is,
the scheduler serialises them onto it, matching the previous behaviour.
@hujc7 hujc7 added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 1, 2026
@hujc7
hujc7 marked this pull request as ready for review September 1, 2026 07:08
@hujc7
hujc7 requested a review from a team September 1, 2026 07:08

@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

Adds multi-GPU training smoke coverage across seven physics/renderer stacks, split between Kit and kit-less images, and reworks the kit-less image to install from uv.lock into a venv outside the bind-mounted checkout. The smoke-test change gate needs to include all files consumed by the kit-less image build.

  • Design and architecture: The separate Kit and kit-less lanes appropriately isolate incompatible runtime stacks, while the reordered GPU visibility cases exercise renderer device selection. Moving the kit-less venv outside ISAACLAB_PATH preserves it when CI bind-mounts the checkout.
  • API: No public Python API changes are introduced. The container environment contract is updated consistently between the builder and runtime stages, and the tests/CI-only scope is represented by a .skip changelog fragment.
  • Implementation: The subprocess runner includes process-group cleanup, distinct startup and steady-state silence budgets, and a training-output completion criterion. However, the workflow's smoke-change patterns omit docker/docker-compose.yaml and docker/utils/volume_mounts.py, even though Dockerfile.kitless copies and executes them; changes to those image inputs can therefore skip the smoke jobs and report green.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

^source/isaaclab_tasks/isaaclab_tasks/(__init__\.py$|utils/|core/cartpole/(agents/|__init__\.py$|cartpole_direct_)) :: Direct Cartpole envs, their registration and agent configs, plus the preset resolution the presets= selector goes through
^source/isaaclab_assets/isaaclab_assets/robots/cartpole\.py$ :: CARTPOLE_CFG, the only asset these envs load
^scripts/reinforcement_learning/ :: Multi-GPU training entry point
^docker/Dockerfile\.(base|kitless)$ :: CI image definitions

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.

🔵 Suggestion · Implementation — Smoke gate misses kit-less image inputs

The smoke patterns match only docker/Dockerfile.(base|kitless), but Dockerfile.kitless copies docker/docker-compose.yaml and docker/utils/volume_mounts.py and executes the latter to pre-create and chown named-volume mount points. A change to either alters the built image while both smoke jobs are skipped and report green. Add these build inputs to the smoke pattern list.

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.

do we also need to update docker-compose?

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds multi-GPU training smoke coverage across Kit and kit-less physics/renderer stacks, including reordered GPU visibility, and introduces a dedicated locked kit-less image.

  • Adds change-gated Kit and kit-less CI lanes on the multi-GPU runner pool.
  • Adds fifteen training smoke cases with process-group cleanup, silence timeouts, and GPU diagnostics.
  • Moves the kit-less virtual environment outside the bind-mounted checkout and installs it from uv.lock.

Confidence Score: 4/5

The PR appears safe to merge, with one non-blocking subprocess diagnostic edge case worth hardening.

The CI and image changes have coherent gating and runtime setup, while the smoke harness can lose its intended classification and diagnostics if its final nonblocking pipe drain encounters a would-block state.

Files Needing Attention: source/isaaclab/test/multi_gpu/test_multi_gpu_training_smoke.py

Important Files Changed

Filename Overview
.github/workflows/test-multi-gpu-pytest.yaml Adds path-sensitive gating, image builds, and separate Kit and kit-less multi-GPU smoke lanes.
docker/Dockerfile.kitless Relocates and lock-installs the virtual environment, adds runtime dependencies, and preserves it across checkout bind mounts.
source/isaaclab/test/multi_gpu/test_multi_gpu_training_smoke.py Adds the backend/device-order smoke matrix and subprocess monitoring, with a nonblocking final-drain edge case.
docker/test/test_dockerfile_nonroot.py Updates static Dockerfile assertions for the lock-based installation and external virtual environment.
source/isaaclab/changelog.d/jichuanh-mgpu-camera-smoke-xfail.skip Records that the tests-and-CI-only change requires no release note.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  PR[Pull request] --> Changes[Detect relevant changes]
  Changes -->|Unit or smoke| KitBuild[Build/cache Kit image]
  Changes -->|Smoke| KitlessBuild[Build/cache kit-less image]
  KitBuild --> Unit[Multi-GPU unit shards]
  KitBuild --> KitSmoke[Kit-renderer training smoke]
  KitlessBuild --> KitlessSmoke[Kit-less training smoke]
  Unit --> Summary[Aggregated test summary]
  KitSmoke --> Summary
Loading

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile

break
else:
time.sleep(0.2)
lines.append(process.stdout.read() or "") # type: ignore[union-attr]

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.

P2 Nonblocking final pipe drain

If a descendant still holds the inherited stdout pipe open after the wrapper exits, this unguarded read() can encounter a would-block state and raise BlockingIOError, causing the smoke test to error without returning its classification or retained diagnostics.

@kellyguo11
kellyguo11 merged commit bb30c7f into isaac-sim:develop Sep 3, 2026
52 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 3872511.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 3, 2026
## 1. Summary

Nothing in CI exercised multi-GPU rendering. This adds real four-rank
training runs that do,
chosen to catch renderer device-selection defects: every runnable
physics/renderer stack, each run
both with the host's default device order and with four GPUs exposed as
`3,1,2,0`.

## 2. Type of change

- New feature (non-breaking change which adds functionality)

## 3. Design notes

**Why a reordered device list.** `CUDA_VISIBLE_DEVICES` renumbers
devices for CUDA but not for the
graphics stack, so a run is only exposed to a selection defect when the
visible devices are
*reordered* — with `3,1,2,0` no rank's CUDA index matches its graphics
index, and no rank can be
recovered by assuming the list is sorted or contiguous. The unmasked
case is the baseline it is read
against: it passes even when selection is wrong. Four ranks rather than
two, because with two a
wrong device can still land on a visible GPU by chance.

**The grid.** 3 physics × 3 renderers. Two cells cannot run at all —
`isaacsim_physx,ovrtx` and
`ovphysx,isaacsim_rtx` are rejected before launch by
`sim_launcher._validate_runtime`, since OVRTX
and OvPhysX are kitless and cannot share a process with Kit. The Newton
renderer pairs with *every*
physics backend, because `NewtonManager.get_model` builds a shadow model
when the active backend is
not Newton. That leaves 7 runnable stacks × 2 device orders, plus one
unparameterised physics-only
case = 15 cases.

**Two images, not two wheel installs.** `ov[all]` cannot be installed
into the Isaac Sim image:
`ovphysx` declares `Requires-Dist: packaging<24,>=20`, and the pip-style
path honours it, downgrading
`packaging` and destroying Isaac Sim's prebundle. The kit-less stacks
therefore run in
`docker/Dockerfile.kitless`, built from ubuntu with no Isaac Sim and so
no prebundle to break, and
the `kitless` pytest marker routes each stack to the image carrying its
runtime. Keeping them
separate also means a fault in the kit-less renderer cannot take down
Kit-renderer coverage.

**The kit-less image installs from `uv.lock`.** Only the lock applies
`[tool.uv]
override-dependencies`, the table holding `packaging` above ovphysx's
`<24` pin; the pip-style path
ignores it. Its interpreter lives outside `ISAACLAB_PATH` because CI
bind-mounts the checkout over
that path, and `UV_PYTHON` pins the system interpreter so `uv sync`
reuses the venv rather than
rebuilding it against a downloaded one the runtime stage never receives.

**`ovphysx,ovrtx` runs like the other six.** It did not complete under
ovphysx 0.5.10 — measured on 8× L40 (four ranks)
`ovphysx,newton_renderer` trained in 11.4 s and `newton_mjwarp,ovrtx` in
27.3 s, while this pairing had not reached the first iteration at 900 s
— so it was carried as an xfail. develop has since bumped to **ovphysx
0.5.11**, which fixes it, and the xfail is gone. All seven runnable
stacks are now plain tests.

**Pass criterion and hangs.** A pass requires `Training time:` in the
output, not merely exit 0 — a
run that OOMs still exits 0 through the launcher. Silence is the hang
signal, and startup and steady
state get separate budgets because they have different silence profiles:
Kit boot, Warp kernel
compilation and OVRTX pipeline compilation are legitimately silent for
minutes, while silence
between logged iterations is a real hang. Nothing gates on how long a
run takes. The child is killed
by process group, since killing only the wrapper leaves rank workers
holding GPU memory.

**Trigger scope.** The smoke gate fires only on the actual dependencies
of
`Isaac-Cartpole-Camera-Direct` — the core runtime, the physics/renderer
backends, the RL entry
point, the training script, CI actions, Docker images, dependency files,
and `CARTPOLE_CFG`.
Unrelated manager, contrib, mimic/teleop and experimental tasks do not
pay for a multi-GPU run.

## 4. Validation

Runs on the 4× A10G multi-GPU CI pool. Sized for it: at 1024 envs a
single rank reached 20.72 GiB of
the 23 GiB card, so the smoke value is 512.

| Lane | Cases | Result | Where |
|---|---|---|---|
| Kit (`-m "not kitless"`) | 7 | 7 passed, 431.63 s | local, published
Isaac Lab image |
| Kit (`-m "not kitless"`) | 7 | 7 passed, 795.93 s | CI, 4× A10G |
| Kit-less (`-m kitless`) | 8 | 8 passed, 555.52 s | local, image built
from `docker/Dockerfile.kitless` |
| Kit-less (`-m kitless`) | 8 | pending — run in flight | CI, 4× A10G |

Both lanes were reproduced locally under CI's container contract — the
mount set and
`--user <uid>:<gid>` from `.github/actions/run-tests/run_tests.sh`. That
foreign uid is the
condition the OVRTX shader-cache `chmod` exists to survive.

Independently of this PR, the multi-GPU smoke exposed that rsl_rl's
`broadcast_parameters` leaves
~1.27 GiB per rank of CUDA context on foreign GPUs — reported upstream
as
[rsl_rl#231](leggedrobotics/rsl_rl#231) and
fixed by
[rsl_rl#233](leggedrobotics/rsl_rl#233). That
waste is why 1024 envs did not
fit; the 512 value here is correct regardless of how that is resolved.

## 5. Screenshots

None.

## 6. Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation — no public
API change
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog — `.skip`, this is tests and CI only
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there


## Release backport

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

(cherry picked from commit bb30c7f)
kellyguo11 pushed a commit that referenced this pull request Sep 9, 2026
…7628)

# Description

`uv run` inside the kit-less container ignored the environment the image
ships and built a
second one from scratch. Where the source tree is bind-mounted from the
host — Compose,
CI, and the documented developer workflow all do this — the editable
rebuild wrote
`egg-info` into files the image's uid cannot touch and the command died
with
`Permission denied`. Reported as NVBug 6732972 against Isaac Sim 6.1.0
rc26 /
Isaac Lab 3.0.0 EA, on both x86_64 and aarch64.

## 1. Summary

* `uv run isaaclab train …` works inside the kit-less image again,
instead of failing with
  `could not create '<package>.egg-info': Permission denied`.
* Removes a silent 188-package reinstall (plus a downloaded CPython)
from every in-container
  `uv` invocation.

## 2. Cause

`docker/Dockerfile.kitless` is the only multi-stage image in the repo,
and `ENV` does not
cross stages. Its `builder` stage sets `UV_PROJECT_ENVIRONMENT`,
`UV_PYTHON` and
`UV_PYTHON_PREFERENCE`; the `runtime` stage sets neither.
`Dockerfile.base` and
`Dockerfile.curobo` are single-stage, so their copies survive to runtime
— which is why this
reproduces only on the kit-less image.

uv resolves the project environment from `UV_PROJECT_ENVIRONMENT` alone
and does not honour
`VIRTUAL_ENV`, so every in-container `uv run` emitted

```
warning: `VIRTUAL_ENV=/opt/isaaclab-venv` does not match the project environment path `.venv`
         and will be ignored; use `--active` to target the active environment instead
```

and then built `/workspace/isaaclab/.venv` from the lock, rebuilding all
12 editable path
packages in place under `source/`.

Introduced by #6946, which moved the runtime venv from
`${ISAACLAB_PATH}/.venv` — uv's own
default project path, which is why this worked before — to
`/opt/isaaclab-venv`.

## 3. Fix

Four `ENV` lines in the runtime stage:

| Variable | Without it |
|---|---|
| `UV_PROJECT_ENVIRONMENT` | uv targets `${ISAACLAB_PATH}/.venv` and
installs 188 packages |
| `UV_PYTHON`, `UV_PYTHON_PREFERENCE` | `pyproject` pins
`python-preference = "only-managed"`, so uv downloads its own CPython
and **replaces** the venv rather than reusing it |
| `UV_NO_SYNC` | `uv run` still rebuilds the 12 editable packages in
place, so the `egg-info` write still fails on a mounted source tree |

All four are required: the first three alone leave the reported failure
intact (§4).

## 4. Validation

Measured against a rebuilt image, with `source/` bind-mounted read-only
from the host as CI
does. QA's verbatim command, on an 8x NVIDIA L40 node:

```
uv run --extra ov isaaclab train --rl_library rsl_rl --task Isaac-Cartpole-Camera-Direct \
    physics=ovphysx renderer=ovrtx presets=rgb --max_iterations 5
```

rc=0, 0 tracebacks, 0 `egg-info` errors, 0 uv project-environment
warnings,
`Training time: 85.08 seconds`. This is QA's SMOKE TEST at their
`--max_iterations 5`, kept
verbatim as the bug repro; its reward and success-rate numbers are
artifacts of a 5-iteration
run and are not policy results.

Arm-by-arm, same image and mounts:

| Image | `uv run --extra ov …` |
|---|---|
| unfixed | fails — `egg-info … Permission denied` |
| + `UV_PROJECT_ENVIRONMENT`, `UV_PYTHON`, `UV_PYTHON_PREFERENCE` |
fails — same error |
| + `UV_NO_SYNC` (this PR) | rc=0, `sys.prefix=/opt/isaaclab-venv`, no
`.venv` created |

`pre-commit run --all-files` clean; `docker/test` 38 passed, 1 skipped.

## 5. Test added

Every step in `.github/actions/validate-kitless-image/action.yml`
invoked `python` directly or
`uv pip install --python "$VIRTUAL_ENV/bin/python"`; nothing ran `uv
run`, which is why CI
stayed green while the documented user command was broken. This PR adds
a `uv run` step
asserting `sys.prefix == $VIRTUAL_ENV` and that no
`${ISAACLAB_PATH}/.venv` appears. Verified
to fail on the unfixed image and pass on the fixed one.

`kitless-docker.yml`'s change gate already lists both
`docker/Dockerfile.kitless` and
`.github/actions/validate-kitless-image/`, so this PR builds and
validates the image with no
workflow changes.

## 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`

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] No documentation change is required — the documented commands are
unchanged; this restores them working inside the image
- [x] My changes generate no new warnings — it removes one uv emitted on
every in-container run
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] 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)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 9, 2026
…7628)

# Description

`uv run` inside the kit-less container ignored the environment the image
ships and built a
second one from scratch. Where the source tree is bind-mounted from the
host — Compose,
CI, and the documented developer workflow all do this — the editable
rebuild wrote
`egg-info` into files the image's uid cannot touch and the command died
with
`Permission denied`. Reported as NVBug 6732972 against Isaac Sim 6.1.0
rc26 /
Isaac Lab 3.0.0 EA, on both x86_64 and aarch64.

## 1. Summary

* `uv run isaaclab train …` works inside the kit-less image again,
instead of failing with
  `could not create '<package>.egg-info': Permission denied`.
* Removes a silent 188-package reinstall (plus a downloaded CPython)
from every in-container
  `uv` invocation.

## 2. Cause

`docker/Dockerfile.kitless` is the only multi-stage image in the repo,
and `ENV` does not
cross stages. Its `builder` stage sets `UV_PROJECT_ENVIRONMENT`,
`UV_PYTHON` and
`UV_PYTHON_PREFERENCE`; the `runtime` stage sets neither.
`Dockerfile.base` and
`Dockerfile.curobo` are single-stage, so their copies survive to runtime
— which is why this
reproduces only on the kit-less image.

uv resolves the project environment from `UV_PROJECT_ENVIRONMENT` alone
and does not honour
`VIRTUAL_ENV`, so every in-container `uv run` emitted

```
warning: `VIRTUAL_ENV=/opt/isaaclab-venv` does not match the project environment path `.venv`
         and will be ignored; use `--active` to target the active environment instead
```

and then built `/workspace/isaaclab/.venv` from the lock, rebuilding all
12 editable path
packages in place under `source/`.

Introduced by #6946, which moved the runtime venv from
`${ISAACLAB_PATH}/.venv` — uv's own
default project path, which is why this worked before — to
`/opt/isaaclab-venv`.

## 3. Fix

Four `ENV` lines in the runtime stage:

| Variable | Without it |
|---|---|
| `UV_PROJECT_ENVIRONMENT` | uv targets `${ISAACLAB_PATH}/.venv` and
installs 188 packages |
| `UV_PYTHON`, `UV_PYTHON_PREFERENCE` | `pyproject` pins
`python-preference = "only-managed"`, so uv downloads its own CPython
and **replaces** the venv rather than reusing it |
| `UV_NO_SYNC` | `uv run` still rebuilds the 12 editable packages in
place, so the `egg-info` write still fails on a mounted source tree |

All four are required: the first three alone leave the reported failure
intact (§4).

## 4. Validation

Measured against a rebuilt image, with `source/` bind-mounted read-only
from the host as CI
does. QA's verbatim command, on an 8x NVIDIA L40 node:

```
uv run --extra ov isaaclab train --rl_library rsl_rl --task Isaac-Cartpole-Camera-Direct \
    physics=ovphysx renderer=ovrtx presets=rgb --max_iterations 5
```

rc=0, 0 tracebacks, 0 `egg-info` errors, 0 uv project-environment
warnings,
`Training time: 85.08 seconds`. This is QA's SMOKE TEST at their
`--max_iterations 5`, kept
verbatim as the bug repro; its reward and success-rate numbers are
artifacts of a 5-iteration
run and are not policy results.

Arm-by-arm, same image and mounts:

| Image | `uv run --extra ov …` |
|---|---|
| unfixed | fails — `egg-info … Permission denied` |
| + `UV_PROJECT_ENVIRONMENT`, `UV_PYTHON`, `UV_PYTHON_PREFERENCE` |
fails — same error |
| + `UV_NO_SYNC` (this PR) | rc=0, `sys.prefix=/opt/isaaclab-venv`, no
`.venv` created |

`pre-commit run --all-files` clean; `docker/test` 38 passed, 1 skipped.

## 5. Test added

Every step in `.github/actions/validate-kitless-image/action.yml`
invoked `python` directly or
`uv pip install --python "$VIRTUAL_ENV/bin/python"`; nothing ran `uv
run`, which is why CI
stayed green while the documented user command was broken. This PR adds
a `uv run` step
asserting `sys.prefix == $VIRTUAL_ENV` and that no
`${ISAACLAB_PATH}/.venv` appears. Verified
to fail on the unfixed image and pass on the fixed one.

`kitless-docker.yml`'s change gate already lists both
`docker/Dockerfile.kitless` and
`.github/actions/validate-kitless-image/`, so this PR builds and
validates the image with no
workflow changes.

## 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`

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] No documentation change is required — the documented commands are
unchanged; this restores them working inside the image
- [x] My changes generate no new warnings — it removes one uv emitted on
every in-container run
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] 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)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

(cherry picked from commit 28d3527)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants