{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "选择当前 Prometheus 数据源",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "10.4.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "id": 1,
      "type": "stat",
      "title": "GPU 数量",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "count(count by (gpu) (DCGM_FI_DEV_GPU_UTIL_RATIO{hostname=~\"$hostname\"}))",
          "legendFormat": "",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      }
    },
    {
      "id": 2,
      "type": "stat",
      "title": "平均 GPU 利用率",
      "description": "",
      "gridPos": {
        "x": 6,
        "y": 0,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "avg(DCGM_FI_DEV_GPU_UTIL_RATIO{hostname=~\"$hostname\"}) * 100",
          "legendFormat": "",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "总显存使用量",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 0,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(DCGM_FI_DEV_FB_USED_BYTES{hostname=~\"$hostname\"}) / 1024^3",
          "legendFormat": "",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "gibytes",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "总 GPU 功耗",
      "description": "",
      "gridPos": {
        "x": 18,
        "y": 0,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "sum(DCGM_FI_DEV_BOARD_POWER_WATTS{hostname=~\"$hostname\"})",
          "legendFormat": "",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "watt",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      }
    },
    {
      "id": 5,
      "type": "timeseries",
      "title": "GPU 利用率（每张卡）",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 5,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_GPU_UTIL_RATIO{hostname=~\"$hostname\",gpu=~\"$gpu\"} * 100",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 6,
      "type": "timeseries",
      "title": "显存利用率（每张卡）",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 5,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_MEMORY_UTIL_RATIO{hostname=~\"$hostname\",gpu=~\"$gpu\"} * 100",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 7,
      "type": "timeseries",
      "title": "GPU 温度",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 13,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_GPU_TEMP_CELSIUS{hostname=~\"$hostname\",gpu=~\"$gpu\"}",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 8,
      "type": "timeseries",
      "title": "GPU 功耗",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 13,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_BOARD_POWER_WATTS{hostname=~\"$hostname\",gpu=~\"$gpu\"}",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "watt",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 9,
      "type": "timeseries",
      "title": "显存已使用（GiB）",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 21,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_FB_USED_BYTES{hostname=~\"$hostname\",gpu=~\"$gpu\"} / 1024^3",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "gibytes",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 10,
      "type": "timeseries",
      "title": "显存总容量（GiB）",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 21,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_FB_CAPACITY_BYTES{hostname=~\"$hostname\",gpu=~\"$gpu\"} / 1024^3",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "gibytes",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 11,
      "type": "timeseries",
      "title": "SM 核心频率（MHz）",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 29,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_SM_CLOCK_HERTZ{hostname=~\"$hostname\",gpu=~\"$gpu\"} / 1000000",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "mhz",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 12,
      "type": "timeseries",
      "title": "显存频率（MHz）",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 29,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_MEMORY_CLOCK_HERTZ{hostname=~\"$hostname\",gpu=~\"$gpu\"} / 1000000",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "mhz",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 13,
      "type": "timeseries",
      "title": "视频编码利用率",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 37,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_ENC_UTIL_RATIO{hostname=~\"$hostname\",gpu=~\"$gpu\"} * 100",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 14,
      "type": "timeseries",
      "title": "视频解码利用率",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 37,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_DEC_UTIL_RATIO{hostname=~\"$hostname\",gpu=~\"$gpu\"} * 100",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 15,
      "type": "timeseries",
      "title": "PCIe 重放计数",
      "description": "累计计数；关注持续增长趋势，不代表实时 PCIe 吞吐量。",
      "gridPos": {
        "x": 0,
        "y": 45,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_PCIE_REPLAY_TOTAL{hostname=~\"$hostname\",gpu=~\"$gpu\"}",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 16,
      "type": "timeseries",
      "title": "显存行重映射失败",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 45,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_ROW_REMAP_FAILED{hostname=~\"$hostname\",gpu=~\"$gpu\"}",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 17,
      "type": "timeseries",
      "title": "显存行重映射可纠正累计数",
      "description": "",
      "gridPos": {
        "x": 0,
        "y": 53,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_ROW_REMAP_CORRECTABLE_TOTAL{hostname=~\"$hostname\",gpu=~\"$gpu\"}",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 18,
      "type": "timeseries",
      "title": "显存行重映射不可纠正累计数",
      "description": "",
      "gridPos": {
        "x": 12,
        "y": 53,
        "w": 12,
        "h": 8
      },
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "targets": [
        {
          "refId": "A",
          "expr": "DCGM_FI_DEV_ROW_REMAP_UNCORRECTABLE_TOTAL{hostname=~\"$hostname\",gpu=~\"$gpu\"}",
          "legendFormat": "GPU {{gpu}}",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    }
  ],
  "refresh": "15s",
  "schemaVersion": 39,
  "tags": [
    "NVIDIA",
    "DCGM",
    "RTX 4090",
    "Bare Metal",
    "8 GPU"
  ],
  "templating": {
    "list": [
      {
        "name": "hostname",
        "type": "query",
        "label": "主机",
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(DCGM_FI_DEV_GPU_UTIL_RATIO, hostname)",
        "query": {
          "query": "label_values(DCGM_FI_DEV_GPU_UTIL_RATIO, hostname)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 2,
        "sort": 1,
        "multi": false,
        "includeAll": true,
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "home",
          "value": "home"
        },
        "options": []
      },
      {
        "name": "gpu",
        "type": "query",
        "label": "GPU",
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(DCGM_FI_DEV_GPU_UTIL_RATIO{hostname=~\"$hostname\"}, gpu)",
        "query": {
          "query": "label_values(DCGM_FI_DEV_GPU_UTIL_RATIO{hostname=~\"$hostname\"}, gpu)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 2,
        "sort": 1,
        "multi": true,
        "includeAll": true,
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": "$__all"
        },
        "options": []
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "NVIDIA RTX 4090 × 8 - DCGM Exporter 4.9.0",
  "uid": "nvidia-rtx4090-dcgm49",
  "version": 1,
  "weekStart": ""
}