From a729c36e51591db9b2bea1e0440730d98f36a67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Bouynot?= Date: Thu, 22 Feb 2024 16:32:24 +0100 Subject: [PATCH] Fix for systems with more than 4 GPU and recent nvidia-smi version (#506) --- snmp/nvidia | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/snmp/nvidia b/snmp/nvidia index 8bb900f35..0495dc78a 100644 --- a/snmp/nvidia +++ b/snmp/nvidia @@ -17,14 +17,13 @@ sed='/usr/bin/env sed' # 0 1 43 3 2 0 0 2700 862 0 0 462 4 - - 0 26 3 $nvidiasmi dmon -c 1 -s pucvmet | $grep -v ^# | $sed 's/^ *//' | $sed 's/ */,/g' | $sed 's/-/0/g' -lines=$($nvidiasmi dmon -c 1 -s pucvmet | $grep -v ^# | $sed 's/^ *//' | $sed 's/ */,/g' | $sed 's/-/0/g' | wc -l) +gpu=$($nvidiasmi dmon -c 1 -s pucvmet | $grep -v ^# | $sed 's/^ *//' | $sed 's/ */,/g' | $sed 's/-/0/g' | wc -l) # if we are less than 5 then all GPUs were printed -if [ "$lines" -lt 5 ]; then +if [ "$gpu" -lt 5 ]; then exit 0; fi -gpu=5 loop=1 while [ $loop -eq 1 ] do