Skip to content

Commit 406c889

Browse files
authored
Read instant power in pwr_usage
Use the Device Field Value interface to query the instant power usage.
1 parent 4dbcb66 commit 406c889

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel_tuner/observers/nvml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ def auto_boost(self, setting):
298298

299299
def pwr_usage(self):
300300
"""Return current power usage in milliwatts."""
301-
return pynvml.nvmlDeviceGetPowerUsage(self.dev)
301+
NVML_FI_DEV_POWER_INSTANT = 186
302+
return pynvml.nvmlDeviceGetFieldValues(self.dev, [NVML_FI_DEV_POWER_INSTANT])[0].value.uiVal
302303

303304
def gr_voltage(self):
304305
"""Return current graphics voltage in millivolts."""

0 commit comments

Comments
 (0)