Power Control

Power Control#

AMD SMI: Power Control
Power Control

Functions

amdsmi_status_t amdsmi_set_power_cap (amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap)
 Set the maximum gpu power cap value. It is not supported on virtual machine guest.
 
amdsmi_status_t amdsmi_set_gpu_power_profile (amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile)
 Set the power performance profile. It is not supported on virtual machine guest.
 
amdsmi_status_t amdsmi_get_supported_power_cap (amdsmi_processor_handle processor_handle, uint32_t *sensor_count, uint32_t *sensor_inds, amdsmi_power_cap_type_t *sensor_types)
 Query the supported power cap sensors and their types for a device.
 
amdsmi_status_t amdsmi_get_cpu_socket_power (amdsmi_processor_handle processor_handle, uint32_t *ppower)
 Get the socket power.
 
amdsmi_status_t amdsmi_get_cpu_socket_power_cap (amdsmi_processor_handle processor_handle, uint32_t *pcap)
 Get the socket power cap.
 
amdsmi_status_t amdsmi_get_cpu_socket_power_cap_max (amdsmi_processor_handle processor_handle, uint32_t *pmax)
 Get the maximum power cap value for a given socket.
 
amdsmi_status_t amdsmi_get_cpu_pwr_svi_telemetry_all_rails (amdsmi_processor_handle processor_handle, uint32_t *power)
 Get the SVI based power telemetry for all rails.
 
amdsmi_status_t amdsmi_set_cpu_socket_power_cap (amdsmi_processor_handle processor_handle, uint32_t pcap)
 Set the power cap value for a given socket.
 
amdsmi_status_t amdsmi_set_cpu_pwr_efficiency_mode (amdsmi_processor_handle processor_handle, uint8_t mode)
 Set the power efficiency profile policy.
 

Detailed Description

These functions provide ways to control power usage.

Function Documentation

◆ amdsmi_set_power_cap()

amdsmi_status_t amdsmi_set_power_cap ( amdsmi_processor_handle  processor_handle,
uint32_t  sensor_ind,
uint64_t  cap 
)

Set the maximum gpu power cap value. It is not supported on virtual machine guest.

Platform:

host

gpu_bm_linux

guest_1vf

Set the power cap to the provided value cap. cap must be between the minimum and maximum power cap values set by the system, which can be obtained from ::amdsmi_dev_power_cap_range_get.

Parameters
[in]processor_handleA processor handle
[in]sensor_inda 0-based sensor index. Normally, this will be 0. If a processor has more than one sensor, it could be greater than 0.
[in]capa uint64_t that indicates the desired power cap. The cap value must be greater than 0.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_set_gpu_power_profile()

amdsmi_status_t amdsmi_set_gpu_power_profile ( amdsmi_processor_handle  processor_handle,
uint32_t  reserved,
amdsmi_power_profile_preset_masks_t  profile 
)

Set the power performance profile. It is not supported on virtual machine guest.

Platform:
gpu_bm_linux

This function will attempt to set the current profile to the provided profile, given a processor handle processor_handle and a profile. The provided profile must be one of the currently supported profiles, as indicated by a call to :: amdsmi_get_gpu_power_profile_presets()

Parameters
[in]processor_handlea processor handle
[in]reservedNot currently used. Set to 0.
[in]profilea amdsmi_power_profile_preset_masks_t that hold the mask of the desired new power profile
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_supported_power_cap()

amdsmi_status_t amdsmi_get_supported_power_cap ( amdsmi_processor_handle  processor_handle,
uint32_t *  sensor_count,
uint32_t *  sensor_inds,
amdsmi_power_cap_type_t sensor_types 
)

Query the supported power cap sensors and their types for a device.

Platform:

gpu_bm_linux

host

This function returns the list of supported power cap sensors for the given device, including their sensor indices and types (e.g., PPT0, PPT1).

Parameters
[in]processor_handleA processor handle.
[out]sensor_countPointer to a uint32_t that will be set to the number of supported sensors.
[out]sensor_indsPointer to an array of uint32_t to be filled with sensor indices. The array must be allocated by the caller with enough space.
[out]sensor_typesPointer to an array of amdsmi_power_cap_type_t to be filled with sensor types. The array must be allocated by the caller with enough space.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail.

◆ amdsmi_get_cpu_socket_power()

amdsmi_status_t amdsmi_get_cpu_socket_power ( amdsmi_processor_handle  processor_handle,
uint32_t *  ppower 
)

Get the socket power.

Platform:
cpu_bm
Parameters
[in]processor_handleCpu socket which to query
[in,out]ppower- Input buffer to return socket power
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_cpu_socket_power_cap()

amdsmi_status_t amdsmi_get_cpu_socket_power_cap ( amdsmi_processor_handle  processor_handle,
uint32_t *  pcap 
)

Get the socket power cap.

Platform:
cpu_bm
Parameters
[in]processor_handleCpu socket which to query
[in,out]pcap- Input buffer to return power cap.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_cpu_socket_power_cap_max()

amdsmi_status_t amdsmi_get_cpu_socket_power_cap_max ( amdsmi_processor_handle  processor_handle,
uint32_t *  pmax 
)

Get the maximum power cap value for a given socket.

Platform:
cpu_bm
Parameters
[in]processor_handleCpu socket which to query
[in,out]pmax- Input buffer to return maximum power limit value
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_cpu_pwr_svi_telemetry_all_rails()

amdsmi_status_t amdsmi_get_cpu_pwr_svi_telemetry_all_rails ( amdsmi_processor_handle  processor_handle,
uint32_t *  power 
)

Get the SVI based power telemetry for all rails.

Platform:
cpu_bm
Parameters
[in]processor_handleCpu socket which to query
[in,out]power- Input buffer to return svi based power value
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_set_cpu_socket_power_cap()

amdsmi_status_t amdsmi_set_cpu_socket_power_cap ( amdsmi_processor_handle  processor_handle,
uint32_t  pcap 
)

Set the power cap value for a given socket.

Platform:
cpu_bm
Parameters
[in]processor_handleCpu socket which to query
[in]pcap- Input power limit value
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_set_cpu_pwr_efficiency_mode()

amdsmi_status_t amdsmi_set_cpu_pwr_efficiency_mode ( amdsmi_processor_handle  processor_handle,
uint8_t  mode 
)

Set the power efficiency profile policy.

Platform:
cpu_bm
Parameters
[in]processor_handleCpu socket which to query
[in]mode- mode to be set
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail