The driver and container toolkit come first node-1 has two accelerators, gpu-0 and gpu-1. The OS needs a driver to use them, and the container runtime needs a toolkit that can inject the devices into containers.
For NVIDIA GPUs, the GPU Operator often installs the driver, container toolkit, device plugin and monitoring as DaemonSets in one go. NPU vendors ship their own driver and device plugin.
Key idea With only the driver, the OS sees the devices but Kubernetes does not. kubectl describe node shows no GPU entry yet.
The device plugin registers with the kubelet A device plugin usually runs as a DaemonSet Pod, one per node. It first opens its own Unix socket under /var/lib/kubelet/device-plugins/ and serves gRPC on it.
It then calls Register on kubelet.sock in the same directory, sending its API version, socket name and resource name. NVIDIA uses nvidia.com/gpu; NPU vendors use a resource name under their own domain.
Key idea When the kubelet restarts it removes the sockets, so the plugin must register again. A crash-looping plugin Pod can make the node look like it has zero GPUs.
ListAndWatch streams devices and their health After registration, the kubelet connects to the plugin socket and calls ListAndWatch. The plugin streams a list of device IDs, each marked Healthy or Unhealthy.
The stream stays open. Whenever a device is added or fails, the plugin sends the updated list.
The kubelet adds the GPU count to node status The kubelet counts the devices and writes nvidia.com/gpu: 2 into the node status capacity and allocatable.
kubectl describe node node-1 now shows nvidia.com/gpu under Capacity and Allocatable. Kubernetes treats it as an extended resource.
The Pod asks for a GPU count in resources.limits The user creates a Pod with nvidia.com/gpu: 1 in the container resources.limits.
Extended resources are integers only and cannot be overcommitted. If requests is omitted it defaults to limits; if both are set they must be equal. A request like 0.5 GPU is rejected.
Key idea To share a GPU you need node-side sharing (MIG, time-slicing and so on). Changing the requested number to a fraction does not work.
The scheduler filters nodes by allocatable For each node, the scheduler subtracts the requests of Pods already placed there from allocatable, and keeps only nodes with at least one nvidia.com/gpu left.
Nodes without GPUs, or with all GPUs in use, are filtered out. If none remain, the Pod stays Pending with an Insufficient nvidia.com/gpu event.
Key idea The scheduler only counts. It does not decide which device the Pod gets.
The kubelet picks a device and calls Allocate The kubelet on node-1 picks gpu-1 from the free devices (the plugin can suggest a preferred set through the optional GetPreferredAllocation call) and, before creating the container, calls the plugin Allocate with that device ID.
The plugin returns environment variables, device nodes and mounts for the container. Newer setups can return CDI device names instead, and the runtime injects the device from the CDI spec.
The container starts seeing only its device The runtime creates the container from the Allocate response. Inside the container, only gpu-1 is visible.
On NVIDIA nodes, running nvidia-smi inside the container confirms that it sees one GPU.
A failed device lowers allocatable The driver reports an error on the idle gpu-0. The plugin sends an updated list over the ListAndWatch stream with gpu-0 marked Unhealthy.
The kubelet keeps capacity at 2 but lowers allocatable to 1. That one GPU is used by train, so new GPU Pods go to other nodes or stay Pending.
Watch out The kubelet does not move a Pod that was already using a device when it failed. Since v1.36 (beta), the container status shows device health in allocatedResourcesStatus. Watch the gap between capacity and allocatable, together with device metrics.
Device plugins advertise devices as a count The driver and toolkit make the devices usable, the plugin registers with the kubelet and streams devices and health, and the kubelet publishes the count as a node resource. When a Pod asks for a count, the scheduler picks a node and the kubelet and plugin attach a device.
This model only says how many. To choose by attributes such as memory size or model, use DRA.
Summary If a GPU Pod is Pending, check the GPU count under Allocatable with kubectl describe node, and check that the plugin Pod is running.