From 83a05e1a36835f77a2b0bee2dea040ad4659c567 Mon Sep 17 00:00:00 2001 From: Darko Grozdanovski Date: Wed, 22 Mar 2023 13:23:19 +0100 Subject: [PATCH] fix gpu reporting issue #195 --- scripts/gpu_usage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gpu_usage.sh b/scripts/gpu_usage.sh index 9ffc647..552ed2b 100755 --- a/scripts/gpu_usage.sh +++ b/scripts/gpu_usage.sh @@ -27,7 +27,7 @@ get_gpu() { gpu=$(get_platform) if [[ "$gpu" == NVIDIA ]]; then - usage=$(nvidia-smi | grep '%' | awk '{ sum += $13 } END { printf("%d%%\n", sum / NR) }') + usage=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ sum += $0 } END { printf("%d%%\n", sum / NR) }') else usage='unknown' fi