mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
nvidia_smi: Get memory usage even if nvmlDeviceGetUtilizationRates is not available
This commit is contained in:
parent
27e4cf0fe3
commit
1db89fc9a8
1 changed files with 10 additions and 1 deletions
|
@ -110,7 +110,16 @@ for (my $i = 0; $i < $gpuCount; $i++)
|
|||
else
|
||||
{
|
||||
$gpuUtil = "N/A";
|
||||
$memUtil = "N/A";
|
||||
|
||||
($ret, my $memory) = nvmlDeviceGetMemoryInfo($handle);
|
||||
if ($ret == $NVML_SUCCESS)
|
||||
{
|
||||
$memUtil = $memory->{"used"} / $memory->{"total"} * 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
$memUtil = "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
print "GPU_TEMP_$i.value $gpuTemp\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue