[Bug]: create-symlinks and update-ldcache hooks fail container create when the container rootfs is read-only
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
Research direction
Start from the create-symlinks and update-ldcache subcommands of nvidia-cdi-hook and the #2026 fix for update-application-profile, which already ignores read-only filesystem errors. Check how the failing write surfaces as EROFS and whether the same handling can apply to both hooks. Pull request #2132 is already open against this issue, so review it or coordinate with its author rather than starting a second patch. Done means the container starts on a read-only rootfs without the /etc and /usr/lib64 tmpfs workaround.
Written by the indexing model from the issue text.
Description
Problem
Both create-symlinks and update-ldcache write into the container root filesystem. When that filesystem is read-only, the write fails with EROFS, the hook exits 1, and container creation is aborted:
Error: container create failed: error executing hook `/usr/local/nvidia/toolkit/nvidia-cdi-hook` (exit code: 1)
This is the same class of problem as #2026, which was fixed in v1.20.1 for update-application-profile by ignoring read-only filesystem errors. The other two hooks still abort.
Generalized: a CDI hook whose only effect is to modify the container root filesystem should not prevent the container from starting when that filesystem is read-only.
Steps to reproduce
$ podman run --rm --device <cdi-device> --read-only nvidia/cuda:12.6.3-base-ubuntu22.04 nvidia-smi
Error: OCI runtime error: crun: error executing hook `/usr/local/nvidia/toolkit/nvidia-cdi-hook` (exit code: 1)
$ podman run --rm --device <cdi-device> --read-only --tmpfs /etc --tmpfs /usr/lib64 nvidia/cuda:12.6.3-base-ubuntu22.04 nvidia-smi
# succeeds
Making both /etc and /usr/lib64 writable is required; making either one writable on its own still fails. Those are the two paths the generated spec's hooks write to:
- path: /usr/local/nvidia/toolkit/nvidia-cdi-hook
args: [nvidia-cdi-hook, create-symlinks, --link, libEGL_nvidia.so.595.58.03::/usr/lib64/libEGL_nvidia.so.0, ...]
- path: /usr/local/nvidia/toolkit/nvidia-cdi-hook
args: [nvidia-cdi-hook, update-ldcache, --folder, /usr/lib64, --folder, /usr/lib64/vdpau]
Impact
Kubernetes workloads that set readOnlyRootFilesystem: true cannot use GPUs. This is a common hardening requirement, and it is enforced by policy on many clusters (for example OpenShift restricted-v2 style baselines and Gatekeeper/Kyverno psp-readonlyrootfilesystem constraints), so it is not something the workload owner can simply turn off.
Environment
- nvidia-container-toolkit v1.19.0, also reproduced on v1.17.8 with regenerated CDI specs
- CRI-O and podman/crun, OpenShift 4.x, NVIDIA GPU Operator v26.3.0
- Driver 595.58.03, H100 NVL
Skipping the ldcache update does not make the libraries unreachable: they are bind-mounted into directories glibc already searches by default.
I have a patch following the same approach as the #2026 fix and will open a PR.
- Dominant language
- Go
- Stars
- 4.6k
- Forks
- 609
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 36
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/nvidia-container-toolkit
-
[Bug]: Containers with NVIDIA_VISIBLE_DEVICES=all fail to start in jit-cdi mode when every GPU is bound to vfio-pciPossibly taken @efegokdemir claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
NVIDIA/nvidia-container-toolkit#2163 ·
Maintainers usually reply within 1 day
-
Address TODO comments in internal/platform-support/dgpu/dgpu.goPossibly taken @truongbo17 claimed this 32 days ago. Opendsx-ws-0930 good-first-issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA/nvidia-container-toolkit#2114 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: nvidia-ctk runtime configure --runtime=docker without --set-as-default leaves default-runtime set to nvidiaPossibly taken @blacksoxx claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
NVIDIA/nvidia-container-toolkit#2155 ·
Maintainers usually reply within 1 day
-
[Bug]: Containerized installer removes the existing Toolkit installation before the replacement is complete and durablePossibly taken @henry118 claimed this 12 days ago. Openbug needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
NVIDIA/nvidia-container-toolkit#2153 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
NVIDIA/nvidia-container-toolkit#2147 · 1 comment ·
Maintainers usually reply within 1 day
All issues in NVIDIA/nvidia-container-toolkit
Similar issues
-
Fix mode unpins a reusable workflow call when the same repository is also used as a step actionOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/gh-actions-lock#261 ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
labmonkeys-space/nl6#974 ·
Maintainers usually reply within 1 day
-
model:sonnet phase-2-optimize runtime:claude security size:S
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
FootprintAI/Containarium#3471 ·
Maintainers usually reply within 1 day
-
[BUG] serviceenvupdater filter does not update KUBERNETES_SERVICE_HOST/PORT in init containersPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openyurtio/openyurt#2845 ·
Maintainers usually reply within 7 days
-
fuzz.yml skips three fuzz targets, and the Action's user input describes only ~/.claudePossibly taken @predictor2718 claimed this today. Opengithub_actions P3 tests
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day