[Bug]: Containers with NVIDIA_VISIBLE_DEVICES=all fail to start in jit-cdi mode when every GPU is bound to vfio-pci
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
The bug is in pkg/nvcdi/lib-nvml.go where nvmllib.DeviceSpecGenerators calls nvmlInit before handling 'all'. Read that function and reorder so the 'all' case with no GPUs resolves to no devices like 'none'. Done means a container with NVIDIA_VISIBLE_DEVICES=all starts successfully when every GPU is bound to vfio-pci.
Written by the indexing model from the issue text.
Description
Describe the bug
When every GPU on a node is bound to vfio-pci (driver loaded, no GPU bound to it), the nvidia runtime in jit-cdi mode fails to create containers with NVIDIA_VISIBLE_DEVICES=all:
failed to create the automatic CDI modifier: failed to generate CDI spec for mode "auto": failed to construct device spec generators: failed to initialize NVML: No supported GPUs were found
This happens with the NVIDIA DRA driver's PassthroughSupport: while every GPU is in a KubeVirt VM, GPU Operator operands (gpu-feature-discovery, dcgm-exporter) cannot be recreated on that node.
nvmllib.DeviceSpecGenerators (pkg/nvcdi/lib-nvml.go) calls nvmlInit before handling all, and the init fails when no GPU is bound.
Expected behavior
all with no GPUs available resolves to no devices, as none does, and the container starts. I can send a PR.
Environment
- nvidia-container-toolkit v1.19.1 (same code on
main), driver 595.91.07 - Talos v1.14.2, kernel 6.18.54, containerd 2.3.6, Kubernetes v1.37.1
- RTX PRO 6000 Blackwell × 2, GPU Operator v26.7.1, DRA driver v0.5.1, KubeVirt v1.9.0
- 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
-
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
-
Difficulty 4/5 3-5 days Newbie friendliness 47/100
NVIDIA/nvidia-container-toolkit#2137 ·
Maintainers usually reply within 1 day
All issues in NVIDIA/nvidia-container-toolkit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
hyperledger/fabric-x-orderer#1409 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-area
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/typespec-azure#5936 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
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