Gate dcgm pods on the driver module and probe hostengine GPU visibility - #2855
Gate dcgm pods on the driver module and probe hostengine GPU visibility#2855gengwg wants to merge 1 commit into
Conversation
… GPU visibility The toolkit-validation init container in state-dcgm and state-dcgm-exporter only waits for /run/nvidia/validations/toolkit-ready, which survives an in-place driver container restart. A hostengine that starts while the nvidia module is unloaded gets plain runc from the toolkit's host wrapper, has no NVML, and never recovers; the tcpSocket liveness probe passes because it still listens on 5555. Both pods then sit 1/1 Running and export no GPU metrics for the node. Make the init gate also require the nvidia module in /proc/modules, and make the hostengine liveness probe check that dcgmi discovery sees at least one GPU so kubelet restarts a deaf hostengine once the driver is back. Fixes NVIDIA#2854 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Weigang Geng <3356786+gengwg@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe DCGM and DCGM exporter init containers now wait for the toolkit validation marker and the loaded Merge Risk: ⚪ Minimal · up to DCGM and its exporter now wait for the NVIDIA driver module before startup, and DCGM restarts when it cannot discover a GPU. No concrete current-head merge-blocking risk remains. Comment |
Description
Fixes #2854.
The
nvidia-dcgmhostengine can start while the nvidia kernel module is not loaded (node boot racing an operator rollout, an in-placenvidia-driver-ctrrestart, or an operator rollout that recreates the dcgm pods while the driver container restarts). The toolkit's host runtime wrapper then execs plain runc with no injection,nv-hostenginestarts with no NVML, and nothing ever restarts it. Bothnvidia-dcgmandnvidia-dcgm-exporterstay1/1 Runningwhile exporting zeroDCGM_FI_*series for the node. Details and logs in the issue.Two small changes to the assets:
Init gate also waits for the driver module.
toolkit-validationinstate-dcgmandstate-dcgm-exporteronly checked for/run/nvidia/validations/toolkit-ready, which survives an in-place driver container restart, so the gate passed while the modules were unloaded. It now also requiresgrep -q '^nvidia ' /proc/modules./proc/modulesis not namespaced, the init container is already privileged, and the validator uses the samelsmod | greppattern fornvidia_fsandgdrdrv.Hostengine liveness checks GPU visibility, not just the port. The
tcpSocketprobe on 5555 passes on a deaf hostengine because it still listens. The probe is nowdcgmi discovery -l | grep -qE '^[1-9][0-9]* GPUs? found'every 60s, three failures before restart, so a hostengine that came up without NVML gets restarted by kubelet once the driver is back. The readiness probe is unchanged.Behaviour worth stating: with the new liveness probe, a node that genuinely loses every GPU will see its hostengine restart every ~3 minutes instead of sitting silently at 0 GPUs. That is intended; it is visible where the previous state was not. Nodes with at least one GPU visible are unaffected. When the hostengine restarts,
dcgm-exporterhitsDCGM_ST_CONNECTION_NOT_VALID, which it already treats as fatal and exits, so it reconnects on its own restart.Checklist
make lint) - not run locally; YAML-only change underassets/make validate-generated-assets) - no generated files touchedmake validate-modules) - go.mod untouchedgo test ./controllers/...passes with the modified assetsTesting
nvcr.io/nvidia/cloud-native/dcgm:4.4.2-1-ubuntu22.04image: with GPUs presentdcgmi discovery -lprints8 GPUs found.and the probe passes; started on a host with no GPU the probe fails as intended.sh,grepanddcgmiare all in the image.toolkit-validation(nvcr.io/nvidia/gpu-operator:v25.10.0):shandgreppresent,/proc/modulesreadable.go test ./controllers/...passes with the modified assets.