Merge pull request #416 from bachandi/nvidiagpu_missing_value_fix

Coarser check for missing return values of nvidia-smi.
This commit is contained in:
Jordi Sanfeliu 2022-03-21 09:05:37 +01:00 committed by GitHub
commit 931e315f79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -191,7 +191,7 @@ sub nvidiagpu_update {
if(scalar(@tmp) > 1) { # To catch missing devices
for(my $n_sensor = 0; $n_sensor < scalar(@tmp); $n_sensor += 1) {
my $val = trim($tmp[$n_sensor]);
if($val ne "N/A") {
if($val !~ /N\/A/) {
if(substr($val, 0, 1) eq "P") {
$val = substr($val, 1);
}