fix gpu reporting issue #195

This commit is contained in:
Darko Grozdanovski 2023-03-22 13:23:19 +01:00
parent b346d10306
commit 83a05e1a36

View file

@ -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