{
    "name": "GPU",
    "tags": "",
    "ident": "",
    "configs": {
        "var": [
            {
                "name": "datasource",
                "type": "datasource",
                "definition": "prometheus"
            },
            {
                "name": "ident",
                "type": "query",
                "datasource": {
                    "cate": "prometheus",
                    "value": "${datasource}"
                },
                "definition": "label_values(nvidia_smi_name, ident)",
                "multi": false
            }
        ],
        "panels": [
            {
                "type": "stat",
                "id": "4343b7e4-cc22-440e-a8d0-68b3f86af93e",
                "layout": {
                    "h": 5,
                    "w": 4,
                    "x": 0,
                    "y": 0,
                    "i": "4343b7e4-cc22-440e-a8d0-68b3f86af93e",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "sum(nvidia_smi_gpu_info{ident=~\"$ident\"})"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "GPUs",
                "custom": {
                    "textMode": "valueAndName",
                    "colorMode": "value",
                    "calc": "lastNotNull",
                    "valueField": "Value",
                    "colSpan": 1,
                    "textSize": {}
                },
                "options": {
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "gauge",
                "id": "6891a45a-c242-4746-9da7-aa76979013cd",
                "layout": {
                    "h": 5,
                    "w": 4,
                    "x": 4,
                    "y": 0,
                    "i": "6891a45a-c242-4746-9da7-aa76979013cd",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "100 * (nvidia_smi_memory_used_bytes{ident=~\"$ident\"}/nvidia_smi_memory_total_bytes{ident=~\"$ident\"})",
                        "step": null,
                        "legend": "{{hostname}}"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Memory Usage",
                "custom": {
                    "textMode": "value",
                    "calc": "lastNotNull"
                },
                "options": {
                    "valueMappings": [],
                    "standardOptions": {
                        "util": "percent",
                        "decimals": 1
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#3FC453",
                                "value": null,
                                "type": "base"
                            },
                            {
                                "color": "#FF9919",
                                "value": 60
                            },
                            {
                                "color": "#FF656B",
                                "value": 80
                            }
                        ]
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "6a23aa7c-68c6-4244-b170-f07865d152d3",
                "layout": {
                    "h": 5,
                    "w": 16,
                    "x": 8,
                    "y": 0,
                    "i": "6a23aa7c-68c6-4244-b170-f07865d152d3",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "nvidia_smi_utilization_gpu_ratio{ident=~\"$ident\"}",
                        "legend": "GPU 使用率 (%)"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "GPU Utilization",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list",
                        "placement": "bottom"
                    },
                    "standardOptions": {
                        "util": "percentUnit"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "opacity",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    },
                    "lineInterpolation": "smooth"
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "e7d3a6d5-9498-4b32-b839-562ec6f23ac9",
                "layout": {
                    "h": 6,
                    "w": 24,
                    "x": 0,
                    "y": 5,
                    "i": "e7d3a6d5-9498-4b32-b839-562ec6f23ac9",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "nvidia_smi_memory_total_bytes{ident=~\"$ident\"}",
                        "legend": "RAM Total"
                    },
                    {
                        "expr": "nvidia_smi_memory_used_bytes{ident=~\"$ident\"}",
                        "refId": "B",
                        "legend": "RAM Used "
                    },
                    {
                        "expr": "nvidia_smi_memory_total_bytes{ident=~\"$ident\"} - nvidia_smi_memory_used_bytes{ident=~\"$ident\"}",
                        "refId": "C",
                        "legend": "RAM Free"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "\nMemory Basic",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "list"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "a0c504c0-cb34-410e-bd02-b162e9544c25",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 0,
                    "y": 11,
                    "i": "a0c504c0-cb34-410e-bd02-b162e9544c25",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "nvidia_smi_temperature_gpu{ident=~\"$ident\"}",
                        "legend": "Temperature Celsius"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "\nGPU Temperature",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "hidden"
                    },
                    "standardOptions": {},
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "opacity",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            },
            {
                "type": "timeseries",
                "id": "3846225b-2395-4ffb-ba51-c72e5c53d2cf",
                "layout": {
                    "h": 6,
                    "w": 12,
                    "x": 12,
                    "y": 11,
                    "i": "a535ef14-8f5e-41f8-a600-71f7fdbf2e59",
                    "isResizable": true
                },
                "version": "2.0.0",
                "datasourceCate": "prometheus",
                "targets": [
                    {
                        "refId": "A",
                        "expr": "nvidia_smi_power_draw_watts{ident=~\"$ident\"}",
                        "legend": "Power Usage Milliwatts"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Power Usage",
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "none"
                    },
                    "legend": {
                        "displayMode": "table"
                    },
                    "standardOptions": {
                        "util": "none"
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 1,
                    "fillOpacity": 0.5,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "datasourceValue": "${datasource}"
            }
        ],
        "version": "3.0.0",
        "datasourceValue": "hwcloud-bj4"
    }
}