[Bug]: nvidia-container-cli fails intermittently with "nvcgo rpc error: timed out" (hard-coded 10s RPC timeout in libnvidia-container)
Maintainers usually reply within 1 day
@henry118 is already working on this.
Since Sep 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
nvidia-container-cli intermittently fails during container startup with:
nvidia-container-cli: initialization error: nvcgo rpc error: timed out
The failure happens when the node is under CPU/IO pressure (e.g. a burst of GPU containers starting at the same time). The error is produced by the hard-coded 10 second RPC client timeout in libnvidia-container:
src/rpc.c(setup_client):
struct timeval timeout = {10, 0};
...
clnt_control(rpc->clt, CLSET_TIMEOUT, (char *)&timeout);
During nvc_init(), nvcgo_init() (src/nvcgo.c) forks a child process that serves an ONC RPC over a unix socketpair. The server-side handler nvcgo_init_1_svc dlopen()s the Go c-shared library libnvcgo.so (with RTLD_NOW), which boots a full Go runtime. On a loaded or slow node (cold page cache, CPU throttling, IO contention, container start storms), fork + dlopen + Go runtime init can exceed 10 s, so clnt_call() returns RPC_TIMEDOUT and the whole container start fails.
The timeout is hard-coded: it is not configurable via the config file, an environment variable, or a CLI flag, and there is no retry.
Note this is a different failure flavor from the well-known driver rpc error: timed out (#237, #202), which is caused by slow NVML initialization when persistence mode is off. The nvcgo RPC program only loads the Go cgroup helper library and does not touch NVML, so enabling persistence mode does not help here.
To Reproduce
- Use a node under heavy CPU/IO load (or artificially slow down process spawn / file reads, e.g. cold page cache +
stress-ng). - Start a GPU container (legacy mode), e.g.
docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi, or launch a burst of GPU pods on Kubernetes with the legacy runtime mode. - Intermittently, container creation fails with
nvidia-container-cli: initialization error: nvcgo rpc error: timed out.
Expected behavior
The nvcgo RPC initialization should be resilient to slow nodes:
- the RPC timeout should be configurable (e.g. via
nvidia-container-cliconfig / env var), and/or - the default should be more tolerant, and/or
- the call should be retried before failing the container start.
Environment (please provide the following information):
nvidia-container-toolkitversion: v1.17.8 (also verified in the latest release v1.20.0, see below)- NVIDIA Driver Version: 550.x
- Host OS: Ubuntu 22.04
- Kernel Version: 5.15-generic
- Container Runtime Version: containerd 1.7.x
- CPU Architecture: x86_64
- Kubernetes Distro and Version: K8s
Additional context
I verified that the issue is still present in the latest release:
nvidia-container-toolkitv1.20.0 pinsthird_party/libnvidia-containerat3e428194(libnvidia-container v1.20.0).- In libnvidia-container v1.20.0 (and current
main),src/rpc.cstill contains the same hard-codedstruct timeval timeout = {10, 0}; there were no timeout-related changes tosrc/rpc.cbetween v1.17.8 and v1.20.0. nvcgo_init()is called unconditionally fromnvc_init()in builds withWITH_NVCGO=yes(the default for official packages), so everynvidia-container-cli configureinvocation pays this fork+dlopen cost and is exposed to the 10 s budget.
Workarounds we are considering on our side: switch the runtime to CDI mode (which does not invoke nvidia-container-cli), reduce node-level start bursts. A configurable timeout would still be appreciated.
@elezar @klueska
- 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 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
-
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 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Schema validation is skipped when a transaction is invoked with a lowercase first letterPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
cmd/ebitenmobile: multi-language bindings run the complete generator twicePossibly taken @kumagi claimed this today. Openos:macos performance
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hajimehoshi/ebiten#4011 · 1 comment ·
Maintainers usually reply within 1 day
-
agent-butler-finding chore
Difficulty 1/5 Under an hour Newbie friendliness 78/100
jordansmall/spindrift#6318 ·
Maintainers usually reply within 1 day