gpu_process_exporter

command module
v0.0.0-...-f6156a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

gpu_process_exporter

在研究Prometheus + Grafana监控主机GPU时,发现nvidia官方提供的exporter只有总的数据,并没有每个进程占用的显存数据,之前也没有用过go语言,就自己边摸索边用go写了个gpu进程的exporter

主要是解析 nvidia-smi -q -x 命令生成的xml格式,转换输出自定义的Prometheus格式,端口号:9102

GPU_EXPORTER{GPU="GPU0",Pid="1818",Type="C",ProcessName="python"} 5097
GPU_EXPORTER{GPU="GPU0",Pid="",Type="",ProcessName="Total"} 15079
GPU_EXPORTER{GPU="GPU0",Pid="",Type="",ProcessName="Used"} 12435
GPU_EXPORTER{GPU="GPU0",Pid="",Type="",ProcessName="Free"} 2644

编译构建
go build -v gpu_process_exporter.go

执行
./gpu_process_exporter

查看
http://ip:9102/metrics

集成进Grafana的效果图 image

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL