Extend metrics collected from Nvidia GPUs (#5885)

This commit is contained in:
Aaron Wood 2019-05-26 19:02:09 -07:00 committed by Daniel Nelson
parent 43c3ceec96
commit 77659f33bc
3 changed files with 23 additions and 5 deletions

View File

@ -35,6 +35,15 @@ On Windows, `nvidia-smi` is generally located at `C:\Program Files\NVIDIA Corpor
- `temperature_gpu` (integer, degrees C) - `temperature_gpu` (integer, degrees C)
- `utilization_gpu` (integer, percentage) - `utilization_gpu` (integer, percentage)
- `utilization_memory` (integer, percentage) - `utilization_memory` (integer, percentage)
- `pcie_link_gen_current` (integer)
- `pcie_link_width_current` (integer)
- `encoder_stats_session_count` (integer)
- `encoder_stats_average_fps` (integer)
- `encoder_stats_average_latency` (integer)
- `clocks_current_graphics` (integer, MHz)
- `clocks_current_sm` (integer, MHz)
- `clocks_current_memory` (integer, MHz)
- `clocks_current_video` (integer, MHz)
### Sample Query ### Sample Query

View File

@ -16,7 +16,7 @@ import (
var ( var (
measurement = "nvidia_smi" measurement = "nvidia_smi"
metrics = "fan.speed,memory.total,memory.used,memory.free,pstate,temperature.gpu,name,uuid,compute_mode,utilization.gpu,utilization.memory,index,power.draw" metrics = "fan.speed,memory.total,memory.used,memory.free,pstate,temperature.gpu,name,uuid,compute_mode,utilization.gpu,utilization.memory,index,power.draw,pcie.link.gen.current,pcie.link.width.current,encoder.stats.sessionCount,encoder.stats.averageFps,encoder.stats.averageLatency,clocks.current.graphics,clocks.current.sm,clocks.current.memory,clocks.current.video"
metricNames = [][]string{ metricNames = [][]string{
{"fan_speed", "integer"}, {"fan_speed", "integer"},
{"memory_total", "integer"}, {"memory_total", "integer"},
@ -31,6 +31,15 @@ var (
{"utilization_memory", "integer"}, {"utilization_memory", "integer"},
{"index", "tag"}, {"index", "tag"},
{"power_draw", "float"}, {"power_draw", "float"},
{"pcie_link_gen_current", "integer"},
{"pcie_link_width_current", "integer"},
{"encoder_stats_session_count", "integer"},
{"encoder_stats_average_fps", "integer"},
{"encoder_stats_average_latency", "integer"},
{"clocks_current_graphics", "integer"},
{"clocks_current_sm", "integer"},
{"clocks_current_memory", "integer"},
{"clocks_current_video", "integer"},
} }
) )

View File

@ -7,15 +7,15 @@ import (
) )
func TestParseLineStandard(t *testing.T) { func TestParseLineStandard(t *testing.T) {
line := "85, 8114, 553, 7561, P2, 61, GeForce GTX 1070 Ti, GPU-d1911b8a-f5c8-5e66-057c-486561269de8, Default, 100, 93, 1, 0.0\n" line := "41, 11264, 1074, 10190, P8, 32, GeForce RTX 2080 Ti, GPU-c97b7f88-c06d-650f-5339-f8dd0c1315c0, Default, 1, 4, 0, 24.33, 1, 16, 0, 0, 0, 300, 300, 405, 540\n"
tags, fields, err := parseLine(line) tags, fields, err := parseLine(line)
if err != nil { if err != nil {
t.Fail() t.Fail()
} }
if tags["name"] != "GeForce GTX 1070 Ti" { if tags["name"] != "GeForce RTX 2080 Ti" {
t.Fail() t.Fail()
} }
if temp, ok := fields["temperature_gpu"].(int); ok && temp == 61 { if temp, ok := fields["temperature_gpu"].(int); ok && temp != 32 {
t.Fail() t.Fail()
} }
} }
@ -37,7 +37,7 @@ func TestParseLineBad(t *testing.T) {
} }
func TestParseLineNotSupported(t *testing.T) { func TestParseLineNotSupported(t *testing.T) {
line := "[Not Supported], 7606, 0, 7606, P0, 38, Tesla P4, GPU-xxx, Default, 0, 0, 0, 0.0\n" line := "[Not Supported], 11264, 1074, 10190, P8, 32, GeForce RTX 2080 Ti, GPU-c97b7f88-c06d-650f-5339-f8dd0c1315c0, Default, 1, 4, 0, 24.33, 1, 16, 0, 0, 0, 300, 300, 405, 540\n"
_, fields, err := parseLine(line) _, fields, err := parseLine(line)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, nil, fields["fan_speed"]) require.Equal(t, nil, fields["fan_speed"])