1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 10:28:36 +00:00

Merge pull request #166 from Niluge-KiWi/master

nvidia_smi: Get memory usage even if nvmlDeviceGetUtilizationRates is not available
This commit is contained in:
Kenyon Ralph 2012-08-20 16:24:24 -07:00
commit 8e1ab117aa

View file

@ -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";