Alerts and Monitoring

Kubernetes GPU Monitoring: Metrics, Challenges and Best Practices

October 31, 2026 Kubezilla Team 10 min read
Kubernetes GPU Monitoring: metrics, challenges and best practices

GPUs are the most expensive thing in most AI clusters. A single H100 node can cost more per hour than a whole rack of CPU nodes. Yet many teams run GPU workloads on Kubernetes with almost no idea what those GPUs are doing. They see that a pod asked for nvidia.com/gpu: 1, the pod is running, and that is where the story ends.

That is not enough. A GPU can be allocated and still sit idle. It can look 100% busy while doing very little real work. It can slow down because it is too hot, or fail quietly with a hardware error that only shows up as a hung training job. In this post we look at which GPU metrics matter, why monitoring GPUs on Kubernetes is harder than monitoring CPUs, and the practices that work in real clusters.

If you are new to running GPUs on Kubernetes, start with our Kubernetes GPU Guide 2026 first. It covers the GPU Operator, scheduling and sharing. This post picks up from there and goes deep on monitoring.

Why GPU monitoring is different

Kubernetes already knows a lot about CPU and memory. The kubelet and cAdvisor report usage for every container, and tools like the metrics server and Prometheus pick it up without much setup. GPUs are different in a few ways:

  • Kubernetes does not see inside the GPU. The device plugin tells the scheduler that a node has, say, 8 GPUs. It does not report how busy they are or how much memory is used.
  • GPUs are allocated as whole units. A pod that asks for one GPU gets the full device, even if it only uses 10% of it. Waste is easy and expensive.
  • One number is not enough. CPU usage is a decent signal on its own. GPU usage is made of many parts: compute engines, tensor cores, memory bandwidth, NVLink, PCIe. A job can be slow because of any of them.
  • Hardware fails in its own way. GPUs report faults through XID errors, ECC errors and throttling events. None of these show up in normal Kubernetes events.

So you need a tool that talks to the GPU driver directly and turns what it finds into metrics that Prometheus can scrape, with Kubernetes labels attached.

The standard stack: DCGM Exporter, Prometheus and Grafana

For NVIDIA GPUs the common answer is DCGM Exporter. DCGM (Data Center GPU Manager) is NVIDIA’s library for reading health and performance data from GPUs. DCGM Exporter runs as a DaemonSet on each GPU node, reads those numbers and exposes them on a /metrics endpoint in Prometheus format.

The best part is that it maps metrics to pods. It uses the kubelet pod resources API to find which pod owns which GPU, and adds namespace, pod and container labels to each metric. That means you can ask “how busy is the GPU used by my training job?” and not just “how busy is GPU 3 on node 7?”.

A typical setup looks like this:

  • NVIDIA GPU Operator installs the driver, device plugin and DCGM Exporter.
  • Prometheus (often through kube-prometheus-stack) scrapes the exporter using a ServiceMonitor.
  • Grafana shows dashboards. NVIDIA publishes a ready-made DCGM dashboard (Grafana ID 12239) that is a good starting point.
  • Alertmanager sends alerts for idle GPUs, memory pressure, heat and hardware errors.

Installing it

If you already use the GPU Operator, DCGM Exporter is turned on by default. You only need to tell it to create a ServiceMonitor so Prometheus finds it:

helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update

helm upgrade --install gpu-operator nvidia/gpu-operator \
  -n gpu-operator --create-namespace \
  --set dcgmExporter.serviceMonitor.enabled=true

If you manage the driver yourself and only want the exporter, you can install it on its own:

helm repo add gpu-helm-charts https://nvidia.github.io/dcgm-exporter/helm-charts
helm repo update

helm install dcgm-exporter gpu-helm-charts/dcgm-exporter \
  -n gpu-monitoring --create-namespace \
  --set serviceMonitor.enabled=true

Check that it works by port-forwarding to one exporter pod and reading the metrics:

kubectl -n gpu-operator port-forward ds/nvidia-dcgm-exporter 9400:9400
curl -s localhost:9400/metrics | grep DCGM_FI_DEV_GPU_UTIL

For a full hands-on walkthrough with screenshots, see this GPU monitoring guide on Collabnix.

The GPU metrics that matter

DCGM can export hundreds of fields. You do not need all of them. These are the ones worth watching, grouped by the question they answer.

1. Is the GPU doing work?

MetricWhat it tells you
DCGM_FI_DEV_GPU_UTILPercent of time at least one kernel was running. Easy to read, but coarse. More on this below.
DCGM_FI_PROF_GR_ENGINE_ACTIVEFraction of time the graphics/compute engine was active. A better version of GPU utilization.
DCGM_FI_PROF_SM_ACTIVEFraction of time the streaming multiprocessors (SMs) had work. Shows how much of the chip is in use.
DCGM_FI_PROF_SM_OCCUPANCYHow full each SM is with warps. Low values mean small kernels or poor batching.
DCGM_FI_PROF_PIPE_TENSOR_ACTIVEHow busy the tensor cores are. This is the key number for AI training and inference.

2. Is memory the limit?

MetricWhat it tells you
DCGM_FI_DEV_FB_USED / DCGM_FI_DEV_FB_FREEGPU memory used and free, in MiB. Watch this for out-of-memory risk and for right-sizing.
DCGM_FI_PROF_DRAM_ACTIVEHow busy the memory interface is. High values with low tensor activity often mean the job is memory bound.

3. Is data reaching the GPU fast enough?

MetricWhat it tells you
DCGM_FI_PROF_PCIE_TX_BYTES / RX_BYTESTraffic between CPU and GPU. Spikes with low compute usually mean a slow data loader.
DCGM_FI_PROF_NVLINK_TX_BYTES / RX_BYTESTraffic between GPUs. Important for multi-GPU training where GPUs swap gradients.

4. Is the GPU healthy?

MetricWhat it tells you
DCGM_FI_DEV_GPU_TEMPGPU temperature in Celsius. Hot GPUs slow themselves down.
DCGM_FI_DEV_POWER_USAGEPower draw in watts. Useful for cost and for spotting GPUs stuck at a power cap.
DCGM_FI_DEV_SM_CLOCKCurrent SM clock speed. A drop under load points to throttling.
DCGM_FI_DEV_XID_ERRORSThe last XID error code from the driver. Any non-zero value deserves a look.
ECC error countersSingle-bit errors are corrected. Double-bit errors are not, and the GPU may need to be drained.

Common challenges (and how to deal with them)

GPU utilization does not mean what you think

This is the biggest trap. DCGM_FI_DEV_GPU_UTIL (and the number you see in nvidia-smi) only says that some kernel was running during the sample window. A tiny kernel using one SM out of 132 still counts as “busy”. So a GPU can show 100% utilization while most of the chip is idle.

Use utilization as a quick “is anything running” check. For real efficiency, look at SM_ACTIVE, SM_OCCUPANCY and PIPE_TENSOR_ACTIVE. If utilization is high but tensor activity is low, there is room to tune batch size, precision or the data pipeline.

Allocated is not the same as used

Kubernetes counts a GPU as used the moment a pod claims it. A notebook pod that someone forgot about can hold an H100 for a week while doing nothing. To catch this, join what pods request with what the GPUs actually do. kube-state-metrics gives you the request side through kube_pod_container_resource_requests{resource="nvidia_com_gpu"}, and DCGM gives you the usage side.

Shared GPUs blur the picture

GPU sharing makes monitoring harder, and how much harder depends on the method:

  • MIG (Multi-Instance GPU) splits a GPU into hardware partitions. DCGM Exporter reports metrics per MIG instance with GPU_I_ID and GPU_I_PROFILE labels, so you can still see each tenant clearly.
  • Time-slicing lets many pods take turns on the same GPU. DCGM sees one device, so it cannot split usage between those pods. You will see the total, not each pod’s share. Keep this in mind before using time-slicing for chargeback.
  • MPS runs many processes on the GPU at once. Per-process detail is limited here too.

Profiling metrics have limits

The DCGM_FI_PROF_* fields come from hardware counters. On many GPUs only one tool can read those counters at a time, so running Nsight or another profiler can clash with DCGM. They also add a small overhead. Most teams keep them on at a 10 to 30 second interval and pause DCGM profiling while someone runs a deep profile.

Cardinality grows fast

Every metric is labeled with GPU, UUID, node, pod, namespace and more. Multiply that by hundreds of GPUs and dozens of fields and Prometheus storage climbs quickly. Only export the fields you use. DCGM Exporter reads its field list from a CSV file, which you can replace with a ConfigMap holding a shorter list.

Hardware errors hide behind job errors

When a GPU throws an XID error, the user usually sees a crashed or hung pod with a vague CUDA error. Unless you track XID and ECC metrics, you may keep scheduling jobs onto a bad GPU. Some XID codes (such as 48, 79 and 94) usually mean the GPU or node needs attention. Alert on them and cordon the node until it is checked.

Best practices

1. Start with a small, useful set of metrics

Begin with utilization, SM active, tensor active, memory used, temperature, power, clocks and XID errors. Add NVLink and PCIe when you run multi-GPU or data-heavy jobs. A short custom field list keeps costs down and dashboards readable.

2. Always slice by Kubernetes labels

Node-level dashboards are fine for operators, but teams care about their own workloads. Build Grafana panels that filter by namespace and pod so each team can see its own GPU usage. This also makes cost reports simple.

3. Alert on waste, not just failures

Idle GPUs cost real money. Here are a few Prometheus alert rules that work well as a starting point:

groups:
- name: gpu-alerts
  rules:
  - alert: GPUAllocatedButIdle
    expr: avg_over_time(DCGM_FI_DEV_GPU_UTIL{pod!=""}[1h]) < 5
    for: 2h
    labels:
      severity: warning
    annotations:
      summary: "GPU used by {{ $labels.namespace }}/{{ $labels.pod }} has been idle for 2h"

  - alert: GPUMemoryAlmostFull
    expr: DCGM_FI_DEV_FB_USED / (DCGM_FI_DEV_FB_USED + DCGM_FI_DEV_FB_FREE) > 0.95
    for: 10m
    labels:
      severity: warning

  - alert: GPUTooHot
    expr: DCGM_FI_DEV_GPU_TEMP > 85
    for: 5m
    labels:
      severity: critical

  - alert: GPUXidError
    expr: DCGM_FI_DEV_XID_ERRORS > 0
    labels:
      severity: critical
    annotations:
      summary: "XID {{ $value }} on {{ $labels.Hostname }} GPU {{ $labels.gpu }}"

Tune the thresholds to your hardware. Data center GPUs have different safe temperatures, and some jobs (like interactive notebooks) are idle by nature, so you may want to exclude certain namespaces.

4. Track efficiency over time

A single number per team per week helps a lot. For example, average tensor activity for each namespace:

avg by (namespace) (
  avg_over_time(DCGM_FI_PROF_PIPE_TENSOR_ACTIVE{pod!=""}[7d])
)

Show this next to GPU hours requested. Teams quickly notice when they hold eight GPUs and use the power of two.

5. Connect GPU health to node health

Feed XID and ECC alerts into your node remediation flow. Tools like the NVIDIA GPU Operator health checks or a Node Problem Detector setup can mark a node as unhealthy, so Kubernetes stops sending new GPU pods there until someone fixes it.

6. Monitor the whole path, not just the GPU

A slow GPU job is often a slow storage or network job. Put GPU metrics on the same dashboard as CPU usage of the pod, network throughput and disk reads. If tensor activity drops every time the data loader waits on storage, you have found your bottleneck.

7. Plan for scale

At a few hundred GPUs, a single Prometheus may struggle. Use recording rules to pre-compute team and node summaries, keep raw high-resolution data for a short time, and send long-term data to a remote store such as Thanos, Mimir or VictoriaMetrics.

A simple checklist

  • DCGM Exporter is running on every GPU node and scraped by Prometheus.
  • Metrics carry namespace, pod and container labels.
  • You watch SM active and tensor active, not only GPU utilization.
  • Alerts exist for idle allocated GPUs, memory pressure, heat and XID errors.
  • You know which GPUs use MIG or time-slicing and what that means for per-pod data.
  • The exported field list is trimmed to what you use.
  • Teams can see their own GPU usage and efficiency in Grafana.

Wrapping up

GPU monitoring on Kubernetes is not hard to set up, but it is easy to get wrong. The tools are mature: DCGM Exporter, Prometheus and Grafana cover almost everything you need. The real work is choosing the right metrics, not trusting GPU utilization alone, and turning the data into alerts and reports that help teams use their GPUs well.

Start small, attach Kubernetes labels to everything, and alert on waste as much as on failures. Your GPUs, and your cloud bill, will thank you.

Have questions or a GPU monitoring setup you want to share? Reach us on X at @kubezilla_io.

Leave a comment