feat [metadata-collector]: map DRA gpu pods for partial drain #1930
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1930"
general
weight: 0.35
tanishagoyal2
Summary
metadata-collector annotates every GPU pod with the UUIDs of the GPUs it holds (dgxc.nvidia.com/devices), and node-drainer uses that annotation to evict only the pods on a faulty GPU during a partial drain. The mapper reads the kubelet PodResources response but only walks container.devices, which device plugins populate with UUIDs.
In GPU Operator 26.7 GPUCluster mode there is no device plugin. GPUs are allocated through DRA ResourceClaims and the kubelet reports them in container.dynamic_resources as driver gpu.nvidia.com, a pool name and a device name (gpu-0 to gpu-7), not as UUIDs. The mapper never read that field, so no GPU pod on a GPUCluster node received the annotation and every partial drain degraded to a full node drain.
Fixes NVIDIA/NVSentinel#1865.
Decision
Extend the mapper to also read dynamic_resources from the PodResources response and resolve DRA device names to GPU UUIDs locally through NVML, with no API server reads from the DaemonSet.
The NVIDIA DRA driver names each GPU gpu-<minor>, where minor is the /dev/nvidiaN number, a choice it documents as deliberate because the minor is fixed for as long as the GPU stays on the bus. The collector already runs NVML on every node, so for each claim resource from driver gpu.nvidia.com it reads every GPU's minor number and UUID, formats the minor with the driver's own gpu-%d pattern, and compares that to the allocated name. Anything the driver would not have produced fails closed. NVML is opened for one short read per poll, only when a DRA allocation is present, and closed again, so the collector never holds the driver open between polls and does not block driver reloads or GPU resets. A GPU that fails its own NVML calls is skipped so the healthy GPUs still resolve.
Resolved UUIDs are written to the existing annotation under the key gpu.nvidia.com, which is added to the shared resource-name list so node-drainer's partial-drain matching needs no code change. An allocation whose name does not resolve is skipped and picked up on the next poll. No RBAC or chart change is required.
Testing
Verified live on azr dev cluster running Kubernetes 1.36.3, 4 nodes with 8x H100.
1. GPU Operator 26.3.3, ClusterPolicy mode (device plugin)
Regression check for the refactored device-plugin path. Pod plugin-gpu-test requested nvidia.com/gpu: 2.
Same key, same sorted-UUID shape and one patch, identical to the behaviour of the shipping v1.20.0 collector measured on the same cluster beforehand.
2. GPU Operator 26.7.0, ClusterPolicy mode (device plugin, driver 595)
Same test on the 26.7 operand stack. Pod plugin-gpu-test requested nvidia.com/gpu: 2.
gpu_metadata.json now carries the new minor_number field alongside the UUID for every GPU, for example:
Each collector pod logs Initializing NVML exactly once, confirming the mapper no longer opens a second NVML session. No warnings on any of the six nodes.
3. GPU Operator 26.7.0, GPUCluster mode (DRA)
The case this PR exists for. Pod dra-gpu-test requested two GPUs through a ResourceClaimTemplate with deviceClassName: gpu.nvidia.com. The scheduler allocated:
The collector resolved the device names through the minor numbers recorded in gpu_metadata.json:
and annotated the pod under the gpu.nvidia.com key:
The two UUIDs match gpu-0 and gpu-1 in the metadata and the pod's own nvidia-smi -L. No API server reads beyond the existing pod patch.
4. Partial drain in GPUCluster mode
End-to-end check that node-drainer acts on the new annotation. node-drainer was built from this branch, partialDrainEnabled: true, drain mode Immediate. Two DRA pods on node vmss000014:
Pod | Devices | Annotation
-- | -- | --
dra-gpu-test | gpu-0, gpu-1 | "GPU-41c8b08b-ffe9-af57-2f20-e893ead0a707","GPU-fb78fbe7-9040-490f-8053-4856c6f9e444"
dra-gpu-test-b | gpu-2 | "GPU-41c8b08b-ffe9-af57-2f20-e893ead0a707"
An XID 119 was injected into the kernel log for PCI 0002:00:00, the GPU held only by dra-gpu-test. The syslog health monitor resolved it to the UUID via gpu_metadata.json:
SysLogsXIDError True SysLogsXIDErrorIsNotHealthy ErrorCode:119 PCI:0002:00:00 GPU_UUID:GPU-fb78fbe7-9040-490f-8053-4856c6f9e444 ... Recommended Action=COMPONENT_RESETnode-drainer matched that UUID against the gpu.nvidia.com key and selected only the affected pod:
Result: dra-gpu-test was evicted within 71 seconds. dra-gpu-test-b on gpu-2 was never considered and stayed Running on the node:
The DCGM-DRA and metadata-collector pods on the node, which hold admin-access claims covering all eight GPUs, were untouched because their namespaces are excluded from draining.
<!-- Brief description of your changes -->
Type of Change
Component(s) Affected
Testing
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Summary
New Features
GPU metadata collection now supports NVIDIA GPUs allocated through Kubernetes Dynamic Resource Allocation (DRA), mapping DRA device names to GPU UUIDs.
GPU annotations now include DRA allocations under the
gpu.nvidia.comresource key. Unresolved device names are not included.Documentation
* Clarified how device-plugin and DRA GPU allocations are recorded, including the Kubernetes feature gate required for DRA allocation reporting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->