From 259489bb777c38886ae80470904a4871a8c04b8c Mon Sep 17 00:00:00 2001 From: Matt Merhar Date: Sun, 2 Mar 2025 17:50:09 -0500 Subject: [PATCH] nvidia_gpu_: fix utilization when using 570.x driver The utilization used to be on a line beginning with "Gpu", but has since been capitalized to "GPU". There's already several other instances of that in the nvidia-smi output, so narrow down the search by returning only the line after "Utilization". --- plugins/gpu/nvidia_gpu_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gpu/nvidia_gpu_ b/plugins/gpu/nvidia_gpu_ index f13516e7..47e08590 100755 --- a/plugins/gpu/nvidia_gpu_ +++ b/plugins/gpu/nvidia_gpu_ @@ -265,7 +265,7 @@ case $name in 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) + valueGpus=$(echo "$smiOutput" | grep -A 1 "Utilization" | grep -i "GPU" | cut -d ':' -f 2 | cut -d ' ' -f 2) ;; rx) rxGpus=$(echo "$smiOutput" | grep "Rx Throughput" | cut -d ':' -f 2 | cut -d ' ' -f 2)