Merge pull request #196 from darko1002001/master

fix gpu reporting issue #195
This commit is contained in:
Ethan Edwards 2023-04-08 10:14:41 -04:00 committed by GitHub
commit 6333a3d52c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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