Skip to content

Commit 6daf88b

Browse files
committed
docs: pipeline: inputs: gpu-metrics: document NVIDIA NVML support and enable_nvml
- Correct intro: NVIDIA GPUs are now supported via NVML (libnvidia-ml) - Add enable_nvml configuration option (default true) - Add gpu_process_memory_used_bytes and gpu_mig_device_info metrics - Note card/vendor labels (vendor: amd or nvidia) - Split GPU detection into AMD and NVIDIA subsections - Add enable_nvml to YAML and classic config examples Note this action needed due to code changes without docs PR. Signed-off-by: Eric D. Schabell <eric@schabell.org>
1 parent 4817e05 commit 6daf88b

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

pipeline/inputs/gpu-metrics.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
The _gpu_metrics_ input plugin collects graphics processing unit (GPU) performance metrics from graphics cards on Linux systems. It provides real-time monitoring of GPU utilization, memory usage (VRAM), clock frequencies, power consumption, temperature, and fan speeds.
88

9-
The plugin reads metrics directly from the Linux `sysfs` filesystem (`/sys/class/drm/`) without requiring external tools or libraries. Only AMD GPUs are supported through the `amdgpu` kernel driver. NVIDIA and Intel GPUs aren't supported.
9+
The plugin supports two GPU vendors:
10+
11+
- **AMD**: Metrics are read directly from the Linux `sysfs` filesystem (`/sys/class/drm/`) through the `amdgpu` kernel driver, without requiring external tools or libraries.
12+
- **NVIDIA**: Metrics are collected through the NVIDIA Management Library (NVML) when the `libnvidia-ml` shared library from the NVIDIA driver is available. NVML collection is enabled by default and can be turned off with `enable_nvml`.
13+
14+
Intel GPUs aren't supported.
1015

1116
## Metrics collected
1217

@@ -22,6 +27,10 @@ The plugin collects the following metrics for each detected GPU:
2227
| `gpu_temperature_celsius` | GPU die temperature in degrees Celsius. Can be disabled with `enable_temperature` set to `false`. |
2328
| `gpu_fan_speed_rpm` | Fan rotation speed in Revolutions per Minute (RPM). |
2429
| `gpu_fan_pwm_percent` | Fan PWM duty cycle as a percentage (0-100). Indicates fan intensity. |
30+
| `gpu_process_memory_used_bytes` | Per-process GPU memory usage in bytes, labeled by process ID (`pid`). NVIDIA (NVML) only. |
31+
| `gpu_mig_device_info` | Multi-Instance GPU (MIG) device information, labeled with `parent_uuid`, `gpu_instance_id`, and `compute_instance_id`. NVIDIA (NVML) only. |
32+
33+
Every metric includes `card` and `vendor` labels. The `vendor` label is `amd` or `nvidia`, depending on which GPU reported the metric.
2534

2635
### Clock metrics
2736

@@ -41,13 +50,16 @@ The plugin supports the following configuration parameters:
4150
|----------------------|-------------------------------------------------------------------------------------------------------------------------|-----------|
4251
| `cards_exclude` | Pattern specifying which GPU cards to exclude from monitoring. Uses the same syntax as `cards_include`. | _none_ |
4352
| `cards_include` | Pattern specifying which GPU cards to monitor. Supports wildcards (*), ranges (0-3), and comma-separated lists (0,2,4). | `*` |
53+
| `enable_nvml` | Enable NVIDIA GPU metrics collection through NVML (the NVIDIA Management Library). Requires the `libnvidia-ml` shared library from the NVIDIA driver to be present. | `true` |
4454
| `enable_power` | Enable collection of power consumption metrics (`gpu_power_watts`). | `true` |
4555
| `enable_temperature` | Enable collection of temperature metrics (`gpu_temperature_celsius`). | `true` |
4656
| `path_sysfs` | Path to the `sysfs` root directory. Typically used for testing or non-standard systems. | `/sys` |
4757
| `scrape_interval` | Interval in seconds between metric collection cycles. | `5` |
4858

4959
## GPU detection
5060

61+
### AMD GPUs
62+
5163
The GPU metrics plugin scans for any supported AMD GPU using the `amdgpu` kernel driver. Any GPU using legacy drivers is ignored.
5264

5365
To check if your AMD GPU will be detected run:
@@ -63,9 +75,25 @@ Example output:
6375
73:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Granite Ridge [Radeon Graphics] (rev c5)
6476
```
6577

78+
### NVIDIA GPUs
79+
80+
When `enable_nvml` is `true` (the default), the plugin detects NVIDIA GPUs through NVML, provided the `libnvidia-ml` shared library from the NVIDIA driver is installed. If the library isn't present, NVML collection is skipped and a message is logged.
81+
82+
To confirm your NVIDIA driver and GPUs are visible run:
83+
84+
```shell
85+
nvidia-smi -L
86+
```
87+
88+
Example output:
89+
90+
```text
91+
GPU 0: NVIDIA A100-SXM4-40GB (UUID: GPU-1a2b3c4d-5e6f-7890-abcd-ef1234567890)
92+
```
93+
6694
### Multiple GPU systems
6795

68-
In systems with multiple GPUs, the GPU metrics plugin will detect all AMD cards by default. You can control which GPUs you want to monitor with the `cards_include` and `cards_exclude` parameters.
96+
In systems with multiple GPUs, the GPU metrics plugin detects all supported AMD and NVIDIA cards by default. You can control which GPUs you want to monitor with the `cards_include` and `cards_exclude` parameters.
6997

7098
To list the GPUs running in your system run the following command:
7199

@@ -127,6 +155,7 @@ pipeline:
127155
- name: gpu_metrics
128156
cards_exclude: "0"
129157
cards_include: "1"
158+
enable_nvml: true
130159
enable_power: true
131160
enable_temperature: true
132161
path_sysfs: /sys
@@ -145,6 +174,7 @@ pipeline:
145174
Name gpu_metrics
146175
Cards_Exclude 0
147176
Cards_Include 1
177+
Enable_Nvml true
148178
Enable_Power true
149179
Enable_Temperature true
150180
Path_Sysfs /sys

0 commit comments

Comments
 (0)