Skip to content

Instantly share code, notes, and snippets.

@samson-wang
Created June 29, 2017 03:27
Show Gist options
  • Save samson-wang/6de1f19c0bea3741c150a3b54fd97dd7 to your computer and use it in GitHub Desktop.
Save samson-wang/6de1f19c0bea3741c150a3b54fd97dd7 to your computer and use it in GitHub Desktop.
gpu metrics for telegraf and chronograf
{
"id": "20850d4a-310a-4ab7-b33d-d33528b832af",
"measurement": "gpu_mycollector",
"app": "gpu_mem",
"cells": [{
"x": 0,
"y": 0,
"w": 4,
"h": 4,
"i": "da71e439-25ac-4bf7-9276-697ff69e1604",
"name": "GPU Memory Usage",
"queries": [{
"query": "select mean(\"memory_used\") / 1000 as \"memory_used\" from gpu_mycollector",
"groupbys": ["\"gpu\""],
"wheres": []
}]
}]
}
#!/bin/bash
nvidia-smi --format=csv,noheader,nounits --query-gpu=uuid,name,memory.total,memory.used,memory.free,temperature.gpu | awk -F", " '{gsub(/ /,"_",$2); print "gpu,gpu="NR-1",gpu_name="$2,"memory_total="$3",memory_used="$4",memory_free="$5}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment