Power Queries

Power Queries#

AMD SMI: Power Queries
Power Queries

Functions

amdsmi_status_t amdsmi_get_energy_count (amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp)
 Get the energy accumulator counter of the processor with provided processor handle. It is not supported on virtual machine guest. More...
 

Detailed Description

These functions provide information about power usage.

Function Documentation

◆ amdsmi_get_energy_count()

amdsmi_status_t amdsmi_get_energy_count ( amdsmi_processor_handle  processor_handle,
uint64_t *  power,
float *  counter_resolution,
uint64_t *  timestamp 
)

Get the energy accumulator counter of the processor with provided processor handle. It is not supported on virtual machine guest.

Given a processor handle processor_handle, a pointer to a uint64_t power, and a pointer to a uint64_t timestamp, this function will write amount of energy consumed to the uint64_t pointed to by power, and the timestamp to the uint64_t pointed to by timestamp. The amdsmi_get_power_ave() is an average of a short time. This function accumulates all energy consumed.

Parameters
[in]processor_handlea processor handle
[in,out]counter_resolutionresolution of the counter power in micro Joules
[in,out]powera pointer to uint64_t to which the energy counter will be written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
[in,out]timestampa pointer to uint64_t to which the timestamp will be written. Resolution: 1 ns.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail