Skip to content

Operator task guide

How to configure NVIDIA dcgm-exporter with Prometheus and Grafana on Kubernetes

NVIDIA dcgm-exporter runs as a Kubernetes DaemonSet (standalone Helm chart or via NVIDIA GPU Operator) exposing DCGM_FI_DEV_* telemetry on port 9400 /metrics for Prometheus and Grafana.

Default dcgm-exporter collector CSVs include utilization, temperature, power, framebuffer usage, and ECC/Xid counters, while profiling metrics (Tensor Core activity, NVLink/PCIe throughput) require enabling profiling counters in your dcp-metrics-included.csv ConfigMap and ensuring no conflicting DCGM profiling clients hold exclusive locks.

Reviewed . Reference guidance is not a diagnosis of your workload.

Step-by-step method

  1. 1

    Verify dcgm-exporter DaemonSet pods and /metrics output

    Confirm dcgm-exporter is healthy across every GPU node and returning pod/namespace Kubernetes labels alongside DCGM_FI_DEV_* gauges.

    kubectl -n gpu-operator get pods -l app=nvidia-dcgm-exporter
    kubectl -n gpu-operator port-forward daemonset/nvidia-dcgm-exporter 9400:9400 &
    curl -fsS http://127.0.0.1:9400/metrics | grep -E 'DCGM_FI_DEV_(GPU_UTIL|FB_USED|XID_ERRORS|POWER_USAGE)' | head -n 30
  2. 2

    Deploy or customize dcgm-exporter via Helm and custom metrics CSV

    Enable ServiceMonitor for kube-prometheus-stack and mount a custom metrics CSV when you need NVLink CRC/replay counters, row-remapping failure flags, or Tensor Core SM occupancy.

    helm repo add gpu-helm-charts https://nvidia.github.io/dcgm-exporter/helm-charts
    helm repo update
    helm upgrade --install dcgm-exporter gpu-helm-charts/dcgm-exporter \
      --namespace gpu-operator --set serviceMonitor.enabled=true
  3. 3

    Connect Prometheus to Grafana NVIDIA DCGM dashboards

    Import the official NVIDIA DCGM Exporter Dashboard into Grafana (or query DCGM_FI_DEV_GPU_UTIL, DCGM_FI_DEV_FB_USED, and increase(DCGM_FI_DEV_XID_ERRORS[5m]) directly) and filter by exported_namespace / exported_pod.

    # Example PromQL queries for Grafana alerts
    DCGM_FI_DEV_FB_USED / (DCGM_FI_DEV_FB_USED + DCGM_FI_DEV_FB_FREE)
    increase(DCGM_FI_DEV_XID_ERRORS[5m]) > 0
  4. 4

    Bridge the gap between metric cliffs and Python/CUDA root cause

    When Grafana shows utilization collapsing or Xid counts jumping, dcgm-exporter tells you which GPU experienced an event, not which rank failed inside PyTorch/vLLM. Pair Prometheus alerts with log-level triage on pod crashes.

dcgm-exporter troubleshooting guide

Signals, meanings and actions for how to configure nvidia dcgm-exporter with prometheus and grafana on kubernetes.
SignalWhat it meansNext action
Prometheus target shows no metrics or missing pod labelsServiceMonitor selector mismatch or kubelet pod-resources socket unmounted.Verify ServiceMonitor labels match Prometheus release and check /var/lib/kubelet/pod-resources.
DCGM_FI_PROF_* metrics missing or failingHardware profiling counters conflict or unsupported on MIG/vGPU slice.Check dcgm-exporter logs for DCGM_ST_NOT_SUPPORTED or disable conflicting profilers.
Graph drops to zero without Xid counter risingSoftware crash (OOM, Python exception, NCCL deadlock) killed pod cleanly.Inspect previous pod logs and NCCL/CUDA stack traces in Denpex.
DCGM_FI_DEV_XID_ERRORS rises on one nodeHost driver logged an NVIDIA Xid event.Pull exact Xid number and payload from host dmesg and inspect /xid.

Evidence checklist

  • dcgm-exporter pod logs and Helm values.yaml
  • Mounted dcp-metrics-included.csv metrics list
  • Sample curl output from port 9400 /metrics
  • Prometheus ServiceMonitor YAML and target health status
  • Host dmesg Xid lines when DCGM_FI_DEV_XID_ERRORS increments

Common mistakes

Alerting on DCGM_FI_DEV_GPU_UTIL == 0 during checkpoint saves

Checkpointing and dataloader stalls drop SM utilization without indicating dead hardware.

Assuming DCGM_FI_DEV_XID_ERRORS tells you which Xid number fired

Many exporter configs report the latest code as a gauge value or count; always capture host dmesg to see the full sequence and subcodes.

Ignoring memory used vs memory free ratio

Tracking both FB_USED and FB_FREE cleanly shows OOM risk across MIG and full GPUs.

Frequently asked questions

What port does NVIDIA dcgm-exporter use for Prometheus?

By default, dcgm-exporter serves Prometheus metrics on TCP port 9400 at path /metrics.

Does dcgm-exporter track Kubernetes pod and namespace names per GPU?

Yes, when pod-resources kubelet socket integration is enabled (default in NVIDIA GPU Operator), dcgm-exporter attaches pod, namespace, and container labels to each GPU series.

Why does dcgm-exporter not show PyTorch rank IDs or NCCL errors?

dcgm-exporter queries the NVIDIA driver and NVML/DCGM at the device level; it has no visibility into Python tracebacks, PyTorch RANK variables, or NCCL watchdog stderr.

Can I deploy dcgm-exporter with Docker Compose outside Kubernetes?

Yes. Run nvcr.io/nvidia/k8s/dcgm-exporter with --gpus all --cap-add SYS_ADMIN -p 9400:9400 and scrape localhost:9400 from Prometheus.

Live diagnosis, no signup

Upload your GPU log. Find what happened first.

Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.

Before uploading, review cloud data handling and local options.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

Try Denpex for 30 days. FREE.

No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.

Start your free 30-day Team evaluation

Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.

Apply the method to your incident

Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.

Diagnose your incident