Skip to content

Commit

Permalink
Fix for systems with more than 4 GPU and recent nvidia-smi version (#506
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fbouynot authored Feb 22, 2024
1 parent f8a8dc8 commit a729c36
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions snmp/nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a729c36

Please sign in to comment.