torch.xpu.power_draw#
- torch.xpu.power_draw(device=None)[source]#
Return the GPU card power draw in watts.
The value is computed by dividing the energy delta by the time delta between two energy-counter reads separated by a 100ms sampling interval.
- Parameters:
device (torch.device, str or int, optional) – selected device. Uses the current device, given by
current_device(), ifNone(default).- Return type:
Note
This function blocks for approximately 100ms per call due to the sampling interval required to compute an accurate power reading.
Note
This API may require elevated privileges (e.g.
sudo) to access GPU power information.