add a check to verify if 'nvidia-smi' command does exists in the system

This commit is contained in:
Jordi Sanfeliu 2013-07-01 17:50:47 +02:00
parent 72344fe8a6
commit 60e4e11529
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,12 @@ sub nvidia_init {
my ($package, $config, $debug) = @_;
my $rrd = $config->{base_lib} . $package . ".rrd";
# checks if 'nvidia-smi' does exists.
if(!open(IN, "nvidia-smi |")) {
logger("$myself: unable to execute 'nvidia-smi'. $!");
return;
}
if(!(-e $rrd)) {
logger("Creating '$rrd' file.");
eval {