Skip to content

fix(docker): drop --ldconfig arg from enroot NVIDIA hook - #2781

Merged
kajalj22 merged 3 commits into
r0.5.1from
fix-enroot-ldconfig-hook
Aug 26, 2026
Merged

fix(docker): drop --ldconfig arg from enroot NVIDIA hook#2781
kajalj22 merged 3 commits into
r0.5.1from
fix-enroot-ldconfig-hook

Conversation

@kajalj22

@kajalj22 kajalj22 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Patches /etc/enroot/hooks.d/98-nvidia.sh at build time to drop the --ldconfig=@... arg passed to nvidia-container-cli
  • Fixes nested enroot GPU sandboxes failing with:
    nvidia-container-cli: ldcache error: process /usr/sbin/ldconfig.real failed with error code: 1
    [ERROR] /etc/enroot/hooks.d/98-nvidia.sh exited with return code 1
    

Context

Nested enroot GPU passthrough under Slurm/pyxis fails under some GPU cgroup configurations because nvidia-container-cli's --ldconfig=@... flag makes it re-exec the sandbox's ldconfig to regenerate ld.so.cache, and that regeneration step crashes. Dropping the flag makes it reuse the existing cache instead, which avoids the failure. Reproduces with any container doing nested enroot GPU passthrough on affected clusters, not something specific to Gym.

Test plan

  • Verified live on a cluster hitting this failure: with this patch applied to a running container's hook script, nvidia-smi succeeds inside a nested enroot sandbox (GPU visible) — previously failed at the hook step with the exact error above
  • Verify a full image build applies the patch correctly (grep assertion in the Dockerfile fails the build loudly if the hook content changes upstream and the sed no longer matches)
  • Re-run the real gym env start + mini_swe_agent_2 + enroot repro from the original bug report against the rebuilt image

nvidia-container-cli fails to inject GPUs into nested enroot sandboxes
with:

  nvidia-container-cli: ldcache error: process /usr/sbin/ldconfig.real
  failed with error code: 1
  [ERROR] /etc/enroot/hooks.d/98-nvidia.sh exited with return code 1

This reproduces on any container doing nested enroot GPU passthrough
under Slurm/pyxis, not just Gym's -- confirmed independently by
NVIDIA's computelab team (who hit it in their own Pyxis CI) and
reproduced live on cw_dfw with a completely unrelated test image.

Root cause: nvidia-container-cli's --ldconfig=@... flag makes it
re-exec the target container's ldconfig to regenerate its ld.so.cache,
which fails under certain Slurm/pyxis GPU cgroup/device-restriction
configurations. Dropping the flag makes it reuse the existing
ld.so.cache instead, sidestepping the failure -- the same workaround
computelab validated for their own Pyxis test breakage.

Verified live on cw_dfw: nvidia-smi now succeeds inside a nested
enroot sandbox with this patch applied (H100 GPU visible), where it
previously failed at the hook step.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22
kajalj22 requested a review from a team as a code owner August 26, 2026 06:01
@copy-pr-bot

copy-pr-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test be6395b

@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test be6395b

@kajalj22
kajalj22 merged commit 9008bb1 into r0.5.1 Aug 26, 2026
31 checks passed
@kajalj22
kajalj22 deleted the fix-enroot-ldconfig-hook branch August 26, 2026 17:16
kajalj22 added a commit that referenced this pull request Sep 2, 2026
## Summary
- Patches `/etc/enroot/hooks.d/98-nvidia.sh` at build time to drop the
`--ldconfig=@...` arg passed to `nvidia-container-cli`
- Fixes nested enroot GPU sandboxes failing with:
  ```
nvidia-container-cli: ldcache error: process /usr/sbin/ldconfig.real
failed with error code: 1
  [ERROR] /etc/enroot/hooks.d/98-nvidia.sh exited with return code 1
  ```

## Context
Nested enroot GPU passthrough under Slurm/pyxis fails under some GPU
cgroup configurations because `nvidia-container-cli`'s `--ldconfig=@...`
flag makes it re-exec the sandbox's `ldconfig` to regenerate
`ld.so.cache`, and that regeneration step crashes. Dropping the flag
makes it reuse the existing cache instead, which avoids the failure.
Reproduces with any container doing nested enroot GPU passthrough on
affected clusters, not something specific to Gym.

## Test plan
- [x] Verified live on a cluster hitting this failure: with this patch
applied to a running container's hook script, `nvidia-smi` succeeds
inside a nested `enroot` sandbox (GPU visible) — previously failed at
the hook step with the exact error above
- [ ] Verify a full image build applies the patch correctly (`grep`
assertion in the Dockerfile fails the build loudly if the hook content
changes upstream and the sed no longer matches)
- [ ] Re-run the real `gym env start` + `mini_swe_agent_2` + enroot
repro from the original bug report against the rebuilt image

---------

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
kajalj22 added a commit that referenced this pull request Sep 4, 2026
## Summary
- Patches `/etc/enroot/hooks.d/98-nvidia.sh` at build time to drop the
`--ldconfig=@...` arg passed to `nvidia-container-cli`
- Fixes nested enroot GPU sandboxes failing with:
  ```
nvidia-container-cli: ldcache error: process /usr/sbin/ldconfig.real
failed with error code: 1
  [ERROR] /etc/enroot/hooks.d/98-nvidia.sh exited with return code 1
  ```

## Context
Nested enroot GPU passthrough under Slurm/pyxis fails under some GPU
cgroup configurations because `nvidia-container-cli`'s `--ldconfig=@...`
flag makes it re-exec the sandbox's `ldconfig` to regenerate
`ld.so.cache`, and that regeneration step crashes. Dropping the flag
makes it reuse the existing cache instead, which avoids the failure.
Reproduces with any container doing nested enroot GPU passthrough on
affected clusters, not something specific to Gym.

## Test plan
- [x] Verified live on a cluster hitting this failure: with this patch
applied to a running container's hook script, `nvidia-smi` succeeds
inside a nested `enroot` sandbox (GPU visible) — previously failed at
the hook step with the exact error above
- [ ] Verify a full image build applies the patch correctly (`grep`
assertion in the Dockerfile fails the build loudly if the hook content
changes upstream and the sed no longer matches)
- [ ] Re-run the real `gym env start` + `mini_swe_agent_2` + enroot
repro from the original bug report against the rebuilt image

---------

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
kajalj22 added a commit that referenced this pull request Sep 5, 2026
#2983)

## Summary
- Cherry-pick of #2781 from `r0.5.1` into `main`. **Stack position 5 of
5** — all prior positions merged. This is the last one, rebased directly
onto `main`.
- Patches `/etc/enroot/hooks.d/98-nvidia.sh` at build time to drop the
`--ldconfig=@...` arg passed to `nvidia-container-cli`, fixing nested
enroot GPU sandboxes failing at the hook step under some GPU cgroup
configurations.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
jkyi-nvidia pushed a commit that referenced this pull request Sep 11, 2026
#2983)

## Summary
- Cherry-pick of #2781 from `r0.5.1` into `main`. **Stack position 5 of
5** — all prior positions merged. This is the last one, rebased directly
onto `main`.
- Patches `/etc/enroot/hooks.d/98-nvidia.sh` at build time to drop the
`--ldconfig=@...` arg passed to `nvidia-container-cli`, fixing nested
enroot GPU sandboxes failing at the hook step under some GPU cgroup
configurations.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Signed-off-by: Junkeun Yi <jkyi@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants