🧠
Domain 1 · Essential AI Knowledge · 38% of the exam

The NVIDIA GPU Operator on Kubernetes

How one operator installs and manages drivers, the container runtime, the device plugin and monitoring on every GPU node, automatically.

Lesson 9 of 29~12 min read4 quiz questions5 key terms
Exam objectives this lesson covers
  • Describe the NVIDIA software stack used in an AI environment.
  • Describe AI cluster orchestration and job scheduling essentials.
  • Explain the purpose and use case of various NVIDIA solutions.

Before a Kubernetes pod can use a GPU, the node needs four things: an NVIDIA driver, a container runtime that can pass the GPU into containers, a device plugin that tells Kubernetes the GPUs exist, and ideally monitoring. Doing that by hand on hundreds of nodes, and keeping versions in step through upgrades, is slow and error-prone. The GPU Operator automates all of it.

GPU Operatorcontroller + CRD (reconcile loop)Node Feature Discoverylabels nodes with PCI 10DEContainer ToolkitDaemonSet on GPU nodesGPU driverDaemonSet on GPU nodesDriver validationDaemonSet on GPU nodesDevice pluginDaemonSet on GPU nodesDCGM exporterDaemonSet on GPU nodesMIG managerDaemonSet on GPU nodeskubeletsees nvidia.com/gpu: 8
Fig 1. The operator watches the cluster, finds GPU nodes through Node Feature Discovery, and rolls out each component as a DaemonSet. The kubelet then advertises the GPUs as schedulable resources.

01What an "operator" is

In Kubernetes, an operator is a pattern for running complex software: a custom resource definition (CRD) describes the desired state ("these nodes should have driver version X, toolkit Y, monitoring on"), and a controller runs a reconcile loop that keeps the real state matching it. If a node is added, the operator sets it up. If you change a version, it rolls out the change. NVIDIA's operator runs its logic as a state machine, validating each stage before moving on.

02The components it manages

ComponentWhat it does
Node Feature Discovery (NFD)Labels nodes with their hardware; the operator targets nodes with an NVIDIA PCI device (vendor ID 0x10DE)
NVIDIA Container ToolkitConfigures the container runtime (containerd, CRI-O, Docker) so containers can access GPUs
Containerised GPU driverInstalls the driver as a container instead of baking it into the OS image; can also use a pre-installed driver
ValidationRuns a small CUDA test (vectorAdd in the original release) to prove the stack works
Kubernetes device pluginRegisters GPUs with the kubelet so they appear as the extended resource nvidia.com/gpu
DCGM exporterExposes GPU metrics (utilisation, memory, temperature, power, errors) to Prometheus
GPU Feature DiscoveryAdds labels such as GPU model and memory so jobs can target specific GPUs
MIG managerApplies Multi-Instance GPU partition layouts on supported GPUs

03How a pod asks for a GPU

Once the device plugin runs, GPUs are just another resource. A pod requests them in its limits, and the scheduler only places it on a node with enough free GPUs:

apiVersion: v1
kind: Pod
metadata:
  name: cuda-test
spec:
  containers:
  - name: cuda
    image: nvcr.io/nvidia/cuda:12.4.1-base-ubuntu22.04
    command: ["nvidia-smi"]
    resources:
      limits:
        nvidia.com/gpu: 1   # whole GPUs; extended resources are integers

Two Kubernetes rules worth remembering: extended resources like nvidia.com/gpu are integers and are not overcommitted, so by default a GPU belongs to one container. Sharing a GPU needs MIG, time-slicing or a scheduler such as Run:ai (see MIG).

04Installing it

The operator is installed with a Helm chart from NGC, and component versions are set in the chart's values file. It does not build the Kubernetes cluster for you; it prepares GPU nodes in an existing cluster. A sibling, the Network Operator, does the same job for networking components such as RDMA and InfiniBand drivers.

helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm install --wait gpu-operator -n gpu-operator --create-namespace nvidia/gpu-operator

05Why operators love it

A building manager for GPUs. When a new floor (node) opens, the manager installs the wiring (driver), the sockets (container toolkit), puts the room on the booking system (device plugin) and fits smoke detectors (DCGM). Tenants just book a room.

✦Key terms: flip the cards

What the exam looks for
  • Know what the GPU Operator installs: driver, container toolkit, device plugin, DCGM exporter, feature discovery, MIG manager.
  • Pods request GPUs with nvidia.com/gpu in resource limits.
  • It uses the Kubernetes operator pattern and is installed via Helm from NGC.
Common traps
  • The GPU Operator does not create the Kubernetes cluster.
  • By default a GPU cannot be shared between containers via the device plugin; sharing needs MIG, time-slicing or another scheduler.

?Quick quiz

1. Which component makes GPUs visible to the Kubernetes scheduler?

Why: The device plugin registers nvidia.com/gpu with the kubelet.

2. What does the GPU Operator primarily automate?

Why: It installs and manages driver, runtime, device plugin and monitoring.

3. How does a pod request one full GPU?

Why: GPUs are requested as an extended resource in limits.

4. Which component provides GPU metrics to Prometheus?

Why: DCGM exporter exposes GPU telemetry for Prometheus.

Score: 0 / 4

Original readingNVIDIA GPU Operator: Simplifying GPU Management in Kubernetes, NVIDIA Technical Blog ↗

The original post is from 2019 and describes the first release. The component list below adds the parts that were introduced since (DCGM exporter, MIG manager and others), so it may be longer than in the post.

All lessons →
↑