From a5ccb70da91e81d64e44e5ab1287dc5f15a72ce7 Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 22 Feb 2018 12:58:21 +0100 Subject: [PATCH] New: GPU utilization --- plugins/gpu/nvidia_gpu_ | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/gpu/nvidia_gpu_ b/plugins/gpu/nvidia_gpu_ index ccad1b83..ffe3034c 100755 --- a/plugins/gpu/nvidia_gpu_ +++ b/plugins/gpu/nvidia_gpu_ @@ -37,8 +37,7 @@ C =item * -Add support for specific professional GPU features such as number of compute -processes, clocks, power draw, utilization, and so on. +Add support for specific professional GPU features such as number of compute processes, clocks and so on. =item * @@ -87,6 +86,7 @@ if [ "$1" = "suggest" ]; then echo "mem" echo "fan" echo "power" + echo "utilization" exit 0 fi @@ -176,6 +176,20 @@ if [ "$1" = "config" ]; then : $((nGpusCounter=nGpusCounter+1)) done ;; + utilization) + echo 'graph_title GPU utilization' + echo 'graph_args -l 0 -u 100' + echo 'graph_vlabel Percentage' + echo 'graph_category sensors' + echo "graph_info GPU utilization of NVIDIA GPUs using driver version $driverVersion" + nGpusCounter=0 + while [ "$nGpusCounter" -lt "$nGpus" ] + do + gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) + echo "utilization${nGpusCounter}.info GPU utilization information for $gpuName" + : $((nGpusCounter=nGpusCounter+1)) + done + ;; *) echo "Can't run without a proper symlink. Exiting." echo "Try running munin-node-configure --suggest." @@ -222,6 +236,9 @@ case $name in power) valueGpus=$(echo "$smiOutput" | grep "Power Draw" | cut -d ':' -f 2 | cut -d ' ' -f 2) ;; + utilization) + valueGpus=$(echo "$smiOutput" | grep "Gpu" | cut -d ':' -f 2 | cut -d ' ' -f 2) + ;; *) echo "Can't run without a proper symlink. Exiting." echo "Try running munin-node-configure --suggest."