Skip to main content
AI on Kubernetes · GPU/NPULesson 1 of 20

How GPUs and NPUs become node resources (device plugins)

Out of the box, Kubernetes only knows about CPU and memory. Plugging a GPU or NPU into a server does not let Pods request it. A device plugin is what advertises the device to Kubernetes as a resource. Follow a device from the node until it is attached to a Pod.

Allocatable GPUs0
Healthy devices—
Pod status—
Control planeGPU node · node-1UserPod specAPI serverentry pointSchedulerpicks a nodeNode statuscapacity·allocatablekubeletnode-1Device pluginDaemonSet PodDriver·toolkitinstalled firsttrainPodgpu-0accelgpu-1accel
RequestResponse / reportAppears in a later step

What you will learn

  • What the driver and the device plugin each do
  • How a plugin registers and reports its devices
  • How the device count lands in node allocatable
  • Extended resource rules and the Allocate call
  • What happens when a device fails

Device plugins vs DRA​

Device pluginDRA
How you requestCount only (nvidia.com/gpu: 1)Device class + attribute criteria
What the node reportsDevice count and health per resource namePer-device attributes (ResourceSlice)
Who picks the deviceThe kubelet on the nodeThe scheduler
SharingNode-side settings (MIG, time-slicing, etc.)Expressed in the claim, if the driver supports it

The basic DRA flow is covered in Requesting GPUs by Criteria (DRA). The next lesson, Getting Accelerators by Criteria (DRA in Depth), follows an AI workload that gets a GPU and a network card together by criteria.

Try it yourself​

kubectl get pods -A -o wide | grep -i device-plugin # Plugin DaemonSet Pod per node (step 2)
kubectl describe node <gpu-node> | grep -A8 -E '^(Capacity|Allocatable)' # nvidia.com/gpu count (step 4)
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.capacity.nvidia\.com/gpu}{"\t"}{.status.allocatable.nvidia\.com/gpu}{"\n"}{end}' # Capacity vs allocatable (step 9)
kubectl get events -A --field-selector reason=FailedScheduling # Insufficient nvidia.com/gpu (step 6)
kubectl exec <pod> -- nvidia-smi -L # e.g. NVIDIA: the container sees one GPU (step 8)

Check yourself

  1. The NVIDIA driver is installed on a node, but kubectl describe node shows no nvidia.com/gpu. What is most likely missing?
  2. A user asks for nvidia.com/gpu: 0.5 to share a GPU. What happens?
  3. One idle GPU on a 2-GPU node fails. What changes in the node status?

Further reading: Device Plugins · Schedule GPUs · NVIDIA GPU Operator overview