Power Queries#
Functions | |
rsmi_status_t | rsmi_dev_power_ave_get (uint32_t dv_ind, uint32_t sensor_ind, uint64_t *power) |
Get the average power consumption of the device with provided device index. More... | |
rsmi_status_t | rsmi_dev_energy_count_get (uint32_t dv_ind, uint64_t *power, float *counter_resolution, uint64_t *timestamp) |
Get the energy accumulator counter of the device with provided device index. More... | |
rsmi_status_t | rsmi_dev_power_cap_get (uint32_t dv_ind, uint32_t sensor_ind, uint64_t *cap) |
Get the cap on power which, when reached, causes the system to take action to reduce power. More... | |
rsmi_status_t | rsmi_dev_power_cap_default_get (uint32_t dv_ind, uint64_t *default_cap) |
Get the default power cap for the device specified by dv_ind . More... | |
rsmi_status_t | rsmi_dev_power_cap_range_get (uint32_t dv_ind, uint32_t sensor_ind, uint64_t *max, uint64_t *min) |
Get the range of valid values for the power cap. More... | |
Detailed Description
These functions provide information about power usage.
Function Documentation
◆ rsmi_dev_power_ave_get()
rsmi_status_t rsmi_dev_power_ave_get | ( | uint32_t | dv_ind, |
uint32_t | sensor_ind, | ||
uint64_t * | power | ||
) |
Get the average power consumption of the device with provided device index.
Given a device index dv_ind
and a pointer to a uint64_t power
, this function will write the current average power consumption (in microwatts) to the uint64_t pointed to by power
.
- Parameters
-
[in] dv_ind a device index [in] sensor_ind a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. [in,out] power a pointer to uint64_t to which the average power consumption will be written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_energy_count_get()
rsmi_status_t rsmi_dev_energy_count_get | ( | uint32_t | dv_ind, |
uint64_t * | power, | ||
float * | counter_resolution, | ||
uint64_t * | timestamp | ||
) |
Get the energy accumulator counter of the device with provided device index.
Given a device index dv_ind
, 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 rsmi_dev_power_ave_get() is an average of a short time. This function accumulates all energy consumed.
- Parameters
-
[in] dv_ind a device index [in,out] counter_resolution resolution of the counter power
in micro Joules[in,out] power a pointer to uint64_t to which the energy counter will be written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments. [in,out] timestamp a pointer to uint64_t to which the timestamp will be written. Resolution: 1 ns.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_power_cap_get()
rsmi_status_t rsmi_dev_power_cap_get | ( | uint32_t | dv_ind, |
uint32_t | sensor_ind, | ||
uint64_t * | cap | ||
) |
Get the cap on power which, when reached, causes the system to take action to reduce power.
When power use rises above the value power
, the system will take action to reduce power use. The power level returned through power
will be in microWatts.
- Parameters
-
[in] dv_ind a device index [in] sensor_ind a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. [in,out] cap a pointer to a uint64_t that indicates the power cap, in microwatts If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_power_cap_default_get()
rsmi_status_t rsmi_dev_power_cap_default_get | ( | uint32_t | dv_ind, |
uint64_t * | default_cap | ||
) |
Get the default power cap for the device specified by dv_ind
.
The maximum power cap be temporarily changed by the user. However, this function always returns the default reset power cap. The power level returned through power
will be in microWatts.
- Parameters
-
[in] dv_ind a device index [in,out] default_cap a pointer to a uint64_t that indicates the default power cap, in microwatts If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_power_cap_range_get()
rsmi_status_t rsmi_dev_power_cap_range_get | ( | uint32_t | dv_ind, |
uint32_t | sensor_ind, | ||
uint64_t * | max, | ||
uint64_t * | min | ||
) |
Get the range of valid values for the power cap.
This function will return the maximum possible valid power cap max
and the minimum possible valid power cap min
- Parameters
-
[in] dv_ind a device index [in] sensor_ind a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. [in,out] max a pointer to a uint64_t that indicates the maximum possible power cap, in microwatts If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments. [in,out] min a pointer to a uint64_t that indicates the minimum possible power cap, in microwatts If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid