This is an old version of ROCm documentation. Read the latest ROCm release documentation to stay informed of all our developments.

Physical State Queries

Physical State Queries#

AMD SMI: Physical State Queries
Physical State Queries

Functions

amdsmi_status_t amdsmi_dev_get_fan_rpms (amdsmi_device_handle device_handle, uint32_t sensor_ind, int64_t *speed)
 Get the fan speed in RPMs of the device with the specified device handle and 0-based sensor index. More...
 
amdsmi_status_t amdsmi_dev_get_fan_speed (amdsmi_device_handle device_handle, uint32_t sensor_ind, int64_t *speed)
 Get the fan speed for the specified device as a value relative to AMDSMI_MAX_FAN_SPEED. More...
 
amdsmi_status_t amdsmi_dev_get_fan_speed_max (amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t *max_speed)
 Get the max. fan speed of the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_temp_metric (amdsmi_device_handle device_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature)
 Get the temperature metric value for the specified metric, from the specified temperature sensor on the specified device. More...
 
amdsmi_status_t amdsmi_dev_get_volt_metric (amdsmi_device_handle device_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage)
 Get the voltage metric value for the specified metric, from the specified voltage sensor on the specified device. More...
 

Detailed Description

These functions provide information about the physical characteristics of the device.

Function Documentation

◆ amdsmi_dev_get_fan_rpms()

amdsmi_status_t amdsmi_dev_get_fan_rpms ( amdsmi_device_handle  device_handle,
uint32_t  sensor_ind,
int64_t *  speed 
)

Get the fan speed in RPMs of the device with the specified device handle and 0-based sensor index.

Given a device handle device_handle and a pointer to a uint32_t speed, this function will write the current fan speed in RPMs to the uint32_t pointed to by speed

Parameters
[in]device_handlea device handle
[in]sensor_inda 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]speeda pointer to uint32_t to which the speed will be written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_fan_speed()

amdsmi_status_t amdsmi_dev_get_fan_speed ( amdsmi_device_handle  device_handle,
uint32_t  sensor_ind,
int64_t *  speed 
)

Get the fan speed for the specified device as a value relative to AMDSMI_MAX_FAN_SPEED.

Given a device handle device_handle and a pointer to a uint32_t speed, this function will write the current fan speed (a value between 0 and the maximum fan speed, AMDSMI_MAX_FAN_SPEED) to the uint32_t pointed to by speed

Parameters
[in]device_handlea device handle
[in]sensor_inda 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]speeda pointer to uint32_t to which the speed will be written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_fan_speed_max()

amdsmi_status_t amdsmi_dev_get_fan_speed_max ( amdsmi_device_handle  device_handle,
uint32_t  sensor_ind,
uint64_t *  max_speed 
)

Get the max. fan speed of the device with provided device handle.

Given a device handle device_handle and a pointer to a uint32_t max_speed, this function will write the maximum fan speed possible to the uint32_t pointed to by max_speed

Parameters
[in]device_handlea device handle
[in]sensor_inda 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_speeda pointer to uint32_t to which the maximum speed will be written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_temp_metric()

amdsmi_status_t amdsmi_dev_get_temp_metric ( amdsmi_device_handle  device_handle,
amdsmi_temperature_type_t  sensor_type,
amdsmi_temperature_metric_t  metric,
int64_t *  temperature 
)

Get the temperature metric value for the specified metric, from the specified temperature sensor on the specified device.

Given a device handle device_handle, a sensor type sensor_type, a amdsmi_temperature_metric_t metric and a pointer to an int64_t temperature, this function will write the value of the metric indicated by metric and sensor_type to the memory location temperature.

Parameters
[in]device_handlea device handle
[in]sensor_typepart of device from which temperature should be obtained. This should come from the enum amdsmi_temperature_type_t
[in]metricenum indicated which temperature value should be retrieved
[in,out]temperaturea pointer to int64_t to which the temperature will be written, in millidegrees Celcius. If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_volt_metric()

amdsmi_status_t amdsmi_dev_get_volt_metric ( amdsmi_device_handle  device_handle,
amdsmi_voltage_type_t  sensor_type,
amdsmi_voltage_metric_t  metric,
int64_t *  voltage 
)

Get the voltage metric value for the specified metric, from the specified voltage sensor on the specified device.

Given a device handle device_handle, a sensor type sensor_type, a amdsmi_voltage_metric_t metric and a pointer to an int64_t voltage, this function will write the value of the metric indicated by metric and sensor_type to the memory location voltage.

Parameters
[in]device_handlea device handle
[in]sensor_typepart of device from which voltage should be obtained. This should come from the enum amdsmi_voltage_type_t
[in]metricenum indicated which voltage value should be retrieved
[in,out]voltagea pointer to int64_t to which the voltage will be written, in millivolts. If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail