amdsmi.h Source File

amdsmi.h Source File#

AMD SMI: amdsmi.h Source File
amdsmi.h
Go to the documentation of this file.
1 /*
2  * =============================================================================
3  * The University of Illinois/NCSA
4  * Open Source License (NCSA)
5  *
6  * Copyright (c) 2022, Advanced Micro Devices, Inc.
7  * All rights reserved.
8  *
9  * Developed by:
10  *
11  * AMD Research and AMD ROC Software Development
12  *
13  * Advanced Micro Devices, Inc.
14  *
15  * www.amd.com
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining a copy
18  * of this software and associated documentation files (the "Software"), to
19  * deal with the Software without restriction, including without limitation
20  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
21  * and/or sell copies of the Software, and to permit persons to whom the
22  * Software is furnished to do so, subject to the following conditions:
23  *
24  * - Redistributions of source code must retain the above copyright notice,
25  * this list of conditions and the following disclaimers.
26  * - Redistributions in binary form must reproduce the above copyright
27  * notice, this list of conditions and the following disclaimers in
28  * the documentation and/or other materials provided with the distribution.
29  * - Neither the names of <Name of Development Group, Name of Institution>,
30  * nor the names of its contributors may be used to endorse or promote
31  * products derived from this Software without specific prior written
32  * permission.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
37  * THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
38  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
39  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
40  * DEALINGS WITH THE SOFTWARE.
41  *
42  */
43 #ifndef INCLUDE_AMDSMI_H_
44 #define INCLUDE_AMDSMI_H_
45 
51 #include <stdlib.h>
52 #include <stdbool.h>
53 #ifdef __cplusplus
54 extern "C" {
55 #include <cstdint>
56 #else
57 #include <stdint.h>
58 #endif // __cplusplus
59 
65 typedef enum {
66  AMDSMI_INIT_ALL_DEVICES = 0x0, // Default option
67  AMDSMI_INIT_AMD_CPUS = (1 << 0),
68  AMDSMI_INIT_AMD_GPUS = (1 << 1),
69  AMDSMI_INIT_NON_AMD_CPUS = (1 << 2),
70  AMDSMI_INIT_NON_AMD_GPUS = (1 << 3)
72 
73 /* Maximum size definitions AMDSMI */
74 #define AMDSMI_MAX_MM_IP_COUNT 8
75 #define AMDSMI_MAX_DATE_LENGTH 32
76 #define AMDSMI_MAX_STRING_LENGTH 64
77 #define AMDSMI_NORMAL_STRING_LENGTH 32
78 #define AMDSMI_MAX_DEVICES 32
79 #define AMDSMI_MAX_NAME 32
80 #define AMDSMI_MAX_DRIVER_VERSION_LENGTH 80
81 #define AMDSMI_PRODUCT_NAME_LENGTH 128
82 #define AMDSMI_MAX_CONTAINER_TYPE 2
83 
84 #define AMDSMI_GPU_UUID_SIZE 38
85 
86 /* string format */
87 #define AMDSMI_TIME_FORMAT "%02d:%02d:%02d.%03d"
88 #define AMDSMI_DATE_FORMAT "%04d-%02d-%02d:%02d:%02d:%02d.%03d"
89 
95 #define AMDSMI_LIB_VERSION_YEAR 23
96 
98 #define AMDSMI_LIB_VERSION_MAJOR 1
99 
101 #define AMDSMI_LIB_VERSION_MINOR 1
102 
104 #define AMDSMI_LIB_VERSION_RELEASE 0
105 
106 #define AMDSMI_LIB_VERSION_CREATE_STRING(YEAR, MAJOR, MINOR, RELEASE) (#YEAR "." #MAJOR "." #MINOR "." #RELEASE)
107 #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)
108 #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)
109 
110 typedef enum {
111  AMDSMI_MM_UVD,
112  AMDSMI_MM_VCE,
113  AMDSMI_MM_VCN,
114  AMDSMI_MM__MAX
115 } amdsmi_mm_ip_t;
116 
117 typedef enum {
118  CONTAINER_LXC,
119  CONTAINER_DOCKER,
120 } amdsmi_container_types_t;
121 
123 typedef void *amdsmi_device_handle;
124 typedef void *amdsmi_socket_handle;
125 
129 typedef enum {
130  UNKNOWN = 0,
131  AMD_GPU,
132  AMD_CPU,
133  NON_AMD_GPU,
134  NON_AMD_CPU
135 } device_type_t;
136 
140 // Please avoid status codes that are multiples of 256 (256, 512, etc..)
141 // Return values in the shell get modulo 256 applied, meaning any multiple of 256 ends up as 0
142 typedef enum {
144  // Library usage errors
164  // Device related errors
169  // Data and size errors
174  // General errors
175  AMDSMI_STATUS_MAP_ERROR = 0xFFFFFFFE,
178 
182 typedef enum {
183  CLK_TYPE_SYS = 0x0,
184  CLK_TYPE_FIRST = CLK_TYPE_SYS,
185  CLK_TYPE_GFX = CLK_TYPE_SYS,
186  CLK_TYPE_DF,
189  CLK_TYPE_SOC,
190  CLK_TYPE_MEM,
191  CLK_TYPE_PCIE,
192  CLK_TYPE_VCLK0,
193  CLK_TYPE_VCLK1,
194  CLK_TYPE_DCLK0,
195  CLK_TYPE_DCLK1,
196  CLK_TYPE__MAX = CLK_TYPE_DCLK1
198 
203 typedef enum {
204  TEMPERATURE_TYPE_EDGE,
205  TEMPERATURE_TYPE_FIRST = TEMPERATURE_TYPE_EDGE,
206  TEMPERATURE_TYPE_JUNCTION,
207  TEMPERATURE_TYPE_VRAM,
208  TEMPERATURE_TYPE_HBM_0,
209  TEMPERATURE_TYPE_HBM_1,
210  TEMPERATURE_TYPE_HBM_2,
211  TEMPERATURE_TYPE_HBM_3,
212  TEMPERATURE_TYPE_PLX,
213  TEMPERATURE_TYPE__MAX = TEMPERATURE_TYPE_PLX
215 
220 typedef enum {
221  FW_ID_SMU = 1,
222  FW_ID_FIRST = FW_ID_SMU,
223  FW_ID_CP_CE,
224  FW_ID_CP_PFP,
225  FW_ID_CP_ME,
226  FW_ID_CP_MEC_JT1,
227  FW_ID_CP_MEC_JT2,
228  FW_ID_CP_MEC1,
229  FW_ID_CP_MEC2,
230  FW_ID_RLC,
231  FW_ID_SDMA0,
232  FW_ID_SDMA1,
233  FW_ID_SDMA2,
234  FW_ID_SDMA3,
235  FW_ID_SDMA4,
236  FW_ID_SDMA5,
237  FW_ID_SDMA6,
238  FW_ID_SDMA7,
239  FW_ID_VCN,
240  FW_ID_UVD,
241  FW_ID_VCE,
242  FW_ID_ISP,
243  FW_ID_DMCU_ERAM, /*eRAM*/
244  FW_ID_DMCU_ISR, /*ISR*/
245  FW_ID_RLC_RESTORE_LIST_GPM_MEM,
246  FW_ID_RLC_RESTORE_LIST_SRM_MEM,
247  FW_ID_RLC_RESTORE_LIST_CNTL,
248  FW_ID_RLC_V,
249  FW_ID_MMSCH,
250  FW_ID_PSP_SYSDRV,
251  FW_ID_PSP_SOSDRV,
252  FW_ID_PSP_TOC,
253  FW_ID_PSP_KEYDB,
254  FW_ID_DFC,
255  FW_ID_PSP_SPL,
256  FW_ID_DRV_CAP,
257  FW_ID_MC,
258  FW_ID_PSP_BL,
259  FW_ID_CP_PM4,
260  FW_ID_ASD,
261  FW_ID_TA_RAS,
262  FW_ID_XGMI,
263  FW_ID_RLC_SRLG,
264  FW_ID_RLC_SRLS,
265  FW_ID_SMC,
266  FW_ID_DMCU,
267  FW_ID__MAX
269 
273 typedef struct {
274  uint64_t lower_bound;
275  uint64_t upper_bound;
276  uint64_t reserved[2];
278 
279 typedef struct {
280  uint8_t xgmi_lanes;
281  uint64_t xgmi_hive_id;
282  uint64_t xgmi_node_id;
283  uint32_t index;
284  uint32_t reserved[9];
286 
290 typedef struct {
291  struct {
292  uint32_t gfxip_major;
293  uint32_t gfxip_minor;
294  uint16_t gfxip_cu_count;
295  uint32_t reserved[5];
296  } gfx;
297  struct {
298  uint8_t mm_ip_count;
299  uint8_t mm_ip_list[AMDSMI_MAX_MM_IP_COUNT];
300  uint32_t reserved[5];
301  } mm;
302 
303  bool ras_supported;
304  uint8_t max_vf_num;
305  uint32_t gfx_ip_count;
306  uint32_t dma_ip_count;
307  uint32_t reserved[5];
309 
310 typedef struct {
311  uint32_t vram_total;
312  uint32_t vram_used;
314 
315 typedef struct {
316  amdsmi_range_t supported_freq_range;
317  amdsmi_range_t current_freq_range;
318  uint32_t reserved[8];
320 
321 typedef union {
322  struct {
323  uint64_t function_number : 3;
324  uint64_t device_number : 5;
325  uint64_t bus_number : 8;
326  uint64_t domain_number : 48;
327  };
328  uint64_t as_uint;
329 } amdsmi_bdf_t;
330 
331 typedef struct {
332  uint64_t power_cap;
333  uint64_t default_power_cap;
334  uint64_t dpm_cap;
335  uint64_t min_power_cap;
336  uint64_t max_power_cap;
337  uint64_t reserved[3];
339 
340 typedef struct {
341  char name[AMDSMI_MAX_STRING_LENGTH];
342  uint32_t vbios_version;
343  char build_date[AMDSMI_MAX_DATE_LENGTH];
344  char part_number[AMDSMI_MAX_STRING_LENGTH];
345  char vbios_version_string[AMDSMI_NORMAL_STRING_LENGTH];
346  uint32_t reserved[15];
348 
349 typedef struct {
350  uint8_t num_fw_info;
351  struct {
352  amdsmi_fw_block_t fw_id;
353  uint64_t fw_version;
354  uint64_t reserved[2];
355  } fw_info_list[FW_ID__MAX];
356  uint32_t reserved[7];
358 
359 typedef struct {
360  char market_name[AMDSMI_MAX_STRING_LENGTH];
361  uint32_t family;
362  uint32_t vendor_id; //< Use 32 bit to be compatible with other platform.
363  uint32_t subvendor_id; //< The subsystem vendor id
364  uint64_t device_id; //< The unique id of a GPU
365  uint32_t rev_id;
366  char asic_serial[AMDSMI_NORMAL_STRING_LENGTH];
368 
369 typedef struct {
370  uint64_t serial_number;
371  bool is_master;
372  char model_number[AMDSMI_NORMAL_STRING_LENGTH];
373  char product_serial[AMDSMI_NORMAL_STRING_LENGTH];
374  char fru_id[AMDSMI_NORMAL_STRING_LENGTH];
375  char product_name[AMDSMI_PRODUCT_NAME_LENGTH];
376  char manufacturer_name[AMDSMI_NORMAL_STRING_LENGTH];
378 
379 typedef struct {
380  uint32_t average_socket_power;
381  uint64_t energy_accumulator; // v1 mod. (32->64)
382  uint32_t voltage_gfx; // GFX voltage measurement in mV
383  uint32_t voltage_soc; // SOC voltage measurement in mV
384  uint32_t voltage_mem; // MEM voltage measurement in mV
385  uint32_t power_limit; // The power limit;
386  uint32_t reserved[9];
388 
389 typedef struct {
390  uint32_t cur_clk;
391  uint32_t avg_clk;
392  uint32_t min_clk;
393  uint32_t max_clk;
394  uint32_t reserved[4];
396 
397 typedef struct {
398  uint32_t gfx_activity;
399  uint32_t umc_activity;
400  uint32_t mm_activity[AMDSMI_MAX_MM_IP_COUNT];
401  uint32_t reserved[6];
403 
404 typedef uint32_t amdsmi_process_handle;
405 
406 typedef struct {
407  char name[AMDSMI_NORMAL_STRING_LENGTH];
408  amdsmi_process_handle pid;
409  uint64_t mem;
410  struct {
411  uint64_t gfx;
412  uint64_t compute;
413  uint64_t dma;
414  uint64_t enc;
415  uint64_t dec;
416  } engine_usage;
417  struct {
418  uint64_t gtt_mem;
419  uint64_t cpu_mem;
420  uint64_t vram_mem;
421  } memory_usage;
422  char container_name[AMDSMI_NORMAL_STRING_LENGTH];
423  uint32_t reserved[10];
425 
427 #define AMDSMI_MAX_NUM_FREQUENCIES 32
428 
431 #define AMDSMI_MAX_FAN_SPEED 255
432 
434 #define AMDSMI_NUM_VOLTAGE_CURVE_POINTS 3
438 typedef enum {
440  AMDSMI_DEV_PERF_LEVEL_FIRST = AMDSMI_DEV_PERF_LEVEL_AUTO,
441 
456 
457  AMDSMI_DEV_PERF_LEVEL_LAST = AMDSMI_DEV_PERF_LEVEL_DETERMINISM,
458 
461 
469 typedef enum {
470  AMDSMI_SW_COMP_FIRST = 0x0,
471 
472  AMDSMI_SW_COMP_DRIVER = AMDSMI_SW_COMP_FIRST,
473 
474  AMDSMI_SW_COMP_LAST = AMDSMI_SW_COMP_DRIVER
476 
484 typedef uintptr_t amdsmi_event_handle_t;
485 
492 typedef enum {
495  AMDSMI_EVNT_GRP_INVALID = 0xFFFFFFFF
497 
504 typedef enum {
505  AMDSMI_EVNT_FIRST = AMDSMI_EVNT_GRP_XGMI,
506 
507  AMDSMI_EVNT_XGMI_FIRST = AMDSMI_EVNT_GRP_XGMI,
508  AMDSMI_EVNT_XGMI_0_NOP_TX = AMDSMI_EVNT_XGMI_FIRST,
513 
526  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
536 
537  AMDSMI_EVNT_XGMI_LAST = AMDSMI_EVNT_XGMI_1_BEATS_TX, // 5
538 
539  AMDSMI_EVNT_XGMI_DATA_OUT_FIRST = AMDSMI_EVNT_GRP_XGMI_DATA_OUT, // 10
540 
541  /*
542  * @brief Events in the AMDSMI_EVNT_GRP_XGMI_DATA_OUT group measure
543  * the number of beats sent on an XGMI link. Each beat represents
544  * 32 bytes. AMDSMI_EVNT_XGMI_DATA_OUT_n represents the number of
545  * outbound beats (each representing 32 bytes) on link n.<br><br>
546  *
547  * XGMI throughput can be calculated by multiplying a event
548  * such as ::AMDSMI_EVNT_XGMI_DATA_OUT_n by 32 and dividing by
549  * the time for which event collection occurred,
550  * ::amdsmi_counter_value_t.time_running (which is in nanoseconds). To get
551  * bytes per second, multiply this value by 10<sup>9</sup>.<br>
552  * <br>
553  * Throughput = BEATS/time_running * 10<sup>9</sup> (bytes/second)<br>
554  */
555  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
556  AMDSMI_EVNT_XGMI_DATA_OUT_0 = AMDSMI_EVNT_XGMI_DATA_OUT_FIRST,
562  AMDSMI_EVNT_XGMI_DATA_OUT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_5,
563 
564  AMDSMI_EVNT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_LAST,
566 
570 typedef enum {
575 
579 typedef struct {
580  uint64_t value;
581  uint64_t time_enabled;
583  uint64_t time_running;
586 
590 typedef enum {
592  AMDSMI_EVT_NOTIF_FIRST = AMDSMI_EVT_NOTIF_VMFAULT,
593  AMDSMI_EVT_NOTIF_THERMAL_THROTTLE = 2,
594  AMDSMI_EVT_NOTIF_GPU_PRE_RESET = 3,
595  AMDSMI_EVT_NOTIF_GPU_POST_RESET = 4,
596 
597  AMDSMI_EVT_NOTIF_LAST = AMDSMI_EVT_NOTIF_GPU_POST_RESET
599 
603 #define AMDSMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
604 
606 #define MAX_EVENT_NOTIFICATION_MSG_SIZE 64
607 
611 typedef struct {
616 
622 typedef enum {
624  AMDSMI_TEMP_FIRST = AMDSMI_TEMP_CURRENT,
625 
656 
657  AMDSMI_TEMP_LAST = AMDSMI_TEMP_HIGHEST
659 
665 typedef enum {
667 
668  AMDSMI_VOLT_FIRST = AMDSMI_VOLT_CURRENT,
676 
677  AMDSMI_VOLT_LAST = AMDSMI_VOLT_HIGHEST
679 
684 typedef enum {
685  AMDSMI_VOLT_TYPE_FIRST = 0,
686 
687  AMDSMI_VOLT_TYPE_VDDGFX = AMDSMI_VOLT_TYPE_FIRST,
689  AMDSMI_VOLT_TYPE_LAST = AMDSMI_VOLT_TYPE_VDDGFX,
690  AMDSMI_VOLT_TYPE_INVALID = 0xFFFFFFFF
692 
699 typedef enum {
705 
707  AMDSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK = 0x20,
710 
712  AMDSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF
714 
718 typedef enum {
719  AMDSMI_GPU_BLOCK_INVALID = 0x0000000000000000,
721  AMDSMI_GPU_BLOCK_FIRST = 0x0000000000000001,
722 
723  AMDSMI_GPU_BLOCK_UMC = AMDSMI_GPU_BLOCK_FIRST,
724  AMDSMI_GPU_BLOCK_SDMA = 0x0000000000000002,
725  AMDSMI_GPU_BLOCK_GFX = 0x0000000000000004,
726  AMDSMI_GPU_BLOCK_MMHUB = 0x0000000000000008,
727  AMDSMI_GPU_BLOCK_ATHUB = 0x0000000000000010,
728  AMDSMI_GPU_BLOCK_PCIE_BIF = 0x0000000000000020,
729  AMDSMI_GPU_BLOCK_HDP = 0x0000000000000040,
730  AMDSMI_GPU_BLOCK_XGMI_WAFL = 0x0000000000000080,
731  AMDSMI_GPU_BLOCK_DF = 0x0000000000000100,
732  AMDSMI_GPU_BLOCK_SMN = 0x0000000000000200,
733  AMDSMI_GPU_BLOCK_SEM = 0x0000000000000400,
734  AMDSMI_GPU_BLOCK_MP0 = 0x0000000000000800,
735  AMDSMI_GPU_BLOCK_MP1 = 0x0000000000001000,
736  AMDSMI_GPU_BLOCK_FUSE = 0x0000000000002000,
737 
740  AMDSMI_GPU_BLOCK_RESERVED = 0x8000000000000000
742 
746 typedef enum {
755 
756  AMDSMI_RAS_ERR_STATE_LAST = AMDSMI_RAS_ERR_STATE_ENABLED,
757  AMDSMI_RAS_ERR_STATE_INVALID = 0xFFFFFFFF
759 
763 typedef enum {
764  AMDSMI_MEM_TYPE_FIRST = 0,
765 
766  AMDSMI_MEM_TYPE_VRAM = AMDSMI_MEM_TYPE_FIRST,
769 
770  AMDSMI_MEM_TYPE_LAST = AMDSMI_MEM_TYPE_GTT
772 
776 typedef enum {
779  AMDSMI_FREQ_IND_INVALID = 0xFFFFFFFF
781 
785 typedef enum {
786  AMDSMI_XGMI_STATUS_NO_ERRORS = 0,
787  AMDSMI_XGMI_STATUS_ERROR,
788  AMDSMI_XGMI_STATUS_MULTIPLE_ERRORS,
790 
794 typedef uint64_t amdsmi_bit_field_t;
795 
799 typedef enum {
807 
811 typedef enum {
816  AMDSMI_IOLINK_TYPE_SIZE = 0xFFFFFFFF
818 
822 typedef enum {
825  AMDSMI_COARSE_GRAIN_GFX_ACTIVITY = AMDSMI_UTILIZATION_COUNTER_FIRST,
827  AMDSMI_UTILIZATION_COUNTER_LAST = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY
829 
833 typedef struct {
835  uint64_t value;
837 
841 typedef struct {
842  uint64_t page_address;
843  uint64_t page_size;
846 
850 #define AMDSMI_MAX_NUM_POWER_PROFILES (sizeof(amdsmi_bit_field_t) * 8)
851 
857 typedef struct {
862 
867 
871  uint32_t num_profiles;
873 
877 typedef struct {
881  uint32_t num_supported;
882 
886  uint32_t current;
887 
892  uint64_t frequency[AMDSMI_MAX_NUM_FREQUENCIES];
894 
900 typedef struct {
905 
910  uint32_t lanes[AMDSMI_MAX_NUM_FREQUENCIES];
912 
916 typedef struct {
917  uint32_t major;
918  uint32_t minor;
919  uint32_t patch;
920  const char *build;
921  uint32_t reserved[4];
923 
927 typedef struct {
928  uint64_t frequency;
929  uint64_t voltage;
931 
937 typedef struct {
941 
945 typedef struct {
952 
956 typedef struct {
962 
967  uint32_t num_regions;
969 
977 typedef struct {
978  // TODO(amd) Doxygen documents
980  uint16_t structure_size;
981  uint8_t format_revision;
982  uint8_t content_revision;
985 
989 // Below is the assumed version of gpu_metric data on the device. If the device
990 // is using this version, we can read data directly into amdsmi_gpu_metrics_t.
991 // If the device is using an older format, a conversion of formats will be
992 // required.
993 // DGPU targets have a format version of 1. APU targets have a format version of
994 // 2. Currently, only version 1 (DGPU) gpu_metrics is supported.
995 #define AMDSMI_GPU_METRICS_API_FORMAT_VER 1
996 // The content version increments when gpu_metrics is extended with new and/or
997 // existing field sizes are changed.
998 #define AMDSMI_GPU_METRICS_API_CONTENT_VER_1 1
999 #define AMDSMI_GPU_METRICS_API_CONTENT_VER_2 2
1000 #define AMDSMI_GPU_METRICS_API_CONTENT_VER_3 3
1001 
1002 // This should match NUM_HBM_INSTANCES
1003 #define AMDSMI_NUM_HBM_INSTANCES 4
1004 
1005 // Unit conversion factor for HBM temperatures
1006 #define CENTRIGRADE_TO_MILLI_CENTIGRADE 1000
1007 
1008 typedef struct {
1009 // TODO(amd) Doxygen documents
1011  amd_metrics_table_header_t common_header;
1012 
1013 /* Temperature */
1014  uint16_t temperature_edge;
1015  uint16_t temperature_hotspot;
1016  uint16_t temperature_mem;
1017  uint16_t temperature_vrgfx;
1018  uint16_t temperature_vrsoc;
1019  uint16_t temperature_vrmem;
1020 
1021 /* Utilization */
1022  uint16_t average_gfx_activity;
1023  uint16_t average_umc_activity; // memory controller
1024  uint16_t average_mm_activity; // UVD or VCN
1025 
1026 /* Power/Energy */
1027  uint16_t average_socket_power;
1028  uint64_t energy_accumulator; // v1 mod. (32->64)
1029 
1030 /* Driver attached timestamp (in ns) */
1031  uint64_t system_clock_counter; // v1 mod. (moved from top of struct)
1032 
1033 /* Average clocks */
1034  uint16_t average_gfxclk_frequency;
1035  uint16_t average_socclk_frequency;
1036  uint16_t average_uclk_frequency;
1037  uint16_t average_vclk0_frequency;
1038  uint16_t average_dclk0_frequency;
1039  uint16_t average_vclk1_frequency;
1040  uint16_t average_dclk1_frequency;
1041 
1042 /* Current clocks */
1043  uint16_t current_gfxclk;
1044  uint16_t current_socclk;
1045  uint16_t current_uclk;
1046  uint16_t current_vclk0;
1047  uint16_t current_dclk0;
1048  uint16_t current_vclk1;
1049  uint16_t current_dclk1;
1050 
1051 /* Throttle status */
1052  uint32_t throttle_status;
1053 
1054 /* Fans */
1055  uint16_t current_fan_speed;
1056 
1057 /* Link width/speed */
1058  uint16_t pcie_link_width; // v1 mod.(8->16)
1059  uint16_t pcie_link_speed; // in 0.1 GT/s; v1 mod. (8->16)
1060 
1061  uint16_t padding; // new in v1
1062 
1063  uint32_t gfx_activity_acc; // new in v1
1064  uint32_t mem_actvity_acc; // new in v1
1065  uint16_t temperature_hbm[AMDSMI_NUM_HBM_INSTANCES]; // new in v1
1068 
1072 typedef struct {
1075  uint64_t reserved[2];
1077 
1081 typedef struct {
1082  uint16_t pcie_lanes;
1083  uint32_t pcie_speed;
1084  uint32_t reserved[6];
1089 typedef struct {
1090  uint32_t process_id;
1091  uint32_t pasid;
1092  uint64_t vram_usage;
1093  uint64_t sdma_usage;
1094  uint32_t cu_occupancy;
1096 
1100 typedef struct amdsmi_func_id_iter_handle * amdsmi_func_id_iter_handle_t;
1101 
1104 #define AMDSMI_DEFAULT_VARIANT 0xFFFFFFFFFFFFFFFF
1105 
1111 typedef union {
1112  uint64_t id;
1113  const char *name;
1114  union {
1128  amdsmi_gpu_block_t gpu_block_type;
1129  };
1131 
1132 /*****************************************************************************/
1156 amdsmi_status_t amdsmi_init(uint64_t init_flags);
1157 
1167 
1170 /*****************************************************************************/
1203  amdsmi_socket_handle* socket_handles);
1204 
1220  amdsmi_socket_handle socket_handle,
1221  char *name, size_t len);
1222 
1254 amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle,
1255  uint32_t *device_count,
1256  amdsmi_device_handle* device_handles);
1257 
1273  device_type_t* device_type);
1274 
1288 
1291 /*****************************************************************************/
1321 
1354  size_t len);
1355 
1379  uint32_t len);
1380 
1401 
1434 amdsmi_dev_get_subsystem_name(amdsmi_device_handle device_handle, char *name, size_t len);
1435 
1451 
1454 /*****************************************************************************/
1478 
1512 
1533 
1557  uint64_t *received, uint64_t *max_pkt_sz);
1558 
1579  uint64_t *counter);
1580 
1583 /*****************************************************************************/
1619 
1622 /*****************************************************************************/
1650 amdsmi_dev_get_power_ave(amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t *power);
1651 
1680 amdsmi_dev_get_energy_count(amdsmi_device_handle device_handle, uint64_t *power,
1681  float *counter_resolution, uint64_t *timestamp);
1682 
1685 /*****************************************************************************/
1708  amdsmi_dev_set_power_cap(amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t cap);
1709 
1728  amdsmi_dev_set_power_profile(amdsmi_device_handle device_handle, uint32_t reserved,
1730 
1733 /*****************************************************************************/
1762  uint64_t *total);
1763 
1786  uint64_t *used);
1787 
1804 
1827  amdsmi_ras_err_state_t *state);
1828 
1848 amdsmi_dev_get_memory_busy_percent(amdsmi_device_handle device_handle, uint32_t *busy_percent);
1849 
1882  amdsmi_retired_page_record_t *records);
1883 
1915  int64_t *speed);
1916 
1941  uint32_t sensor_ind, int64_t *speed);
1942 
1965  uint32_t sensor_ind, uint64_t *max_speed);
1966 
1994  amdsmi_temperature_type_t sensor_type,
1995  amdsmi_temperature_metric_t metric, int64_t *temperature);
1996 
2024  amdsmi_voltage_type_t sensor_type,
2025  amdsmi_voltage_metric_t metric, int64_t *voltage);
2026 
2029 /*****************************************************************************/
2047 amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_device_handle device_handle, uint32_t sensor_ind);
2048 
2070  uint32_t sensor_ind, uint64_t speed);
2071 
2074 /*****************************************************************************/
2101 amdsmi_dev_get_busy_percent(amdsmi_device_handle device_handle, uint32_t *busy_percent);
2102 
2129  amdsmi_utilization_counter_t utilization_counters[],
2130  uint32_t count,
2131  uint64_t *timestamp);
2132 
2146 
2160 
2180  amdsmi_dev_perf_level_t *perf);
2181 
2200 amdsmi_set_perf_determinism_mode(amdsmi_device_handle device_handle, uint64_t clkvalue);
2201 
2223 
2245 
2256 
2276 
2295  amdsmi_gpu_metrics_t *pgpu_metrics);
2296 
2317  uint64_t maxclkvalue,
2318  amdsmi_clk_type_t clkType);
2319 
2340  uint64_t clkvalue,
2341  amdsmi_clk_type_t clkType);
2342 
2362  uint64_t clkvalue, uint64_t voltvalue);
2363 
2400  uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer);
2401 
2436 
2439 /*****************************************************************************/
2467 
2486 
2527 
2566 
2600  amdsmi_clk_type_t clk_type, uint64_t freq_bitmask);
2601 
2604 /*****************************************************************************/
2624 
2650  uint32_t len);
2651 
2654 /*****************************************************************************/
2684 
2710  uint64_t *enabled_blocks);
2711 
2734  amdsmi_ras_err_state_t *state);
2735 
2750 amdsmi_status_string(amdsmi_status_t status, const char **status_string);
2751 
2754 /*****************************************************************************/
2872 
2899  amdsmi_event_handle_t *evnt_handle);
2900 
2915 
2934  amdsmi_counter_command_t cmd, void *cmd_args);
2935 
2954  amdsmi_counter_value_t *value);
2955 
2975  amdsmi_event_group_t grp, uint32_t *available);
2976 
2979 /*****************************************************************************/
3015 
3034 
3065 amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices,
3066  uint32_t *num_devices);
3067 
3070 /*****************************************************************************/
3097 
3111 
3114 /*****************************************************************************/
3136 amdsmi_topo_get_numa_node_number(amdsmi_device_handle device_handle, uint32_t *numa_node);
3137 
3158  uint64_t *weight);
3159 
3183  uint64_t *min_bandwidth, uint64_t *max_bandwidth);
3184 
3209  amdsmi_device_handle device_handle_dst,
3210  uint64_t *hops, AMDSMI_IO_LINK_TYPE *type);
3211 
3232  bool *accessible);
3233 
3236 /*****************************************************************************/
3371 
3397  amdsmi_func_id_iter_handle_t *var_iter);
3398 
3416 
3429 
3449  amdsmi_func_id_value_t *value);
3450 
3453 /*****************************************************************************/
3475 
3504 
3542  uint32_t *num_elem, amdsmi_evt_notification_data_t *data);
3543 
3559 
3573 
3589 amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid);
3590 
3591 /*****************************************************************************/
3611 amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char *version);
3612 
3615 /*****************************************************************************/
3636 
3649 
3663 amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, uint32_t sensor_ind,
3664  amdsmi_power_cap_info_t *info);
3665 
3679 
3693 
3696 /*****************************************************************************/
3712 
3725 
3728 /*****************************************************************************/
3745 
3758 
3775 
3790 
3793 /*****************************************************************************/
3814 
3817 /*****************************************************************************/
3844 amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes);
3845 
3860 amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info);
3861 
3864 /*****************************************************************************/
3882 
3885 #ifdef __cplusplus
3886 }
3887 #endif // __cplusplus
3888 #endif // INCLUDE_AMDSMI_H_
#define AMDSMI_MAX_DATE_LENGTH
Definition: amdsmi.h:75
amdsmi_evt_notification_type_t
Definition: amdsmi.h:590
@ AMDSMI_EVT_NOTIF_VMFAULT
VM page fault.
Definition: amdsmi.h:591
amdsmi_freq_ind_t
The values of this enum are used as frequency identifiers.
Definition: amdsmi.h:776
@ AMDSMI_FREQ_IND_INVALID
An invalid frequency index.
Definition: amdsmi.h:779
@ AMDSMI_FREQ_IND_MAX
Index used for the maximum frequency value.
Definition: amdsmi.h:778
@ AMDSMI_FREQ_IND_MIN
Index used for the minimum frequency value.
Definition: amdsmi.h:777
amdsmi_status_t amdsmi_get_device_bdf(amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf)
Returns BDF of the given device.
uintptr_t amdsmi_event_handle_t
Handle to performance event counter.
Definition: amdsmi.h:484
amdsmi_memory_type_t
Types of memory.
Definition: amdsmi.h:763
@ AMDSMI_MEM_TYPE_VRAM
VRAM memory.
Definition: amdsmi.h:766
@ AMDSMI_MEM_TYPE_VIS_VRAM
VRAM memory that is visible.
Definition: amdsmi.h:767
@ AMDSMI_MEM_TYPE_GTT
GTT memory.
Definition: amdsmi.h:768
amdsmi_clk_type_t
Definition: amdsmi.h:182
@ CLK_TYPE_DF
running on a separate clock)
Definition: amdsmi.h:186
@ CLK_TYPE_SYS
System clock.
Definition: amdsmi.h:183
@ CLK_TYPE_DCEF
Display Controller Engine clock.
Definition: amdsmi.h:188
#define MAX_EVENT_NOTIFICATION_MSG_SIZE
Maximum number of characters an event notification message will be.
Definition: amdsmi.h:606
amdsmi_init_flags_t
Initialization flags.
Definition: amdsmi.h:65
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 ...
Definition: amdsmi.h:492
@ AMDSMI_EVNT_GRP_XGMI
Data Fabric (XGMI) related events.
Definition: amdsmi.h:493
@ AMDSMI_EVNT_GRP_XGMI_DATA_OUT
XGMI Outbound data.
Definition: amdsmi.h:494
amdsmi_ras_err_state_t
The current ECC state.
Definition: amdsmi.h:746
@ AMDSMI_RAS_ERR_STATE_PARITY
ECC errors present, but type unknown.
Definition: amdsmi.h:749
@ AMDSMI_RAS_ERR_STATE_SING_C
Single correctable error.
Definition: amdsmi.h:750
@ AMDSMI_RAS_ERR_STATE_MULT_UC
Multiple uncorrectable errors.
Definition: amdsmi.h:751
@ AMDSMI_RAS_ERR_STATE_POISON
page. Treat as uncorrectable.
Definition: amdsmi.h:752
@ AMDSMI_RAS_ERR_STATE_ENABLED
ECC is enabled.
Definition: amdsmi.h:754
@ AMDSMI_RAS_ERR_STATE_NONE
No current errors.
Definition: amdsmi.h:747
@ AMDSMI_RAS_ERR_STATE_DISABLED
ECC is disabled.
Definition: amdsmi.h:748
amdsmi_event_type_t
Event type enum. Events belonging to a particular event group amdsmi_event_group_t should begin enume...
Definition: amdsmi.h:504
@ AMDSMI_EVNT_XGMI_0_BEATS_TX
Data beats sent to neighbor 0; Each beat represents 32 bytes.
Definition: amdsmi.h:527
@ AMDSMI_EVNT_XGMI_DATA_OUT_3
Outbound beats to neighbor 3.
Definition: amdsmi.h:559
@ AMDSMI_EVNT_XGMI_0_NOP_TX
NOPs sent to neighbor 0.
Definition: amdsmi.h:508
@ AMDSMI_EVNT_XGMI_1_NOP_TX
NOPs sent to neighbor 1.
Definition: amdsmi.h:528
@ AMDSMI_EVNT_XGMI_0_RESPONSE_TX
neighbor 0
Definition: amdsmi.h:511
@ AMDSMI_EVNT_XGMI_1_BEATS_TX
Definition: amdsmi.h:533
@ AMDSMI_EVNT_XGMI_DATA_OUT_4
Outbound beats to neighbor 4.
Definition: amdsmi.h:560
@ AMDSMI_EVNT_XGMI_DATA_OUT_1
Outbound beats to neighbor 1.
Definition: amdsmi.h:557
@ AMDSMI_EVNT_XGMI_DATA_OUT_2
Outbound beats to neighbor 2.
Definition: amdsmi.h:558
@ AMDSMI_EVNT_XGMI_1_REQUEST_TX
neighbor 1
Definition: amdsmi.h:529
@ AMDSMI_EVNT_XGMI_DATA_OUT_5
Outbound beats to neighbor 5.
Definition: amdsmi.h:561
@ AMDSMI_EVNT_XGMI_0_REQUEST_TX
neighbor 0
Definition: amdsmi.h:509
@ AMDSMI_EVNT_XGMI_1_RESPONSE_TX
neighbor 1
Definition: amdsmi.h:531
void * amdsmi_device_handle
opaque handler point to underlying implementation
Definition: amdsmi.h:123
amdsmi_fw_block_t
The values of this enum are used to identify the various firmware blocks.
Definition: amdsmi.h:220
amdsmi_memory_page_status_t
Reserved Memory Page States.
Definition: amdsmi.h:799
@ AMDSMI_MEM_PAGE_STATUS_UNRESERVABLE
Unable to reserve this page.
Definition: amdsmi.h:805
@ AMDSMI_MEM_PAGE_STATUS_RESERVED
and not available for use
Definition: amdsmi.h:800
@ AMDSMI_MEM_PAGE_STATUS_PENDING
Definition: amdsmi.h:802
amdsmi_xgmi_status_t
XGMI Status.
Definition: amdsmi.h:785
amdsmi_dev_perf_level_t
PowerPlay performance levels.
Definition: amdsmi.h:438
@ AMDSMI_DEV_PERF_LEVEL_STABLE_STD
clocks
Definition: amdsmi.h:448
@ AMDSMI_DEV_PERF_LEVEL_STABLE_PEAK
Stable power state with peak clocks.
Definition: amdsmi.h:450
@ AMDSMI_DEV_PERF_LEVEL_AUTO
Performance level is "auto".
Definition: amdsmi.h:439
@ AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK
system clock
Definition: amdsmi.h:453
@ AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK
memory clock
Definition: amdsmi.h:451
@ AMDSMI_DEV_PERF_LEVEL_DETERMINISM
Performance determinism state.
Definition: amdsmi.h:455
@ AMDSMI_DEV_PERF_LEVEL_LOW
regardless of workload
Definition: amdsmi.h:442
@ AMDSMI_DEV_PERF_LEVEL_HIGH
regardless of workload
Definition: amdsmi.h:444
@ AMDSMI_DEV_PERF_LEVEL_MANUAL
setting the AMDSMI_CLK_TYPE_SYS speed
Definition: amdsmi.h:446
@ AMDSMI_DEV_PERF_LEVEL_UNKNOWN
Unknown performance level.
Definition: amdsmi.h:459
amdsmi_status_t amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid)
Returns the UUID of the device.
device_type_t
Device types detectable by AMD SMI.
Definition: amdsmi.h:129
amdsmi_sw_component_t
Available clock types.
Definition: amdsmi.h:469
@ AMDSMI_SW_COMP_DRIVER
Driver.
Definition: amdsmi.h:472
amdsmi_voltage_metric_t
Voltage Metrics. This enum is used to identify various Volatge metrics. Corresponding values will be ...
Definition: amdsmi.h:665
@ AMDSMI_VOLT_LOWEST
Historical minimum voltage.
Definition: amdsmi.h:674
@ AMDSMI_VOLT_MAX_CRIT
Voltage critical max value.
Definition: amdsmi.h:672
@ AMDSMI_VOLT_HIGHEST
Historical maximum voltage.
Definition: amdsmi.h:675
@ AMDSMI_VOLT_MIN
Voltage min value.
Definition: amdsmi.h:671
@ AMDSMI_VOLT_AVERAGE
Average voltage.
Definition: amdsmi.h:673
@ AMDSMI_VOLT_CURRENT
Voltage current value.
Definition: amdsmi.h:666
@ AMDSMI_VOLT_MAX
Voltage max value.
Definition: amdsmi.h:669
@ AMDSMI_VOLT_MIN_CRIT
Voltage critical min value.
Definition: amdsmi.h:670
uint64_t amdsmi_bit_field_t
Bitfield used in various AMDSMI calls.
Definition: amdsmi.h:794
amdsmi_voltage_type_t
This ennumeration is used to indicate which type of voltage reading should be obtained.
Definition: amdsmi.h:684
@ AMDSMI_VOLT_TYPE_INVALID
Invalid type.
Definition: amdsmi.h:690
@ AMDSMI_VOLT_TYPE_VDDGFX
voltage
Definition: amdsmi.h:687
amdsmi_status_t
Error codes returned by amdsmi functions.
Definition: amdsmi.h:142
@ AMDSMI_STATUS_NOT_INIT
Device not initialized.
Definition: amdsmi.h:167
@ AMDSMI_STATUS_INVAL
Invalid parameters.
Definition: amdsmi.h:145
@ AMDSMI_STATUS_BUSY
Device busy.
Definition: amdsmi.h:165
@ AMDSMI_STATUS_UNKNOWN_ERROR
An unknown error occurred.
Definition: amdsmi.h:176
@ AMDSMI_STATUS_FILE_ERROR
Problem accessing a file.
Definition: amdsmi.h:158
@ AMDSMI_STATUS_DRM_ERROR
Error when call libdrm.
Definition: amdsmi.h:150
@ AMDSMI_STATUS_IO
I/O Error.
Definition: amdsmi.h:156
@ AMDSMI_STATUS_NO_DATA
No data was found for a given input.
Definition: amdsmi.h:170
@ AMDSMI_STATUS_RETRY
Retry operation.
Definition: amdsmi.h:153
@ AMDSMI_STATUS_UNEXPECTED_SIZE
An unexpected amount of data was read.
Definition: amdsmi.h:172
@ AMDSMI_STATUS_INTERNAL_EXCEPTION
An internal exception was caught.
Definition: amdsmi.h:160
@ AMDSMI_STATUS_MAP_ERROR
The internal library error did not map to a status code.
Definition: amdsmi.h:175
@ AMDSMI_STATUS_FAIL_LOAD_SYMBOL
Fail to load symbol.
Definition: amdsmi.h:149
@ AMDSMI_STATUS_INSUFFICIENT_SIZE
Not enough resources were available for the operation.
Definition: amdsmi.h:171
@ AMDSMI_STATUS_INIT_ERROR
An error occurred when initializing internal data structures.
Definition: amdsmi.h:162
@ AMDSMI_STATUS_OUT_OF_RESOURCES
Not enough memory.
Definition: amdsmi.h:159
@ AMDSMI_STATUS_NO_SLOT
No more free slot.
Definition: amdsmi.h:168
@ AMDSMI_STATUS_INTERRUPT
An interrupt occurred during execution of function.
Definition: amdsmi.h:155
@ AMDSMI_STATUS_SUCCESS
Call succeeded.
Definition: amdsmi.h:143
@ AMDSMI_STATUS_ADDRESS_FAULT
Bad address.
Definition: amdsmi.h:157
@ AMDSMI_STATUS_NOT_YET_IMPLEMENTED
Not implemented yet.
Definition: amdsmi.h:147
@ AMDSMI_STATUS_NO_PERM
Permission Denied.
Definition: amdsmi.h:154
@ AMDSMI_STATUS_NOT_FOUND
Device Not found.
Definition: amdsmi.h:166
@ AMDSMI_STATUS_FAIL_LOAD_MODULE
Fail to load lib.
Definition: amdsmi.h:148
@ AMDSMI_STATUS_NOT_SUPPORTED
Command not supported.
Definition: amdsmi.h:146
@ AMDSMI_STATUS_UNEXPECTED_DATA
The data read or provided to function is not what was expected.
Definition: amdsmi.h:173
@ AMDSMI_STATUS_API_FAILED
API call failed.
Definition: amdsmi.h:151
@ AMDSMI_STATUS_TIMEOUT
Timeout in API call.
Definition: amdsmi.h:152
@ AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS
The provided input is out of allowable or safe range.
Definition: amdsmi.h:161
@ AMDSMI_STATUS_REFCOUNT_OVERFLOW
An internal reference counter exceeded INT32_MAX.
Definition: amdsmi.h:163
AMDSMI_IO_LINK_TYPE
Types for IO Link.
Definition: amdsmi.h:811
@ AMDSMI_IOLINK_TYPE_SIZE
Max of IO Link types.
Definition: amdsmi.h:816
@ AMDSMI_IOLINK_TYPE_UNDEFINED
unknown type.
Definition: amdsmi.h:812
@ AMDSMI_IOLINK_TYPE_NUMIOLINKTYPES
Number of IO Link types.
Definition: amdsmi.h:815
@ AMDSMI_IOLINK_TYPE_XGMI
XGMI.
Definition: amdsmi.h:814
@ AMDSMI_IOLINK_TYPE_PCIEXPRESS
PCI Express.
Definition: amdsmi.h:813
amdsmi_temperature_metric_t
Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values ...
Definition: amdsmi.h:622
@ AMDSMI_TEMP_CRITICAL_HYST
Definition: amdsmi.h:636
@ AMDSMI_TEMP_CRITICAL
greater than corresponding temp_max values.
Definition: amdsmi.h:634
@ AMDSMI_TEMP_OFFSET
Definition: amdsmi.h:652
@ AMDSMI_TEMP_EMERGENCY
Definition: amdsmi.h:639
@ AMDSMI_TEMP_LOWEST
temperature reading by the chip.
Definition: amdsmi.h:654
@ AMDSMI_TEMP_CRIT_MIN
Definition: amdsmi.h:646
@ AMDSMI_TEMP_EMERGENCY_HYST
Definition: amdsmi.h:643
@ AMDSMI_TEMP_CURRENT
Temperature current value.
Definition: amdsmi.h:623
@ AMDSMI_TEMP_MIN
Temperature min value.
Definition: amdsmi.h:627
@ AMDSMI_TEMP_HIGHEST
Historical maximum temperature.
Definition: amdsmi.h:655
@ AMDSMI_TEMP_CRIT_MIN_HYST
Definition: amdsmi.h:649
@ AMDSMI_TEMP_MIN_HYST
Definition: amdsmi.h:631
@ AMDSMI_TEMP_MAX_HYST
Definition: amdsmi.h:628
@ AMDSMI_TEMP_MAX
Temperature max value.
Definition: amdsmi.h:626
amdsmi_gpu_block_t
This enum is used to identify different GPU blocks.
Definition: amdsmi.h:718
@ AMDSMI_GPU_BLOCK_XGMI_WAFL
XGMI block.
Definition: amdsmi.h:730
@ AMDSMI_GPU_BLOCK_LAST
for supported blocks
Definition: amdsmi.h:738
@ AMDSMI_GPU_BLOCK_GFX
GFX block.
Definition: amdsmi.h:725
@ AMDSMI_GPU_BLOCK_INVALID
invalid block
Definition: amdsmi.h:719
@ AMDSMI_GPU_BLOCK_MP0
MP0 block.
Definition: amdsmi.h:734
@ AMDSMI_GPU_BLOCK_HDP
HDP block.
Definition: amdsmi.h:729
@ AMDSMI_GPU_BLOCK_ATHUB
ATHUB block.
Definition: amdsmi.h:727
@ AMDSMI_GPU_BLOCK_MP1
MP1 block.
Definition: amdsmi.h:735
@ AMDSMI_GPU_BLOCK_PCIE_BIF
PCIE_BIF block.
Definition: amdsmi.h:728
@ AMDSMI_GPU_BLOCK_SDMA
SDMA block.
Definition: amdsmi.h:724
@ AMDSMI_GPU_BLOCK_UMC
UMC block.
Definition: amdsmi.h:723
@ AMDSMI_GPU_BLOCK_FUSE
Fuse block.
Definition: amdsmi.h:736
@ AMDSMI_GPU_BLOCK_DF
DF block.
Definition: amdsmi.h:731
@ AMDSMI_GPU_BLOCK_MMHUB
MMHUB block.
Definition: amdsmi.h:726
@ AMDSMI_GPU_BLOCK_SMN
SMN block.
Definition: amdsmi.h:732
@ AMDSMI_GPU_BLOCK_SEM
SEM block.
Definition: amdsmi.h:733
AMDSMI_UTILIZATION_COUNTER_TYPE
The utilization counter type.
Definition: amdsmi.h:822
@ AMDSMI_COARSE_GRAIN_MEM_ACTIVITY
Memory Activity.
Definition: amdsmi.h:826
@ AMDSMI_UTILIZATION_COUNTER_FIRST
GFX Activity.
Definition: amdsmi.h:823
amdsmi_temperature_type_t
This enumeration is used to indicate from which part of the device a temperature reading should be ob...
Definition: amdsmi.h:203
#define AMDSMI_MAX_NUM_FREQUENCIES
Guaranteed maximum possible number of supported frequencies.
Definition: amdsmi.h:427
amdsmi_counter_command_t
Definition: amdsmi.h:570
@ AMDSMI_CNTR_CMD_STOP
be used before reading.
Definition: amdsmi.h:572
@ AMDSMI_CNTR_CMD_START
Start the counter.
Definition: amdsmi.h:571
amdsmi_power_profile_preset_masks_t
Pre-set Profile Selections. These bitmasks can be AND'd with the amdsmi_power_profile_status_t....
Definition: amdsmi.h:699
@ AMDSMI_PWR_PROF_PRST_COMPUTE_MASK
Compute Saving Profile.
Definition: amdsmi.h:703
@ AMDSMI_PWR_PROF_PRST_POWER_SAVING_MASK
Power Saving Profile.
Definition: amdsmi.h:702
@ AMDSMI_PWR_PROF_PRST_VIDEO_MASK
Video Power Profile.
Definition: amdsmi.h:701
@ AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT
Default Boot Up Profile.
Definition: amdsmi.h:708
@ AMDSMI_PWR_PROF_PRST_LAST
Invalid power profile.
Definition: amdsmi.h:709
@ AMDSMI_PWR_PROF_PRST_CUSTOM_MASK
Custom Power Profile.
Definition: amdsmi.h:700
@ AMDSMI_PWR_PROF_PRST_VR_MASK
VR Power Profile.
Definition: amdsmi.h:704
struct amdsmi_func_id_iter_handle * amdsmi_func_id_iter_handle_t
Opaque handle to function-support object.
Definition: amdsmi.h:1100
#define AMDSMI_NUM_VOLTAGE_CURVE_POINTS
The number of points that make up a voltage-frequency curve definition.
Definition: amdsmi.h:434
amdsmi_status_t amdsmi_next_func_iter(amdsmi_func_id_iter_handle_t handle)
Advance a function identifer iterator.
amdsmi_status_t amdsmi_dev_close_supported_func_iterator(amdsmi_func_id_iter_handle_t *handle)
Close a variant iterator handle.
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.
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.
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.
amdsmi_status_t amdsmi_get_socket_info(amdsmi_socket_handle socket_handle, char *name, size_t len)
Get information about the given socket.
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.
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.
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.
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.
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.
amdsmi_status_t amdsmi_status_string(amdsmi_status_t status, const char **status_string)
Get a description of a provided AMDSMI error status.
amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_device_handle device_handle, uint64_t *enabled_blocks)
Retrieve the enabled ECC bit-mask.
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.
amdsmi_status_t amdsmi_set_event_notification_mask(amdsmi_device_handle device_handle, uint64_t mask)
Specify which events to collect for a device.
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.
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.
amdsmi_status_t amdsmi_init_event_notification(amdsmi_device_handle device_handle)
Prepare to collect event notifications for a GPU.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
amdsmi_status_t amdsmi_shut_down(void)
Shutdown the AMD SMI library.
amdsmi_status_t amdsmi_init(uint64_t init_flags)
Initialize the AMD SMI library.
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.
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.
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.
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.
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.
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 buffe...
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.
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.
amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_device_handle device_handle, uint64_t *counter)
Get PCIe replay counter.
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.
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.
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.
amdsmi_status_t amdsmi_dev_destroy_counter(amdsmi_event_handle_t evnt_handle)
Deallocate a performance counter object.
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.
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.
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.
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.
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.
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 va...
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 p...
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.
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 p...
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 va...
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.
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.
amdsmi_status_t amdsmi_set_perf_determinism_mode(amdsmi_device_handle device_handle, uint64_t clkvalue)
Enter performance determinism mode with provided device handle.
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.
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.
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.
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.
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.
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.
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 activ...
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.
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.
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.
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.
amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_device_handle device_handle)
Reset the gpu associated with the device with provided device handle.
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.
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.
amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_device_handle device_handle, uint32_t sensor_ind)
Reset the fan to automatic driver control.
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.
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 t...
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.
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.
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 speci...
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.
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.
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.
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.
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.
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.
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.
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.
amdsmi_status_t amdsmi_get_version(amdsmi_version_t *version)
Get the build version information for the currently running build of AMDSMI.
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.
amdsmi_status_t amdsmi_dev_reset_xgmi_error(amdsmi_device_handle device_handle)
Reset the XGMI error status for a device.
amdsmi_status_t amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *info)
Returns the ASIC information for the device.
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.
amdsmi_status_t amdsmi_get_xgmi_info(amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *info)
Returns XGMI information for the GPU.
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.
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.
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.
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.
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.
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.
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....
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 percentag...
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 unit...
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.
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.
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...
amdsmi_status_t amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char *version)
Returns the driver version information.
The following structures hold the gpu metrics values for a device.
Definition: amdsmi.h:977
Definition: amdsmi.h:359
uint32_t family
Definition: amdsmi.h:361
Definition: amdsmi.h:369
Definition: amdsmi.h:389
Definition: amdsmi.h:579
uint64_t time_enabled
Definition: amdsmi.h:581
uint64_t time_running
Definition: amdsmi.h:583
uint64_t value
Counter value.
Definition: amdsmi.h:580
Definition: amdsmi.h:397
This structure holds error counts.
Definition: amdsmi.h:1072
uint64_t uncorrectable_count
Accumulated uncorrectable errors.
Definition: amdsmi.h:1074
uint64_t correctable_count
Accumulated correctable errors.
Definition: amdsmi.h:1073
Definition: amdsmi.h:611
amdsmi_evt_notification_type_t event
Event type.
Definition: amdsmi.h:613
amdsmi_device_handle device_handle
Handler of device that corresponds to the event.
Definition: amdsmi.h:612
This structure holds 2 amdsmi_range_t's, one for frequency and one for voltage. These 2 ranges indica...
Definition: amdsmi.h:937
amdsmi_range_t freq_range
The frequency range for this VDDC Curve point.
Definition: amdsmi.h:938
amdsmi_range_t volt_range
The voltage range for this VDDC Curve point.
Definition: amdsmi.h:939
This structure holds information about clock frequencies.
Definition: amdsmi.h:877
uint32_t current
Definition: amdsmi.h:886
uint32_t num_supported
Definition: amdsmi.h:881
Definition: amdsmi.h:315
Definition: amdsmi.h:349
Definition: amdsmi.h:290
Definition: amdsmi.h:1008
This structure represents a point on the frequency-voltage plane.
Definition: amdsmi.h:927
uint64_t frequency
Frequency coordinate (in Hz)
Definition: amdsmi.h:928
uint64_t voltage
Voltage coordinate (in mV)
Definition: amdsmi.h:929
Definition: amdsmi.h:945
This structure holds the frequency-voltage values for a device.
Definition: amdsmi.h:956
amdsmi_range_t curr_mclk_range
(upper bound only)
Definition: amdsmi.h:958
amdsmi_range_t mclk_freq_limits
The range possible of MCLK values.
Definition: amdsmi.h:961
uint32_t num_regions
The number of voltage curve regions.
Definition: amdsmi.h:967
amdsmi_range_t curr_sclk_range
The current SCLK frequency range.
Definition: amdsmi.h:957
amdsmi_range_t sclk_freq_limits
The range possible of SCLK values.
Definition: amdsmi.h:960
amdsmi_od_volt_curve_t curve
The current voltage curve.
Definition: amdsmi.h:966
This structure holds information about the possible PCIe bandwidths. Specifically,...
Definition: amdsmi.h:900
amdsmi_frequencies_t transfer_rate
Definition: amdsmi.h:904
This structure holds pcie info.
Definition: amdsmi.h:1081
Definition: amdsmi.h:331
Definition: amdsmi.h:379
This structure contains information about which power profiles are supported by the system for a give...
Definition: amdsmi.h:857
amdsmi_bit_field_t available_profiles
Definition: amdsmi.h:861
amdsmi_power_profile_preset_masks_t current
Definition: amdsmi.h:866
uint32_t num_profiles
Definition: amdsmi.h:871
Definition: amdsmi.h:406
This structure contains information specific to a process.
Definition: amdsmi.h:1089
uint64_t sdma_usage
SDMA usage in microseconds.
Definition: amdsmi.h:1093
uint32_t process_id
Process ID.
Definition: amdsmi.h:1090
uint32_t cu_occupancy
Compute Unit usage in percent.
Definition: amdsmi.h:1094
uint32_t pasid
PASID.
Definition: amdsmi.h:1091
uint64_t vram_usage
VRAM usage.
Definition: amdsmi.h:1092
This structure represents a range (e.g., frequencies or voltages).
Definition: amdsmi.h:273
uint64_t lower_bound
Lower bound of range.
Definition: amdsmi.h:274
uint64_t upper_bound
Upper bound of range.
Definition: amdsmi.h:275
Reserved Memory Page Record.
Definition: amdsmi.h:841
uint64_t page_size
Page size.
Definition: amdsmi.h:843
amdsmi_memory_page_status_t status
Page "reserved" status.
Definition: amdsmi.h:844
uint64_t page_address
Start address of page.
Definition: amdsmi.h:842
The utilization counter data.
Definition: amdsmi.h:833
uint64_t value
Utilization counter value.
Definition: amdsmi.h:835
AMDSMI_UTILIZATION_COUNTER_TYPE type
Utilization counter type.
Definition: amdsmi.h:834
Definition: amdsmi.h:340
This structure holds version information.
Definition: amdsmi.h:916
uint32_t minor
Minor version.
Definition: amdsmi.h:918
uint32_t patch
Patch, build or stepping version.
Definition: amdsmi.h:919
uint32_t major
Major version.
Definition: amdsmi.h:917
const char * build
Build string.
Definition: amdsmi.h:920
Definition: amdsmi.h:310
Definition: amdsmi.h:279
Definition: amdsmi.h:321
This union holds the value of an amdsmi_func_id_iter_handle_t. The value may be a function name,...
Definition: amdsmi.h:1111
amdsmi_event_type_t evnt_type
Used for amdsmi_event_group_t variants.
Definition: amdsmi.h:1120
const char * name
name string (applicable to functions only)
Definition: amdsmi.h:1113
amdsmi_clk_type_t clk_type
Used for amdsmi_fw_block_t variants.
Definition: amdsmi.h:1124
amdsmi_fw_block_t fw_block
Used for amdsmi_gpu_block_t variants.
Definition: amdsmi.h:1126
amdsmi_temperature_metric_t temp_metric
Used for amdsmi_event_type_t variants.
Definition: amdsmi.h:1118
amdsmi_event_group_t evnt_group
Used for amdsmi_clk_type_t variants.
Definition: amdsmi.h:1122
uint64_t id
uint64_t representation of value
Definition: amdsmi.h:1112
amdsmi_memory_type_t memory_type
< Used for amdsmi_memory_type_t variants
Definition: amdsmi.h:1116