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

amdsmi.h File Reference

amdsmi.h File Reference#

AMD SMI: amdsmi.h File Reference
amdsmi.h File Reference

AMD System Management Interface API. More...

#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  amdsmi_range_t
 This structure represents a range (e.g., frequencies or voltages). More...
 
struct  amdsmi_xgmi_info_t
 
struct  amdsmi_gpu_caps_t
 
struct  amdsmi_vram_info_t
 
struct  amdsmi_frequency_range_t
 
union  amdsmi_bdf_t
 
struct  amdsmi_power_cap_info_t
 
struct  amdsmi_vbios_info_t
 
struct  amdsmi_fw_info_t
 
struct  amdsmi_asic_info_t
 
struct  amdsmi_board_info_t
 
struct  amdsmi_power_measure_t
 
struct  amdsmi_clk_measure_t
 
struct  amdsmi_engine_usage_t
 
struct  amdsmi_proc_info_t
 
struct  amdsmi_counter_value_t
 
struct  amdsmi_evt_notification_data_t
 
struct  amdsmi_utilization_counter_t
 The utilization counter data. More...
 
struct  amdsmi_retired_page_record_t
 Reserved Memory Page Record. More...
 
struct  amdsmi_power_profile_status_t
 This structure contains information about which power profiles are supported by the system for a given device, and which power profile is currently active. More...
 
struct  amdsmi_frequencies_t
 This structure holds information about clock frequencies. More...
 
struct  amdsmi_pcie_bandwidth_t
 This structure holds information about the possible PCIe bandwidths. Specifically, the possible transfer rates and their associated numbers of lanes are stored here. More...
 
struct  amdsmi_version_t
 This structure holds version information. More...
 
struct  amdsmi_od_vddc_point_t
 This structure represents a point on the frequency-voltage plane. More...
 
struct  amdsmi_freq_volt_region_t
 This structure holds 2 amdsmi_range_t's, one for frequency and one for voltage. These 2 ranges indicate the range of possible values for the corresponding amdsmi_od_vddc_point_t. More...
 
struct  amdsmi_od_volt_curve_t
 
struct  amdsmi_od_volt_freq_data_t
 This structure holds the frequency-voltage values for a device. More...
 
struct  amd_metrics_table_header_t
 The following structures hold the gpu metrics values for a device. More...
 
struct  amdsmi_gpu_metrics_t
 
struct  amdsmi_error_count_t
 This structure holds error counts. More...
 
struct  amdsmi_pcie_info_t
 This structure holds pcie info. More...
 
struct  amdsmi_process_info_t
 This structure contains information specific to a process. More...
 
union  amdsmi_func_id_value_t
 This union holds the value of an amdsmi_func_id_iter_handle_t. The value may be a function name, or an ennumerated variant value of types such as amdsmi_memory_type_t, amdsmi_temperature_metric_t, etc. More...
 

Macros

#define AMDSMI_MAX_MM_IP_COUNT   8
 
#define AMDSMI_MAX_DATE_LENGTH   32
 
#define AMDSMI_MAX_STRING_LENGTH   64
 
#define AMDSMI_NORMAL_STRING_LENGTH   32
 
#define AMDSMI_MAX_DEVICES   32
 
#define AMDSMI_MAX_NAME   32
 
#define AMDSMI_MAX_DRIVER_VERSION_LENGTH   80
 
#define AMDSMI_PRODUCT_NAME_LENGTH   128
 
#define AMDSMI_MAX_CONTAINER_TYPE   2
 
#define AMDSMI_GPU_UUID_SIZE   38
 
#define AMDSMI_TIME_FORMAT   "%02d:%02d:%02d.%03d"
 
#define AMDSMI_DATE_FORMAT   "%04d-%02d-%02d:%02d:%02d:%02d.%03d"
 
#define AMDSMI_LIB_VERSION_YEAR   23
 library versioning More...
 
#define AMDSMI_LIB_VERSION_MAJOR   1
 Major version should be changed for every header change (adding/deleting APIs, changing names, fields of structures, etc.)
 
#define AMDSMI_LIB_VERSION_MINOR   1
 Minor version should be updated for each API change, but without changing headers.
 
#define AMDSMI_LIB_VERSION_RELEASE   0
 Release version should be set to 0 as default and can be updated by the PMs for each CSP point release.
 
#define AMDSMI_LIB_VERSION_CREATE_STRING(YEAR, MAJOR, MINOR, RELEASE)   (#YEAR "." #MAJOR "." #MINOR "." #RELEASE)
 
#define AMDSMI_LIB_VERSION_EXPAND_PARTS(YEAR_STR, MAJOR_STR, MINOR_STR, RELEASE_STR)   AMDSMI_LIB_VERSION_CREATE_STRING(YEAR_STR, MAJOR_STR, MINOR_STR, RELEASE_STR)
 
#define AMDSMI_LIB_VERSION_STRING   AMDSMI_LIB_VERSION_EXPAND_PARTS(AMDSMI_LIB_VERSION_YEAR, AMDSMI_LIB_VERSION_MAJOR, AMDSMI_LIB_VERSION_MINOR, AMDSMI_LIB_VERSION_RELEASE)
 
#define AMDSMI_MAX_NUM_FREQUENCIES   32
 Guaranteed maximum possible number of supported frequencies.
 
#define AMDSMI_MAX_FAN_SPEED   255
 
#define AMDSMI_NUM_VOLTAGE_CURVE_POINTS   3
 The number of points that make up a voltage-frequency curve definition.
 
#define AMDSMI_EVENT_MASK_FROM_INDEX(i)   (1ULL << ((i) - 1))
 
#define MAX_EVENT_NOTIFICATION_MSG_SIZE   64
 Maximum number of characters an event notification message will be.
 
#define AMDSMI_MAX_NUM_POWER_PROFILES   (sizeof(amdsmi_bit_field_t) * 8)
 Number of possible power profiles that a system could support.
 
#define AMDSMI_GPU_METRICS_API_FORMAT_VER   1
 The following structure holds the gpu metrics values for a device.
 
#define AMDSMI_GPU_METRICS_API_CONTENT_VER_1   1
 
#define AMDSMI_GPU_METRICS_API_CONTENT_VER_2   2
 
#define AMDSMI_GPU_METRICS_API_CONTENT_VER_3   3
 
#define AMDSMI_NUM_HBM_INSTANCES   4
 
#define CENTRIGRADE_TO_MILLI_CENTIGRADE   1000
 
#define AMDSMI_DEFAULT_VARIANT   0xFFFFFFFFFFFFFFFF
 

Typedefs

typedef void * amdsmi_device_handle
 opaque handler point to underlying implementation
 
typedef void * amdsmi_socket_handle
 
typedef uint32_t amdsmi_process_handle
 
typedef uintptr_t amdsmi_event_handle_t
 Handle to performance event counter. More...
 
typedef uint64_t amdsmi_bit_field_t
 Bitfield used in various AMDSMI calls.
 
typedef struct amdsmi_func_id_iter_handle * amdsmi_func_id_iter_handle_t
 Opaque handle to function-support object.
 

Enumerations

enum  amdsmi_init_flags_t {
  AMDSMI_INIT_ALL_DEVICES = 0x0 , AMDSMI_INIT_AMD_CPUS = (1 << 0) , AMDSMI_INIT_AMD_GPUS = (1 << 1) , AMDSMI_INIT_NON_AMD_CPUS = (1 << 2) ,
  AMDSMI_INIT_NON_AMD_GPUS = (1 << 3)
}
 Initialization flags. More...
 
enum  amdsmi_mm_ip_t { AMDSMI_MM_UVD , AMDSMI_MM_VCE , AMDSMI_MM_VCN , AMDSMI_MM__MAX }
 
enum  amdsmi_container_types_t { CONTAINER_LXC , CONTAINER_DOCKER }
 
enum  device_type_t {
  UNKNOWN = 0 , AMD_GPU , AMD_CPU , NON_AMD_GPU ,
  NON_AMD_CPU
}
 Device types detectable by AMD SMI.
 
enum  amdsmi_status_t {
  AMDSMI_STATUS_SUCCESS = 0 , AMDSMI_STATUS_INVAL = 1 , AMDSMI_STATUS_NOT_SUPPORTED = 2 , AMDSMI_STATUS_NOT_YET_IMPLEMENTED = 3 ,
  AMDSMI_STATUS_FAIL_LOAD_MODULE = 4 , AMDSMI_STATUS_FAIL_LOAD_SYMBOL = 5 , AMDSMI_STATUS_DRM_ERROR = 6 , AMDSMI_STATUS_API_FAILED = 7 ,
  AMDSMI_STATUS_TIMEOUT = 8 , AMDSMI_STATUS_RETRY = 9 , AMDSMI_STATUS_NO_PERM = 10 , AMDSMI_STATUS_INTERRUPT = 11 ,
  AMDSMI_STATUS_IO = 12 , AMDSMI_STATUS_ADDRESS_FAULT = 13 , AMDSMI_STATUS_FILE_ERROR = 14 , AMDSMI_STATUS_OUT_OF_RESOURCES = 15 ,
  AMDSMI_STATUS_INTERNAL_EXCEPTION = 16 , AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS = 17 , AMDSMI_STATUS_INIT_ERROR = 18 , AMDSMI_STATUS_REFCOUNT_OVERFLOW = 19 ,
  AMDSMI_STATUS_BUSY = 30 , AMDSMI_STATUS_NOT_FOUND = 31 , AMDSMI_STATUS_NOT_INIT = 32 , AMDSMI_STATUS_NO_SLOT = 33 ,
  AMDSMI_STATUS_NO_DATA = 40 , AMDSMI_STATUS_INSUFFICIENT_SIZE = 41 , AMDSMI_STATUS_UNEXPECTED_SIZE = 42 , AMDSMI_STATUS_UNEXPECTED_DATA = 43 ,
  AMDSMI_STATUS_MAP_ERROR = 0xFFFFFFFE , AMDSMI_STATUS_UNKNOWN_ERROR = 0xFFFFFFFF
}
 Error codes returned by amdsmi functions. More...
 
enum  amdsmi_clk_type_t {
  CLK_TYPE_SYS = 0x0 , CLK_TYPE_FIRST = CLK_TYPE_SYS , CLK_TYPE_GFX = CLK_TYPE_SYS , CLK_TYPE_DF ,
  CLK_TYPE_DCEF , CLK_TYPE_SOC , CLK_TYPE_MEM , CLK_TYPE_PCIE ,
  CLK_TYPE_VCLK0 , CLK_TYPE_VCLK1 , CLK_TYPE_DCLK0 , CLK_TYPE_DCLK1 ,
  CLK_TYPE__MAX = CLK_TYPE_DCLK1
}
 
enum  amdsmi_temperature_type_t {
  TEMPERATURE_TYPE_EDGE , TEMPERATURE_TYPE_FIRST = TEMPERATURE_TYPE_EDGE , TEMPERATURE_TYPE_JUNCTION , TEMPERATURE_TYPE_VRAM ,
  TEMPERATURE_TYPE_HBM_0 , TEMPERATURE_TYPE_HBM_1 , TEMPERATURE_TYPE_HBM_2 , TEMPERATURE_TYPE_HBM_3 ,
  TEMPERATURE_TYPE_PLX , TEMPERATURE_TYPE__MAX = TEMPERATURE_TYPE_PLX
}
 This enumeration is used to indicate from which part of the device a temperature reading should be obtained.
 
enum  amdsmi_fw_block_t {
  FW_ID_SMU = 1 , FW_ID_FIRST = FW_ID_SMU , FW_ID_CP_CE , FW_ID_CP_PFP ,
  FW_ID_CP_ME , FW_ID_CP_MEC_JT1 , FW_ID_CP_MEC_JT2 , FW_ID_CP_MEC1 ,
  FW_ID_CP_MEC2 , FW_ID_RLC , FW_ID_SDMA0 , FW_ID_SDMA1 ,
  FW_ID_SDMA2 , FW_ID_SDMA3 , FW_ID_SDMA4 , FW_ID_SDMA5 ,
  FW_ID_SDMA6 , FW_ID_SDMA7 , FW_ID_VCN , FW_ID_UVD ,
  FW_ID_VCE , FW_ID_ISP , FW_ID_DMCU_ERAM , FW_ID_DMCU_ISR ,
  FW_ID_RLC_RESTORE_LIST_GPM_MEM , FW_ID_RLC_RESTORE_LIST_SRM_MEM , FW_ID_RLC_RESTORE_LIST_CNTL , FW_ID_RLC_V ,
  FW_ID_MMSCH , FW_ID_PSP_SYSDRV , FW_ID_PSP_SOSDRV , FW_ID_PSP_TOC ,
  FW_ID_PSP_KEYDB , FW_ID_DFC , FW_ID_PSP_SPL , FW_ID_DRV_CAP ,
  FW_ID_MC , FW_ID_PSP_BL , FW_ID_CP_PM4 , FW_ID_ASD ,
  FW_ID_TA_RAS , FW_ID_XGMI , FW_ID_RLC_SRLG , FW_ID_RLC_SRLS ,
  FW_ID_SMC , FW_ID_DMCU , FW_ID__MAX
}
 The values of this enum are used to identify the various firmware blocks.
 
enum  amdsmi_dev_perf_level_t {
  AMDSMI_DEV_PERF_LEVEL_AUTO = 0 , AMDSMI_DEV_PERF_LEVEL_FIRST = AMDSMI_DEV_PERF_LEVEL_AUTO , AMDSMI_DEV_PERF_LEVEL_LOW , AMDSMI_DEV_PERF_LEVEL_HIGH ,
  AMDSMI_DEV_PERF_LEVEL_MANUAL , AMDSMI_DEV_PERF_LEVEL_STABLE_STD , AMDSMI_DEV_PERF_LEVEL_STABLE_PEAK , AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK ,
  AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK , AMDSMI_DEV_PERF_LEVEL_DETERMINISM , AMDSMI_DEV_PERF_LEVEL_LAST = AMDSMI_DEV_PERF_LEVEL_DETERMINISM , AMDSMI_DEV_PERF_LEVEL_UNKNOWN = 0x100
}
 PowerPlay performance levels. More...
 
enum  amdsmi_sw_component_t { AMDSMI_SW_COMP_FIRST = 0x0 , AMDSMI_SW_COMP_DRIVER = AMDSMI_SW_COMP_FIRST , AMDSMI_SW_COMP_LAST = AMDSMI_SW_COMP_DRIVER }
 Available clock types. More...
 
enum  amdsmi_event_group_t { AMDSMI_EVNT_GRP_XGMI = 0 , AMDSMI_EVNT_GRP_XGMI_DATA_OUT = 10 , AMDSMI_EVNT_GRP_INVALID = 0xFFFFFFFF }
 Enum denoting an event group. The value of the enum is the base value for all the event enums in the group. More...
 
enum  amdsmi_event_type_t {
  AMDSMI_EVNT_FIRST = AMDSMI_EVNT_GRP_XGMI , AMDSMI_EVNT_XGMI_FIRST = AMDSMI_EVNT_GRP_XGMI , AMDSMI_EVNT_XGMI_0_NOP_TX = AMDSMI_EVNT_XGMI_FIRST , AMDSMI_EVNT_XGMI_0_REQUEST_TX ,
  AMDSMI_EVNT_XGMI_0_RESPONSE_TX , AMDSMI_EVNT_XGMI_0_BEATS_TX , AMDSMI_EVNT_XGMI_1_NOP_TX , AMDSMI_EVNT_XGMI_1_REQUEST_TX ,
  AMDSMI_EVNT_XGMI_1_RESPONSE_TX , AMDSMI_EVNT_XGMI_1_BEATS_TX , AMDSMI_EVNT_XGMI_LAST = AMDSMI_EVNT_XGMI_1_BEATS_TX , AMDSMI_EVNT_XGMI_DATA_OUT_FIRST = AMDSMI_EVNT_GRP_XGMI_DATA_OUT ,
  AMDSMI_EVNT_XGMI_DATA_OUT_0 = AMDSMI_EVNT_XGMI_DATA_OUT_FIRST , AMDSMI_EVNT_XGMI_DATA_OUT_1 , AMDSMI_EVNT_XGMI_DATA_OUT_2 , AMDSMI_EVNT_XGMI_DATA_OUT_3 ,
  AMDSMI_EVNT_XGMI_DATA_OUT_4 , AMDSMI_EVNT_XGMI_DATA_OUT_5 , AMDSMI_EVNT_XGMI_DATA_OUT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_5 , AMDSMI_EVNT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_LAST
}
 Event type enum. Events belonging to a particular event group amdsmi_event_group_t should begin enumerating at the amdsmi_event_group_t value for that group. More...
 
enum  amdsmi_counter_command_t { AMDSMI_CNTR_CMD_START = 0 , AMDSMI_CNTR_CMD_STOP }
 
enum  amdsmi_evt_notification_type_t {
  AMDSMI_EVT_NOTIF_VMFAULT = 1 , AMDSMI_EVT_NOTIF_FIRST = AMDSMI_EVT_NOTIF_VMFAULT , AMDSMI_EVT_NOTIF_THERMAL_THROTTLE = 2 , AMDSMI_EVT_NOTIF_GPU_PRE_RESET = 3 ,
  AMDSMI_EVT_NOTIF_GPU_POST_RESET = 4 , AMDSMI_EVT_NOTIF_LAST = AMDSMI_EVT_NOTIF_GPU_POST_RESET
}
 
enum  amdsmi_temperature_metric_t {
  AMDSMI_TEMP_CURRENT = 0x0 , AMDSMI_TEMP_FIRST = AMDSMI_TEMP_CURRENT , AMDSMI_TEMP_MAX , AMDSMI_TEMP_MIN ,
  AMDSMI_TEMP_MAX_HYST , AMDSMI_TEMP_MIN_HYST , AMDSMI_TEMP_CRITICAL , AMDSMI_TEMP_CRITICAL_HYST ,
  AMDSMI_TEMP_EMERGENCY , AMDSMI_TEMP_EMERGENCY_HYST , AMDSMI_TEMP_CRIT_MIN , AMDSMI_TEMP_CRIT_MIN_HYST ,
  AMDSMI_TEMP_OFFSET , AMDSMI_TEMP_LOWEST , AMDSMI_TEMP_HIGHEST , AMDSMI_TEMP_LAST = AMDSMI_TEMP_HIGHEST
}
 Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values will be in millidegress Celcius. More...
 
enum  amdsmi_voltage_metric_t {
  AMDSMI_VOLT_CURRENT = 0x0 , AMDSMI_VOLT_FIRST = AMDSMI_VOLT_CURRENT , AMDSMI_VOLT_MAX , AMDSMI_VOLT_MIN_CRIT ,
  AMDSMI_VOLT_MIN , AMDSMI_VOLT_MAX_CRIT , AMDSMI_VOLT_AVERAGE , AMDSMI_VOLT_LOWEST ,
  AMDSMI_VOLT_HIGHEST , AMDSMI_VOLT_LAST = AMDSMI_VOLT_HIGHEST
}
 Voltage Metrics. This enum is used to identify various Volatge metrics. Corresponding values will be in millivolt. More...
 
enum  amdsmi_voltage_type_t { AMDSMI_VOLT_TYPE_FIRST = 0 , AMDSMI_VOLT_TYPE_VDDGFX = AMDSMI_VOLT_TYPE_FIRST , AMDSMI_VOLT_TYPE_LAST = AMDSMI_VOLT_TYPE_VDDGFX , AMDSMI_VOLT_TYPE_INVALID = 0xFFFFFFFF }
 This ennumeration is used to indicate which type of voltage reading should be obtained. More...
 
enum  amdsmi_power_profile_preset_masks_t {
  AMDSMI_PWR_PROF_PRST_CUSTOM_MASK = 0x1 , AMDSMI_PWR_PROF_PRST_VIDEO_MASK = 0x2 , AMDSMI_PWR_PROF_PRST_POWER_SAVING_MASK = 0x4 , AMDSMI_PWR_PROF_PRST_COMPUTE_MASK = 0x8 ,
  AMDSMI_PWR_PROF_PRST_VR_MASK = 0x10 , AMDSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK = 0x20 , AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT = 0x40 , AMDSMI_PWR_PROF_PRST_LAST = AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT ,
  AMDSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF
}
 Pre-set Profile Selections. These bitmasks can be AND'd with the amdsmi_power_profile_status_t.available_profiles returned from :: amdsmi_dev_get_power_profile_presets to determine which power profiles are supported by the system. More...
 
enum  amdsmi_gpu_block_t {
  AMDSMI_GPU_BLOCK_INVALID = 0x0000000000000000 , AMDSMI_GPU_BLOCK_FIRST = 0x0000000000000001 , AMDSMI_GPU_BLOCK_UMC = AMDSMI_GPU_BLOCK_FIRST , AMDSMI_GPU_BLOCK_SDMA = 0x0000000000000002 ,
  AMDSMI_GPU_BLOCK_GFX = 0x0000000000000004 , AMDSMI_GPU_BLOCK_MMHUB = 0x0000000000000008 , AMDSMI_GPU_BLOCK_ATHUB = 0x0000000000000010 , AMDSMI_GPU_BLOCK_PCIE_BIF = 0x0000000000000020 ,
  AMDSMI_GPU_BLOCK_HDP = 0x0000000000000040 , AMDSMI_GPU_BLOCK_XGMI_WAFL = 0x0000000000000080 , AMDSMI_GPU_BLOCK_DF = 0x0000000000000100 , AMDSMI_GPU_BLOCK_SMN = 0x0000000000000200 ,
  AMDSMI_GPU_BLOCK_SEM = 0x0000000000000400 , AMDSMI_GPU_BLOCK_MP0 = 0x0000000000000800 , AMDSMI_GPU_BLOCK_MP1 = 0x0000000000001000 , AMDSMI_GPU_BLOCK_FUSE = 0x0000000000002000 ,
  AMDSMI_GPU_BLOCK_LAST = AMDSMI_GPU_BLOCK_FUSE , AMDSMI_GPU_BLOCK_RESERVED = 0x8000000000000000
}
 This enum is used to identify different GPU blocks. More...
 
enum  amdsmi_ras_err_state_t {
  AMDSMI_RAS_ERR_STATE_NONE = 0 , AMDSMI_RAS_ERR_STATE_DISABLED , AMDSMI_RAS_ERR_STATE_PARITY , AMDSMI_RAS_ERR_STATE_SING_C ,
  AMDSMI_RAS_ERR_STATE_MULT_UC , AMDSMI_RAS_ERR_STATE_POISON , AMDSMI_RAS_ERR_STATE_ENABLED , AMDSMI_RAS_ERR_STATE_LAST = AMDSMI_RAS_ERR_STATE_ENABLED ,
  AMDSMI_RAS_ERR_STATE_INVALID = 0xFFFFFFFF
}
 The current ECC state. More...
 
enum  amdsmi_memory_type_t {
  AMDSMI_MEM_TYPE_FIRST = 0 , AMDSMI_MEM_TYPE_VRAM = AMDSMI_MEM_TYPE_FIRST , AMDSMI_MEM_TYPE_VIS_VRAM , AMDSMI_MEM_TYPE_GTT ,
  AMDSMI_MEM_TYPE_LAST = AMDSMI_MEM_TYPE_GTT
}
 Types of memory. More...
 
enum  amdsmi_freq_ind_t { AMDSMI_FREQ_IND_MIN = 0 , AMDSMI_FREQ_IND_MAX = 1 , AMDSMI_FREQ_IND_INVALID = 0xFFFFFFFF }
 The values of this enum are used as frequency identifiers. More...
 
enum  amdsmi_xgmi_status_t { AMDSMI_XGMI_STATUS_NO_ERRORS = 0 , AMDSMI_XGMI_STATUS_ERROR , AMDSMI_XGMI_STATUS_MULTIPLE_ERRORS }
 XGMI Status.
 
enum  amdsmi_memory_page_status_t { AMDSMI_MEM_PAGE_STATUS_RESERVED = 0 , AMDSMI_MEM_PAGE_STATUS_PENDING , AMDSMI_MEM_PAGE_STATUS_UNRESERVABLE }
 Reserved Memory Page States. More...
 
enum  AMDSMI_IO_LINK_TYPE {
  AMDSMI_IOLINK_TYPE_UNDEFINED = 0 , AMDSMI_IOLINK_TYPE_PCIEXPRESS = 1 , AMDSMI_IOLINK_TYPE_XGMI = 2 , AMDSMI_IOLINK_TYPE_NUMIOLINKTYPES ,
  AMDSMI_IOLINK_TYPE_SIZE = 0xFFFFFFFF
}
 Types for IO Link. More...
 
enum  AMDSMI_UTILIZATION_COUNTER_TYPE { AMDSMI_UTILIZATION_COUNTER_FIRST = 0 , AMDSMI_COARSE_GRAIN_GFX_ACTIVITY = AMDSMI_UTILIZATION_COUNTER_FIRST , AMDSMI_COARSE_GRAIN_MEM_ACTIVITY , AMDSMI_UTILIZATION_COUNTER_LAST = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY }
 The utilization counter type. More...
 

Functions

amdsmi_status_t amdsmi_init (uint64_t init_flags)
 Initialize the AMD SMI library. More...
 
amdsmi_status_t amdsmi_shut_down (void)
 Shutdown the AMD SMI library. More...
 
amdsmi_status_t amdsmi_get_socket_handles (uint32_t *socket_count, amdsmi_socket_handle *socket_handles)
 Get the list of socket handles in the system. More...
 
amdsmi_status_t amdsmi_get_socket_info (amdsmi_socket_handle socket_handle, char *name, size_t len)
 Get information about the given socket. More...
 
amdsmi_status_t amdsmi_get_device_handles (amdsmi_socket_handle socket_handle, uint32_t *device_count, amdsmi_device_handle *device_handles)
 Get the list of the device handles associated to a socket. More...
 
amdsmi_status_t amdsmi_get_device_type (amdsmi_device_handle device_handle, device_type_t *device_type)
 Get the device type of the device_handle. More...
 
amdsmi_status_t amdsmi_get_device_handle_from_bdf (amdsmi_bdf_t bdf, amdsmi_device_handle *device_handle)
 Get device handle with the matching bdf. More...
 
amdsmi_status_t amdsmi_dev_get_id (amdsmi_device_handle device_handle, uint16_t *id)
 Get the device id associated with the device with provided device handler. More...
 
amdsmi_status_t amdsmi_dev_get_vendor_name (amdsmi_device_handle device_handle, char *name, size_t len)
 Get the name string for a give vendor ID. More...
 
amdsmi_status_t amdsmi_dev_get_vram_vendor (amdsmi_device_handle device_handle, char *brand, uint32_t len)
 Get the vram vendor string of a device. More...
 
amdsmi_status_t amdsmi_dev_get_subsystem_id (amdsmi_device_handle device_handle, uint16_t *id)
 Get the subsystem device id associated with the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_subsystem_name (amdsmi_device_handle device_handle, char *name, size_t len)
 Get the name string for the device subsytem. More...
 
amdsmi_status_t amdsmi_dev_get_drm_render_minor (amdsmi_device_handle device_handle, uint32_t *minor)
 Get the drm minor number associated with this device. More...
 
amdsmi_status_t amdsmi_dev_get_pci_bandwidth (amdsmi_device_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth)
 Get the list of possible PCIe bandwidths that are available. More...
 
amdsmi_status_t amdsmi_dev_get_pci_id (amdsmi_device_handle device_handle, uint64_t *bdfid)
 Get the unique PCI device identifier associated for a device. More...
 
amdsmi_status_t amdsmi_topo_get_numa_affinity (amdsmi_device_handle device_handle, uint32_t *numa_node)
 Get the NUMA node associated with a device. More...
 
amdsmi_status_t amdsmi_dev_get_pci_throughput (amdsmi_device_handle device_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz)
 Get PCIe traffic information. More...
 
amdsmi_status_t amdsmi_dev_get_pci_replay_counter (amdsmi_device_handle device_handle, uint64_t *counter)
 Get PCIe replay counter. More...
 
amdsmi_status_t amdsmi_dev_set_pci_bandwidth (amdsmi_device_handle device_handle, uint64_t bw_bitmask)
 Control the set of allowed PCIe bandwidths that can be used. More...
 
amdsmi_status_t amdsmi_dev_get_power_ave (amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t *power)
 Get the average power consumption of a device. More...
 
amdsmi_status_t amdsmi_dev_get_energy_count (amdsmi_device_handle device_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp)
 Get the energy accumulator counter of the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_set_power_cap (amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t cap)
 Set the maximum gpu power cap value. More...
 
amdsmi_status_t amdsmi_dev_set_power_profile (amdsmi_device_handle device_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile)
 Set the power performance profile. More...
 
amdsmi_status_t amdsmi_dev_get_memory_total (amdsmi_device_handle device_handle, amdsmi_memory_type_t mem_type, uint64_t *total)
 Get the total amount of memory that exists. More...
 
amdsmi_status_t amdsmi_dev_get_memory_usage (amdsmi_device_handle device_handle, amdsmi_memory_type_t mem_type, uint64_t *used)
 Get the current memory usage. More...
 
amdsmi_status_t amdsmi_get_bad_page_info (amdsmi_device_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info)
 The first call to this API returns the number of bad pages which should be used to allocate the buffer that should contain the bad page records. More...
 
amdsmi_status_t amdsmi_get_ras_block_features_enabled (amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state)
 Returns if RAS features are enabled or disabled for given block. More...
 
amdsmi_status_t amdsmi_dev_get_memory_busy_percent (amdsmi_device_handle device_handle, uint32_t *busy_percent)
 Get percentage of time any device memory is being used. More...
 
amdsmi_status_t amdsmi_dev_get_memory_reserved_pages (amdsmi_device_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records)
 Get information about reserved ("retired") memory pages. More...
 
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...
 
amdsmi_status_t amdsmi_dev_reset_fan (amdsmi_device_handle device_handle, uint32_t sensor_ind)
 Reset the fan to automatic driver control. More...
 
amdsmi_status_t amdsmi_dev_set_fan_speed (amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t speed)
 Set the fan speed for the specified device with the provided speed, in RPMs. More...
 
amdsmi_status_t amdsmi_dev_get_busy_percent (amdsmi_device_handle device_handle, uint32_t *busy_percent)
 Get percentage of time device is busy doing any processing. More...
 
amdsmi_status_t amdsmi_get_utilization_count (amdsmi_device_handle device_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp)
 Get coarse grain utilization counter of the specified device. More...
 
amdsmi_status_t amdsmi_get_pcie_link_status (amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info)
 Get current PCIE info of the device with provided device handle. More...
 
amdsmi_status_t amdsmi_get_pcie_link_caps (amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info)
 Get max PCIe capabilities of the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_perf_level (amdsmi_device_handle device_handle, amdsmi_dev_perf_level_t *perf)
 Get the performance level of the device. More...
 
amdsmi_status_t amdsmi_set_perf_determinism_mode (amdsmi_device_handle device_handle, uint64_t clkvalue)
 Enter performance determinism mode with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_overdrive_level (amdsmi_device_handle device_handle, uint32_t *od)
 Get the overdrive percent associated with the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_gpu_clk_freq (amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f)
 Get the list of possible system clock speeds of device for a specified clock type. More...
 
amdsmi_status_t amdsmi_dev_reset_gpu (amdsmi_device_handle device_handle)
 Reset the gpu associated with the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_od_volt_info (amdsmi_device_handle device_handle, amdsmi_od_volt_freq_data_t *odv)
 This function retrieves the voltage/frequency curve information. More...
 
amdsmi_status_t amdsmi_dev_get_gpu_metrics_info (amdsmi_device_handle device_handle, amdsmi_gpu_metrics_t *pgpu_metrics)
 This function retrieves the gpu metrics information. More...
 
amdsmi_status_t amdsmi_dev_set_clk_range (amdsmi_device_handle device_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType)
 This function sets the clock range information. More...
 
amdsmi_status_t amdsmi_dev_set_od_clk_info (amdsmi_device_handle device_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType)
 This function sets the clock frequency information. More...
 
amdsmi_status_t amdsmi_dev_set_od_volt_info (amdsmi_device_handle device_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue)
 This function sets 1 of the 3 voltage curve points. More...
 
amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions (amdsmi_device_handle device_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer)
 This function will retrieve the current valid regions in the frequency/voltage space. More...
 
amdsmi_status_t amdsmi_dev_get_power_profile_presets (amdsmi_device_handle device_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status)
 Get the list of available preset power profiles and an indication of which profile is currently active. More...
 
amdsmi_status_t amdsmi_dev_set_perf_level (amdsmi_device_handle device_handle, amdsmi_dev_perf_level_t perf_lvl)
 Set the PowerPlay performance level associated with the device with provided device handle with the provided value. More...
 
amdsmi_status_t amdsmi_dev_set_perf_level_v1 (amdsmi_device_handle device_handle, amdsmi_dev_perf_level_t perf_lvl)
 Set the PowerPlay performance level associated with the device with provided device handle with the provided value. More...
 
amdsmi_status_t amdsmi_dev_set_overdrive_level (amdsmi_device_handle device_handle, uint32_t od)
 Set the overdrive percent associated with the device with provided device handle with the provided value. See details for WARNING. More...
 
amdsmi_status_t amdsmi_dev_set_overdrive_level_v1 (amdsmi_device_handle device_handle, uint32_t od)
 Set the overdrive percent associated with the device with provided device handle with the provided value. See details for WARNING. More...
 
amdsmi_status_t amdsmi_dev_set_clk_freq (amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask)
 Control the set of allowed frequencies that can be used for the specified clock. More...
 
amdsmi_status_t amdsmi_get_version (amdsmi_version_t *version)
 Get the build version information for the currently running build of AMDSMI. More...
 
amdsmi_status_t amdsmi_get_version_str (amdsmi_sw_component_t component, char *ver_str, uint32_t len)
 Get the driver version string for the current system. More...
 
amdsmi_status_t amdsmi_dev_get_ecc_count (amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec)
 Retrieve the error counts for a GPU block. More...
 
amdsmi_status_t amdsmi_dev_get_ecc_enabled (amdsmi_device_handle device_handle, uint64_t *enabled_blocks)
 Retrieve the enabled ECC bit-mask. More...
 
amdsmi_status_t amdsmi_dev_get_ecc_status (amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state)
 Retrieve the ECC status for a GPU block. More...
 
amdsmi_status_t amdsmi_status_string (amdsmi_status_t status, const char **status_string)
 Get a description of a provided AMDSMI error status. More...
 
amdsmi_status_t amdsmi_dev_counter_group_supported (amdsmi_device_handle device_handle, amdsmi_event_group_t group)
 Tell if an event group is supported by a given device. More...
 
amdsmi_status_t amdsmi_dev_create_counter (amdsmi_device_handle device_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle)
 Create a performance counter object. More...
 
amdsmi_status_t amdsmi_dev_destroy_counter (amdsmi_event_handle_t evnt_handle)
 Deallocate a performance counter object. More...
 
amdsmi_status_t amdsmi_control_counter (amdsmi_event_handle_t evt_handle, amdsmi_counter_command_t cmd, void *cmd_args)
 Issue performance counter control commands. More...
 
amdsmi_status_t amdsmi_read_counter (amdsmi_event_handle_t evt_handle, amdsmi_counter_value_t *value)
 Read the current value of a performance counter. More...
 
amdsmi_status_t amdsmi_counter_get_available_counters (amdsmi_device_handle device_handle, amdsmi_event_group_t grp, uint32_t *available)
 Get the number of currently available counters. More...
 
amdsmi_status_t amdsmi_get_compute_process_info (amdsmi_process_info_t *procs, uint32_t *num_items)
 Get process information about processes currently using GPU. More...
 
amdsmi_status_t amdsmi_get_compute_process_info_by_pid (uint32_t pid, amdsmi_process_info_t *proc)
 Get process information about a specific process. More...
 
amdsmi_status_t amdsmi_get_compute_process_gpus (uint32_t pid, uint32_t *dv_indices, uint32_t *num_devices)
 Get the device indices currently being used by a process. More...
 
amdsmi_status_t amdsmi_dev_xgmi_error_status (amdsmi_device_handle device_handle, amdsmi_xgmi_status_t *status)
 Retrieve the XGMI error status for a device. More...
 
amdsmi_status_t amdsmi_dev_reset_xgmi_error (amdsmi_device_handle device_handle)
 Reset the XGMI error status for a device. More...
 
amdsmi_status_t amdsmi_topo_get_numa_node_number (amdsmi_device_handle device_handle, uint32_t *numa_node)
 Retrieve the NUMA CPU node number for a device. More...
 
amdsmi_status_t amdsmi_topo_get_link_weight (amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, uint64_t *weight)
 Retrieve the weight for a connection between 2 GPUs. More...
 
amdsmi_status_t amdsmi_get_minmax_bandwidth (amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth)
 Retreive minimal and maximal io link bandwidth between 2 GPUs. More...
 
amdsmi_status_t amdsmi_topo_get_link_type (amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type)
 Retrieve the hops and the connection type between 2 GPUs. More...
 
amdsmi_status_t amdsmi_is_P2P_accessible (amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, bool *accessible)
 Return P2P availability status between 2 GPUs. More...
 
amdsmi_status_t amdsmi_dev_open_supported_func_iterator (amdsmi_device_handle device_handle, amdsmi_func_id_iter_handle_t *handle)
 Get a function name iterator of supported AMDSMI functions for a device. More...
 
amdsmi_status_t amdsmi_dev_open_supported_variant_iterator (amdsmi_func_id_iter_handle_t obj_h, amdsmi_func_id_iter_handle_t *var_iter)
 Get a variant iterator for a given handle. More...
 
amdsmi_status_t amdsmi_next_func_iter (amdsmi_func_id_iter_handle_t handle)
 Advance a function identifer iterator. More...
 
amdsmi_status_t amdsmi_dev_close_supported_func_iterator (amdsmi_func_id_iter_handle_t *handle)
 Close a variant iterator handle. More...
 
amdsmi_status_t amdsmi_get_func_iter_value (amdsmi_func_id_iter_handle_t handle, amdsmi_func_id_value_t *value)
 Get the value associated with a function/variant iterator. More...
 
amdsmi_status_t amdsmi_init_event_notification (amdsmi_device_handle device_handle)
 Prepare to collect event notifications for a GPU. More...
 
amdsmi_status_t amdsmi_set_event_notification_mask (amdsmi_device_handle device_handle, uint64_t mask)
 Specify which events to collect for a device. More...
 
amdsmi_status_t amdsmi_get_event_notification (int timeout_ms, uint32_t *num_elem, amdsmi_evt_notification_data_t *data)
 Collect event notifications, waiting a specified amount of time. More...
 
amdsmi_status_t amdsmi_stop_event_notification (amdsmi_device_handle device_handle)
 Close any file handles and free any resources used by event notification for a GPU. More...
 
amdsmi_status_t amdsmi_get_device_bdf (amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf)
 Returns BDF of the given device. More...
 
amdsmi_status_t amdsmi_get_device_uuid (amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid)
 Returns the UUID of the device. More...
 
amdsmi_status_t amdsmi_get_driver_version (amdsmi_device_handle device_handle, int *length, char *version)
 Returns the driver version information. More...
 
amdsmi_status_t amdsmi_get_asic_info (amdsmi_device_handle device_handle, amdsmi_asic_info_t *info)
 Returns the ASIC information for the device. More...
 
amdsmi_status_t amdsmi_get_board_info (amdsmi_device_handle device_handle, amdsmi_board_info_t *info)
 Returns the board part number and board information for the requested device. More...
 
amdsmi_status_t amdsmi_get_power_cap_info (amdsmi_device_handle device_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info)
 Returns the power caps as currently configured in the system. More...
 
amdsmi_status_t amdsmi_get_xgmi_info (amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *info)
 Returns XGMI information for the GPU. More...
 
amdsmi_status_t amdsmi_get_caps_info (amdsmi_device_handle device_handle, amdsmi_gpu_caps_t *info)
 Returns the device capabilities as currently configured in the system. More...
 
amdsmi_status_t amdsmi_get_fw_info (amdsmi_device_handle device_handle, amdsmi_fw_info_t *info)
 Returns the firmware versions running on the device. More...
 
amdsmi_status_t amdsmi_get_vbios_info (amdsmi_device_handle device_handle, amdsmi_vbios_info_t *info)
 Returns the static information for the vBIOS on the device. More...
 
amdsmi_status_t amdsmi_get_gpu_activity (amdsmi_device_handle device_handle, amdsmi_engine_usage_t *info)
 Returns the current usage of the GPU engines (GFX, MM and MEM). Each usage is reported as a percentage from 0-100%. More...
 
amdsmi_status_t amdsmi_get_power_measure (amdsmi_device_handle device_handle, amdsmi_power_measure_t *info)
 Returns the current power and voltage of the GPU. The voltage is in units of mV and the power in units of W. More...
 
amdsmi_status_t amdsmi_get_clock_measure (amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info)
 Returns the measurements of the clocks in the GPU for the GFX and multimedia engines and Memory. This call reports the averages over 1s in MHz. More...
 
amdsmi_status_t amdsmi_get_vram_usage (amdsmi_device_handle device_handle, amdsmi_vram_info_t *info)
 Returns the VRAM usage (both total and used memory) in MegaBytes. More...
 
amdsmi_status_t amdsmi_get_target_frequency_range (amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range)
 Returns current and supported frequency range for the specified clock type. More...
 
amdsmi_status_t amdsmi_get_process_list (amdsmi_device_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes)
 Returns the list of processes running on a given GPU including itself. More...
 
amdsmi_status_t amdsmi_get_process_info (amdsmi_device_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info)
 Returns the process information of a given process. Engine usage show how much time the process spend using these engines in ns. More...
 
amdsmi_status_t amdsmi_get_ecc_error_count (amdsmi_device_handle device_handle, amdsmi_error_count_t *ec)
 Returns the number of ECC errors (correctable and uncorrectable) in the given GPU. More...
 

Detailed Description

AMD System Management Interface API.

Macro Definition Documentation

◆ AMDSMI_MAX_DATE_LENGTH

#define AMDSMI_MAX_DATE_LENGTH   32

YYYY-MM-DD:HH:MM:SS.MSC

◆ AMDSMI_LIB_VERSION_YEAR

#define AMDSMI_LIB_VERSION_YEAR   23

library versioning

Year should follow the IP driver package version: 22.40/23.10 and similar

◆ AMDSMI_MAX_FAN_SPEED

#define AMDSMI_MAX_FAN_SPEED   255

Maximum possible value for fan speed. Should be used as the denominator when determining fan speed percentage.

◆ AMDSMI_EVENT_MASK_FROM_INDEX

#define AMDSMI_EVENT_MASK_FROM_INDEX (   i)    (1ULL << ((i) - 1))

Macro to generate event bitmask from event id

◆ AMDSMI_DEFAULT_VARIANT

#define AMDSMI_DEFAULT_VARIANT   0xFFFFFFFFFFFFFFFF

Place-holder "variant" for functions that have don't have any variants, but do have monitors or sensors.

Typedef Documentation

◆ amdsmi_event_handle_t

typedef uintptr_t amdsmi_event_handle_t

Handle to performance event counter.

Event counter types

Enumeration Type Documentation

◆ amdsmi_init_flags_t

Initialization flags.

Initialization flags may be OR'd together and passed to amdsmi_init().

◆ amdsmi_status_t

Error codes returned by amdsmi functions.

Enumerator
AMDSMI_STATUS_SUCCESS 

Call succeeded.

AMDSMI_STATUS_INVAL 

Invalid parameters.

AMDSMI_STATUS_NOT_SUPPORTED 

Command not supported.

AMDSMI_STATUS_NOT_YET_IMPLEMENTED 

Not implemented yet.

AMDSMI_STATUS_FAIL_LOAD_MODULE 

Fail to load lib.

AMDSMI_STATUS_FAIL_LOAD_SYMBOL 

Fail to load symbol.

AMDSMI_STATUS_DRM_ERROR 

Error when call libdrm.

AMDSMI_STATUS_API_FAILED 

API call failed.

AMDSMI_STATUS_TIMEOUT 

Timeout in API call.

AMDSMI_STATUS_RETRY 

Retry operation.

AMDSMI_STATUS_NO_PERM 

Permission Denied.

AMDSMI_STATUS_INTERRUPT 

An interrupt occurred during execution of function.

AMDSMI_STATUS_IO 

I/O Error.

AMDSMI_STATUS_ADDRESS_FAULT 

Bad address.

AMDSMI_STATUS_FILE_ERROR 

Problem accessing a file.

AMDSMI_STATUS_OUT_OF_RESOURCES 

Not enough memory.

AMDSMI_STATUS_INTERNAL_EXCEPTION 

An internal exception was caught.

AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS 

The provided input is out of allowable or safe range.

AMDSMI_STATUS_INIT_ERROR 

An error occurred when initializing internal data structures.

AMDSMI_STATUS_REFCOUNT_OVERFLOW 

An internal reference counter exceeded INT32_MAX.

AMDSMI_STATUS_BUSY 

Device busy.

AMDSMI_STATUS_NOT_FOUND 

Device Not found.

AMDSMI_STATUS_NOT_INIT 

Device not initialized.

AMDSMI_STATUS_NO_SLOT 

No more free slot.

AMDSMI_STATUS_NO_DATA 

No data was found for a given input.

AMDSMI_STATUS_INSUFFICIENT_SIZE 

Not enough resources were available for the operation.

AMDSMI_STATUS_UNEXPECTED_SIZE 

An unexpected amount of data was read.

AMDSMI_STATUS_UNEXPECTED_DATA 

The data read or provided to function is not what was expected.

AMDSMI_STATUS_MAP_ERROR 

The internal library error did not map to a status code.

AMDSMI_STATUS_UNKNOWN_ERROR 

An unknown error occurred.

◆ amdsmi_clk_type_t

Clock types

Enumerator
CLK_TYPE_SYS 

System clock.

CLK_TYPE_DF 

running on a separate clock)

Data Fabric clock (for ASICs

CLK_TYPE_DCEF 

Display Controller Engine clock.

◆ amdsmi_dev_perf_level_t

PowerPlay performance levels.

Enumerator
AMDSMI_DEV_PERF_LEVEL_AUTO 

Performance level is "auto".

AMDSMI_DEV_PERF_LEVEL_LOW 

regardless of workload

Keep PowerPlay levels "low",

AMDSMI_DEV_PERF_LEVEL_HIGH 

regardless of workload

Keep PowerPlay levels "high",

AMDSMI_DEV_PERF_LEVEL_MANUAL 

setting the AMDSMI_CLK_TYPE_SYS speed

Only use values defined by manually

AMDSMI_DEV_PERF_LEVEL_STABLE_STD 

clocks

Stable power state with profiling

AMDSMI_DEV_PERF_LEVEL_STABLE_PEAK 

Stable power state with peak clocks.

AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK 

memory clock

Stable power state with minimum

AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK 

system clock

Stable power state with minimum

AMDSMI_DEV_PERF_LEVEL_DETERMINISM 

Performance determinism state.

AMDSMI_DEV_PERF_LEVEL_UNKNOWN 

Unknown performance level.

◆ amdsmi_sw_component_t

Available clock types.

Software components

Enumerator
AMDSMI_SW_COMP_DRIVER 

Driver.

◆ amdsmi_event_group_t

Enum denoting an event group. The value of the enum is the base value for all the event enums in the group.

Event Groups

Enumerator
AMDSMI_EVNT_GRP_XGMI 

Data Fabric (XGMI) related events.

AMDSMI_EVNT_GRP_XGMI_DATA_OUT 

XGMI Outbound data.

◆ amdsmi_event_type_t

Event type enum. Events belonging to a particular event group amdsmi_event_group_t should begin enumerating at the amdsmi_event_group_t value for that group.

Event types

Enumerator
AMDSMI_EVNT_XGMI_0_NOP_TX 

NOPs sent to neighbor 0.

AMDSMI_EVNT_XGMI_0_REQUEST_TX 

neighbor 0

Outgoing requests to

AMDSMI_EVNT_XGMI_0_RESPONSE_TX 

neighbor 0

Outgoing responses to

AMDSMI_EVNT_XGMI_0_BEATS_TX 

Data beats sent to neighbor 0; Each beat represents 32 bytes.

XGMI throughput can be calculated by multiplying a BEATs event such as AMDSMI_EVNT_XGMI_0_BEATS_TX by 32 and dividing by the time for which event collection occurred, amdsmi_counter_value_t.time_running (which is in nanoseconds). To get bytes per second, multiply this value by 109.

Throughput = BEATS/time_running * 109 (bytes/second)

AMDSMI_EVNT_XGMI_1_NOP_TX 

NOPs sent to neighbor 1.

AMDSMI_EVNT_XGMI_1_REQUEST_TX 

neighbor 1

Outgoing requests to

AMDSMI_EVNT_XGMI_1_RESPONSE_TX 

neighbor 1

Outgoing responses to

AMDSMI_EVNT_XGMI_1_BEATS_TX 

Data beats sent to neighbor 1; Each beat represents 32 bytes

AMDSMI_EVNT_XGMI_DATA_OUT_1 

Outbound beats to neighbor 1.

AMDSMI_EVNT_XGMI_DATA_OUT_2 

Outbound beats to neighbor 2.

AMDSMI_EVNT_XGMI_DATA_OUT_3 

Outbound beats to neighbor 3.

AMDSMI_EVNT_XGMI_DATA_OUT_4 

Outbound beats to neighbor 4.

AMDSMI_EVNT_XGMI_DATA_OUT_5 

Outbound beats to neighbor 5.

◆ amdsmi_counter_command_t

Event counter commands

Enumerator
AMDSMI_CNTR_CMD_START 

Start the counter.

AMDSMI_CNTR_CMD_STOP 

be used before reading.

Stop the counter; note that this should not

◆ amdsmi_evt_notification_type_t

Event notification event types

Enumerator
AMDSMI_EVT_NOTIF_VMFAULT 

VM page fault.

◆ amdsmi_temperature_metric_t

Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values will be in millidegress Celcius.

Enumerator
AMDSMI_TEMP_CURRENT 

Temperature current value.

AMDSMI_TEMP_MAX 

Temperature max value.

AMDSMI_TEMP_MIN 

Temperature min value.

AMDSMI_TEMP_MAX_HYST 

Temperature hysteresis value for max limit. (This is an absolute temperature, not a delta).

AMDSMI_TEMP_MIN_HYST 

Temperature hysteresis value for min limit. (This is an absolute temperature, not a delta).

AMDSMI_TEMP_CRITICAL 

greater than corresponding temp_max values.

Temperature critical max value, typically

AMDSMI_TEMP_CRITICAL_HYST 

Temperature hysteresis value for critical limit. (This is an absolute temperature, not a delta).

AMDSMI_TEMP_EMERGENCY 

Temperature emergency max value, for chips supporting more than two upper temperature limits. Must be equal or greater than corresponding temp_crit values.

AMDSMI_TEMP_EMERGENCY_HYST 

Temperature hysteresis value for emergency limit. (This is an absolute temperature, not a delta).

AMDSMI_TEMP_CRIT_MIN 

Temperature critical min value, typically lower than corresponding temperature minimum values.

AMDSMI_TEMP_CRIT_MIN_HYST 

Temperature hysteresis value for critical minimum limit. (This is an absolute temperature, not a delta).

AMDSMI_TEMP_OFFSET 

Temperature offset which is added to the

AMDSMI_TEMP_LOWEST 

temperature reading by the chip.

Historical minimum temperature.

AMDSMI_TEMP_HIGHEST 

Historical maximum temperature.

◆ amdsmi_voltage_metric_t

Voltage Metrics. This enum is used to identify various Volatge metrics. Corresponding values will be in millivolt.

Enumerator
AMDSMI_VOLT_CURRENT 

Voltage current value.

AMDSMI_VOLT_MAX 

Voltage max value.

AMDSMI_VOLT_MIN_CRIT 

Voltage critical min value.

AMDSMI_VOLT_MIN 

Voltage min value.

AMDSMI_VOLT_MAX_CRIT 

Voltage critical max value.

AMDSMI_VOLT_AVERAGE 

Average voltage.

AMDSMI_VOLT_LOWEST 

Historical minimum voltage.

AMDSMI_VOLT_HIGHEST 

Historical maximum voltage.

◆ amdsmi_voltage_type_t

This ennumeration is used to indicate which type of voltage reading should be obtained.

Enumerator
AMDSMI_VOLT_TYPE_VDDGFX 

voltage

Vddgfx GPU

AMDSMI_VOLT_TYPE_INVALID 

Invalid type.

◆ amdsmi_power_profile_preset_masks_t

Pre-set Profile Selections. These bitmasks can be AND'd with the amdsmi_power_profile_status_t.available_profiles returned from :: amdsmi_dev_get_power_profile_presets to determine which power profiles are supported by the system.

Enumerator
AMDSMI_PWR_PROF_PRST_CUSTOM_MASK 

Custom Power Profile.

AMDSMI_PWR_PROF_PRST_VIDEO_MASK 

Video Power Profile.

AMDSMI_PWR_PROF_PRST_POWER_SAVING_MASK 

Power Saving Profile.

AMDSMI_PWR_PROF_PRST_COMPUTE_MASK 

Compute Saving Profile.

AMDSMI_PWR_PROF_PRST_VR_MASK 

VR Power Profile.

3D Full Screen Power Profile

AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT 

Default Boot Up Profile.

AMDSMI_PWR_PROF_PRST_LAST 

Invalid power profile.

◆ amdsmi_gpu_block_t

This enum is used to identify different GPU blocks.

Enumerator
AMDSMI_GPU_BLOCK_INVALID 

invalid block

Used to indicate an

AMDSMI_GPU_BLOCK_UMC 

UMC block.

AMDSMI_GPU_BLOCK_SDMA 

SDMA block.

AMDSMI_GPU_BLOCK_GFX 

GFX block.

AMDSMI_GPU_BLOCK_MMHUB 

MMHUB block.

AMDSMI_GPU_BLOCK_ATHUB 

ATHUB block.

AMDSMI_GPU_BLOCK_PCIE_BIF 

PCIE_BIF block.

AMDSMI_GPU_BLOCK_HDP 

HDP block.

AMDSMI_GPU_BLOCK_XGMI_WAFL 

XGMI block.

AMDSMI_GPU_BLOCK_DF 

DF block.

AMDSMI_GPU_BLOCK_SMN 

SMN block.

AMDSMI_GPU_BLOCK_SEM 

SEM block.

AMDSMI_GPU_BLOCK_MP0 

MP0 block.

AMDSMI_GPU_BLOCK_MP1 

MP1 block.

AMDSMI_GPU_BLOCK_FUSE 

Fuse block.

AMDSMI_GPU_BLOCK_LAST 

for supported blocks

The highest bit position

◆ amdsmi_ras_err_state_t

The current ECC state.

Enumerator
AMDSMI_RAS_ERR_STATE_NONE 

No current errors.

AMDSMI_RAS_ERR_STATE_DISABLED 

ECC is disabled.

AMDSMI_RAS_ERR_STATE_PARITY 

ECC errors present, but type unknown.

AMDSMI_RAS_ERR_STATE_SING_C 

Single correctable error.

AMDSMI_RAS_ERR_STATE_MULT_UC 

Multiple uncorrectable errors.

AMDSMI_RAS_ERR_STATE_POISON 

page. Treat as uncorrectable.

Firmware detected error and isolated

AMDSMI_RAS_ERR_STATE_ENABLED 

ECC is enabled.

◆ amdsmi_memory_type_t

Types of memory.

Enumerator
AMDSMI_MEM_TYPE_VRAM 

VRAM memory.

AMDSMI_MEM_TYPE_VIS_VRAM 

VRAM memory that is visible.

AMDSMI_MEM_TYPE_GTT 

GTT memory.

◆ amdsmi_freq_ind_t

The values of this enum are used as frequency identifiers.

Enumerator
AMDSMI_FREQ_IND_MIN 

Index used for the minimum frequency value.

AMDSMI_FREQ_IND_MAX 

Index used for the maximum frequency value.

AMDSMI_FREQ_IND_INVALID 

An invalid frequency index.

◆ amdsmi_memory_page_status_t

Reserved Memory Page States.

Enumerator
AMDSMI_MEM_PAGE_STATUS_RESERVED 

and not available for use

Reserved. This gpu page is reserved

AMDSMI_MEM_PAGE_STATUS_PENDING 

Pending. This gpu page is marked as bad and will be marked reserved at the next window.

AMDSMI_MEM_PAGE_STATUS_UNRESERVABLE 

Unable to reserve this page.

◆ AMDSMI_IO_LINK_TYPE

Types for IO Link.

Enumerator
AMDSMI_IOLINK_TYPE_UNDEFINED 

unknown type.

AMDSMI_IOLINK_TYPE_PCIEXPRESS 

PCI Express.

AMDSMI_IOLINK_TYPE_XGMI 

XGMI.

AMDSMI_IOLINK_TYPE_NUMIOLINKTYPES 

Number of IO Link types.

AMDSMI_IOLINK_TYPE_SIZE 

Max of IO Link types.

◆ AMDSMI_UTILIZATION_COUNTER_TYPE

The utilization counter type.

Enumerator
AMDSMI_UTILIZATION_COUNTER_FIRST 

GFX Activity.

AMDSMI_COARSE_GRAIN_MEM_ACTIVITY 

Memory Activity.

Function Documentation

◆ amdsmi_get_device_bdf()

amdsmi_status_t amdsmi_get_device_bdf ( amdsmi_device_handle  device_handle,
amdsmi_bdf_t bdf 
)

Returns BDF of the given device.

Parameters
[in]device_handleDevice which to query
[out]bdfReference to BDF. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_device_uuid()

amdsmi_status_t amdsmi_get_device_uuid ( amdsmi_device_handle  device_handle,
unsigned int *  uuid_length,
char *  uuid 
)

Returns the UUID of the device.

Parameters
[in]device_handleDevice which to query
[in,out]uuid_lengthLength of the uuid string. As input, must be equal or greater than SMI_GPU_UUID_SIZE and be allocated by user. As output it is the length of the uuid string.
[out]uuidPointer to string to store the UUID. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail