[Bug]: nvidia-ctk runtime configure --runtime=docker without --set-as-default leaves default-runtime set to nvidia
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 30/100
Research direction
Start with pkg/config/engine/docker/docker.go and the existing Docker unit test for Config{"default-runtime": "nvidia"}.AddRuntime("nvidia", path, false). Compare the behavior with the containerd and cri-o changes from #1256. Done means the Docker configuration clears default-runtime in this case and the unit test verifies it; pull request #2156 is already open for this fix.
Written by the indexing model from the issue text.
Description
Describe the bug
#1256 (cab76e2d) changed AddRuntime for containerd and cri-o to clear the default runtime when the runtime being added is the current default and setAsDefault is false. The docker implementation in pkg/config/engine/docker/docker.go was not changed: it only sets default-runtime when setAsDefault is true and leaves an existing value alone otherwise.
So after the NVIDIA runtime was made the docker default once (--set-as-default, or the toolkit container with set-as-default enabled), configuring it again with set-as-default off keeps "default-runtime": "nvidia" in daemon.json, and every docker container keeps running through the NVIDIA runtime. With the same steps, containerd and cri-o go back to their own default.
To Reproduce
Found by reading the code and confirmed with a unit test on main (44f1c6ef): Config{"default-runtime": "nvidia"}.AddRuntime("nvidia", path, false) leaves default-runtime as nvidia.
Expected on a host (not run):
nvidia-ctk runtime configure --runtime=docker --set-as-defaultnvidia-ctk runtime configure --runtime=docker/etc/docker/daemon.jsonstill has"default-runtime": "nvidia".
Expected behavior
Docker behaves like containerd and cri-o: when the runtime being configured is the current default and set-as-default is off, default-runtime is removed and docker falls back to its own default (runc).
One thing for the maintainers to decide: this changes behaviour for anyone who set default-runtime: nvidia by hand and later runs nvidia-ctk runtime configure --runtime=docker without --set-as-default. That is the same trade-off #1256 made for containerd and cri-o, but it may matter more for docker users. A fix that mirrors #1256 is in #2156.
Environment (please provide the following information):
- NVIDIA Container Toolkit version: main at 44f1c6ef; the same code is in v1.20.1
- NVIDIA Driver Version, host OS, kernel, container runtime: not run on a host; reproduced with the
pkg/config/engine/dockerunit tests (Go 1.27.2, macOS arm64)
- Dominant language
- Go
- Stars
- 4.6k
- Forks
- 609
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 37
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 7 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 33 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
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NVIDIA/nvidia-container-toolkit#2197 ·
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 13 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
-
Routing rule or circuit breaker trip expression with an unknown CEL function hangs daprdPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[falco-talon] Setting `podAnnotations` makes the chart fail to renderPossibly taken @RaphaelFakhri claimed this today. Openneeds-kind
Difficulty 1/5 Under an hour Newbie friendliness 88/100
falcosecurity/charts#1084 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
DataDog/terraform-provider-datadog#4479 ·
Maintainers usually reply within 2 days
-
component/tests needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
NVIDIA/nodewright#967 ·
Maintainers usually reply within 1 day