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) 2023, 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 #ifdef ENABLE_ESMI_LIB
57  #include <e_smi/e_smi.h>
58 #endif
59 
60 #else
61 #include <stdint.h>
62 #endif // __cplusplus
63 
69 typedef enum {
71  AMDSMI_INIT_AMD_CPUS = (1 << 0),
72  AMDSMI_INIT_AMD_GPUS = (1 << 1),
73  AMDSMI_INIT_NON_AMD_CPUS = (1 << 2),
74  AMDSMI_INIT_NON_AMD_GPUS = (1 << 3),
75  AMDSMI_INIT_AMD_APUS = (AMDSMI_INIT_AMD_CPUS | AMDSMI_INIT_AMD_GPUS) // Default option
77 
78 /* Maximum size definitions AMDSMI */
79 #define AMDSMI_MAX_MM_IP_COUNT 8
80 #define AMDSMI_MAX_DATE_LENGTH 32
81 #define AMDSMI_MAX_STRING_LENGTH 64
82 #define AMDSMI_NORMAL_STRING_LENGTH 32
83 #define AMDSMI_MAX_DEVICES 32
84 #define AMDSMI_MAX_NAME 32
85 #define AMDSMI_MAX_DRIVER_VERSION_LENGTH 80
86 #define AMDSMI_PRODUCT_NAME_LENGTH 128
87 #define AMDSMI_MAX_CONTAINER_TYPE 2
88 #define AMDSMI_MAX_CACHE_TYPES 10
89 #define AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK 64
90 
91 #define AMDSMI_GPU_UUID_SIZE 38
92 
100 #define CENTRIGRADE_TO_MILLI_CENTIGRADE 1000
101 
105 #define AMDSMI_NUM_HBM_INSTANCES 4
106 
110 #define AMDSMI_MAX_NUM_VCN 4
111 
115 #define AMDSMI_MAX_NUM_CLKS 4
116 
120 #define AMDSMI_MAX_NUM_XGMI_LINKS 8
121 
125 #define AMDSMI_MAX_NUM_GFX_CLKS 8
126 
130 #define AMDSMI_MAX_AID 4
131 
135 #define AMDSMI_MAX_ENGINES 8
136 
140 #define AMDSMI_MAX_NUM_JPEG 32
141 
142 /* string format */
143 #define AMDSMI_TIME_FORMAT "%02d:%02d:%02d.%03d"
144 #define AMDSMI_DATE_FORMAT "%04d-%02d-%02d:%02d:%02d:%02d.%03d"
145 
151 #define AMDSMI_LIB_VERSION_YEAR 24
152 
154 #define AMDSMI_LIB_VERSION_MAJOR 5
155 
157 #define AMDSMI_LIB_VERSION_MINOR 1
158 
160 #define AMDSMI_LIB_VERSION_RELEASE 0
161 
162 #define AMDSMI_LIB_VERSION_CREATE_STRING(YEAR, MAJOR, MINOR, RELEASE) (#YEAR "." #MAJOR "." #MINOR "." #RELEASE)
163 #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)
164 #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)
165 
166 typedef enum {
167  AMDSMI_MM_UVD,
168  AMDSMI_MM_VCE,
169  AMDSMI_MM_VCN,
170  AMDSMI_MM__MAX
171 } amdsmi_mm_ip_t;
172 
173 typedef enum {
174  CONTAINER_LXC,
175  CONTAINER_DOCKER,
176 } amdsmi_container_types_t;
177 
180 typedef void *amdsmi_socket_handle;
181 #ifdef ENABLE_ESMI_LIB
182 typedef void *amdsmi_cpusocket_handle;
183 #endif
184 
191 typedef enum {
192  UNKNOWN = 0,
193  AMD_GPU,
194  AMD_CPU,
195  NON_AMD_GPU,
196  NON_AMD_CPU,
197  AMD_CPU_CORE,
198  AMD_APU
200 
204 // Please avoid status codes that are multiples of 256 (256, 512, etc..)
205 // Return values in the shell get modulo 256 applied, meaning any multiple of 256 ends up as 0
206 typedef enum {
208  // Library usage errors
228  // Device related errors
234  // Data and size errors
239  //esmi errors
252 
253  // General errors
254  AMDSMI_STATUS_MAP_ERROR = 0xFFFFFFFE,
257 
261 typedef enum {
262  CLK_TYPE_SYS = 0x0,
263  CLK_TYPE_FIRST = CLK_TYPE_SYS,
264  CLK_TYPE_GFX = CLK_TYPE_SYS,
265  CLK_TYPE_DF,
268  CLK_TYPE_SOC,
269  CLK_TYPE_MEM,
270  CLK_TYPE_PCIE,
271  CLK_TYPE_VCLK0,
272  CLK_TYPE_VCLK1,
273  CLK_TYPE_DCLK0,
274  CLK_TYPE_DCLK1,
275  CLK_TYPE__MAX = CLK_TYPE_DCLK1
277 
282 typedef enum {
283  COMPUTE_PARTITION_INVALID = 0,
295 
300 typedef enum {
301  MEMORY_PARTITION_UNKNOWN = 0,
316 
321 typedef enum {
322  TEMPERATURE_TYPE_EDGE,
323  TEMPERATURE_TYPE_FIRST = TEMPERATURE_TYPE_EDGE,
324  TEMPERATURE_TYPE_HOTSPOT,
325  TEMPERATURE_TYPE_JUNCTION = TEMPERATURE_TYPE_HOTSPOT,
326  TEMPERATURE_TYPE_VRAM,
327  TEMPERATURE_TYPE_HBM_0,
328  TEMPERATURE_TYPE_HBM_1,
329  TEMPERATURE_TYPE_HBM_2,
330  TEMPERATURE_TYPE_HBM_3,
331  TEMPERATURE_TYPE_PLX,
332  TEMPERATURE_TYPE__MAX = TEMPERATURE_TYPE_PLX
334 
339 typedef enum {
340  FW_ID_SMU = 1,
341  FW_ID_FIRST = FW_ID_SMU,
342  FW_ID_CP_CE,
343  FW_ID_CP_PFP,
344  FW_ID_CP_ME,
345  FW_ID_CP_MEC_JT1,
346  FW_ID_CP_MEC_JT2,
347  FW_ID_CP_MEC1,
348  FW_ID_CP_MEC2,
349  FW_ID_RLC,
350  FW_ID_SDMA0,
351  FW_ID_SDMA1,
352  FW_ID_SDMA2,
353  FW_ID_SDMA3,
354  FW_ID_SDMA4,
355  FW_ID_SDMA5,
356  FW_ID_SDMA6,
357  FW_ID_SDMA7,
358  FW_ID_VCN,
359  FW_ID_UVD,
360  FW_ID_VCE,
361  FW_ID_ISP,
362  FW_ID_DMCU_ERAM, /*eRAM*/
363  FW_ID_DMCU_ISR, /*ISR*/
364  FW_ID_RLC_RESTORE_LIST_GPM_MEM,
365  FW_ID_RLC_RESTORE_LIST_SRM_MEM,
366  FW_ID_RLC_RESTORE_LIST_CNTL,
367  FW_ID_RLC_V,
368  FW_ID_MMSCH,
369  FW_ID_PSP_SYSDRV,
370  FW_ID_PSP_SOSDRV,
371  FW_ID_PSP_TOC,
372  FW_ID_PSP_KEYDB,
373  FW_ID_DFC,
374  FW_ID_PSP_SPL,
375  FW_ID_DRV_CAP,
376  FW_ID_MC,
377  FW_ID_PSP_BL,
378  FW_ID_CP_PM4,
379  FW_ID_RLC_P,
380  FW_ID_SEC_POLICY_STAGE2,
381  FW_ID_REG_ACCESS_WHITELIST,
382  FW_ID_IMU_DRAM,
383  FW_ID_IMU_IRAM,
384  FW_ID_SDMA_TH0,
385  FW_ID_SDMA_TH1,
386  FW_ID_CP_MES,
387  FW_ID_MES_KIQ,
388  FW_ID_MES_STACK,
389  FW_ID_MES_THREAD1,
390  FW_ID_MES_THREAD1_STACK,
391  FW_ID_RLX6,
392  FW_ID_RLX6_DRAM_BOOT,
393  FW_ID_RS64_ME,
394  FW_ID_RS64_ME_P0_DATA,
395  FW_ID_RS64_ME_P1_DATA,
396  FW_ID_RS64_PFP,
397  FW_ID_RS64_PFP_P0_DATA,
398  FW_ID_RS64_PFP_P1_DATA,
399  FW_ID_RS64_MEC,
400  FW_ID_RS64_MEC_P0_DATA,
401  FW_ID_RS64_MEC_P1_DATA,
402  FW_ID_RS64_MEC_P2_DATA,
403  FW_ID_RS64_MEC_P3_DATA,
404  FW_ID_PPTABLE,
405  FW_ID_PSP_SOC,
406  FW_ID_PSP_DBG,
407  FW_ID_PSP_INTF,
408  FW_ID_RLX6_CORE1,
409  FW_ID_RLX6_DRAM_BOOT_CORE1,
410  FW_ID_RLCV_LX7,
411  FW_ID_RLC_SAVE_RESTORE_LIST,
412  FW_ID_ASD,
413  FW_ID_TA_RAS,
414  FW_ID_TA_XGMI,
415  FW_ID_RLC_SRLG,
416  FW_ID_RLC_SRLS,
417  FW_ID_PM,
418  FW_ID_DMCU,
419  FW_ID__MAX
421 
422 
423 typedef enum {
424  VRAM_TYPE_UNKNOWN = 0,
425  VRAM_TYPE_GDDR1 = 1,
426  VRAM_TYPE_DDR2 = 2,
427  VRAM_TYPE_GDDR3 = 3,
428  VRAM_TYPE_GDDR4 = 4,
429  VRAM_TYPE_GDDR5 = 5,
430  VRAM_TYPE_HBM = 6,
431  VRAM_TYPE_DDR3 = 7,
432  VRAM_TYPE_DDR4 = 8,
433  VRAM_TYPE_GDDR6 = 9,
434  VRAM_TYPE__MAX = VRAM_TYPE_GDDR6
435 } amdsmi_vram_type_t;
436 
437 typedef enum {
438  AMDSMI_VRAM_VENDOR__PLACEHOLDER0,
439  AMDSMI_VRAM_VENDOR__SAMSUNG,
440  AMDSMI_VRAM_VENDOR__INFINEON,
441  AMDSMI_VRAM_VENDOR__ELPIDA,
442  AMDSMI_VRAM_VENDOR__ETRON,
443  AMDSMI_VRAM_VENDOR__NANYA,
444  AMDSMI_VRAM_VENDOR__HYNIX,
445  AMDSMI_VRAM_VENDOR__MOSEL,
446  AMDSMI_VRAM_VENDOR__WINBOND,
447  AMDSMI_VRAM_VENDOR__ESMT,
448  AMDSMI_VRAM_VENDOR__PLACEHOLDER1,
449  AMDSMI_VRAM_VENDOR__PLACEHOLDER2,
450  AMDSMI_VRAM_VENDOR__PLACEHOLDER3,
451  AMDSMI_VRAM_VENDOR__PLACEHOLDER4,
452  AMDSMI_VRAM_VENDOR__PLACEHOLDER5,
453  AMDSMI_VRAM_VENDOR__MICRON,
454 } amdsmi_vram_vendor_type_t;
455 
459 typedef struct {
460  uint64_t lower_bound;
461  uint64_t upper_bound;
462  uint64_t reserved[2];
464 
465 typedef struct {
466  uint8_t xgmi_lanes;
467  uint64_t xgmi_hive_id;
468  uint64_t xgmi_node_id;
469  uint32_t index;
470  uint32_t reserved[9];
472 
473 typedef struct {
474  uint32_t vram_total;
475  uint32_t vram_used;
476  uint32_t reserved[2];
478 
479 typedef struct {
480  amdsmi_range_t supported_freq_range;
481  amdsmi_range_t current_freq_range;
482  uint32_t reserved[8];
484 
485 typedef union {
486  struct fields_ {
487  uint64_t function_number : 3;
488  uint64_t device_number : 5;
489  uint64_t bus_number : 8;
490  uint64_t domain_number : 48;
491  } fields;
492  uint64_t as_uint;
493 } amdsmi_bdf_t;
494 
495 typedef enum {
496  AMDSMI_CARD_FORM_FACTOR_PCIE,
497  AMDSMI_CARD_FORM_FACTOR_OAM,
498  AMDSMI_CARD_FORM_FACTOR_UNKNOWN
499 } amdsmi_card_form_factor_t;
500 
501 typedef struct {
502  struct pcie_static_ {
503  uint16_t max_pcie_width;
504  uint32_t max_pcie_speed;
506  amdsmi_card_form_factor_t slot_type;
507  uint64_t reserved[10];
508  } pcie_static;
509  struct pcie_metric_ {
510  uint16_t pcie_width;
511  uint32_t pcie_speed;
512  uint32_t pcie_bandwidth;
513  uint64_t pcie_replay_count;
518  uint64_t reserved[13];
519  } pcie_metric;
520  uint64_t reserved[32];
522 
523 typedef struct {
524  uint64_t power_cap;
525  uint64_t default_power_cap;
526  uint64_t dpm_cap;
527  uint64_t min_power_cap;
528  uint64_t max_power_cap;
529  uint64_t reserved[3];
531 
532 typedef struct {
533  char name[AMDSMI_MAX_STRING_LENGTH];
534  char build_date[AMDSMI_MAX_DATE_LENGTH];
535  char part_number[AMDSMI_MAX_STRING_LENGTH];
536  char version[AMDSMI_NORMAL_STRING_LENGTH];
537  uint32_t reserved[16];
539 
543 typedef enum {
544  AMDSMI_CACHE_PROPERTY_ENABLED = 0x00000001,
545  AMDSMI_CACHE_PROPERTY_DATA_CACHE = 0x00000002,
546  AMDSMI_CACHE_PROPERTY_INST_CACHE = 0x00000004,
547  AMDSMI_CACHE_PROPERTY_CPU_CACHE = 0x00000008,
548  AMDSMI_CACHE_PROPERTY_SIMD_CACHE = 0x00000010,
550 
551 typedef struct {
552  uint32_t num_cache_types;
553  struct cache_ {
554  uint32_t cache_properties; // amdsmi_cache_property_type_t which is a bitmask
555  uint32_t cache_size; /* In KB */
556  uint32_t cache_level;
557  uint32_t max_num_cu_shared; /* Indicates how many Compute Units share this cache instance */
558  uint32_t num_cache_instance; /* total number of instance of this cache type */
559  uint32_t reserved[3];
560  } cache[AMDSMI_MAX_CACHE_TYPES];
561  uint32_t reserved[15];
563 
564 typedef struct {
565  uint8_t num_fw_info;
566  struct fw_info_list_ {
567  amdsmi_fw_block_t fw_id;
568  uint64_t fw_version;
569  uint64_t reserved[2];
570  } fw_info_list[FW_ID__MAX];
571  uint32_t reserved[7];
573 
574 typedef struct {
575  char market_name[AMDSMI_MAX_STRING_LENGTH];
576  uint32_t vendor_id; //< Use 32 bit to be compatible with other platform.
577  char vendor_name[AMDSMI_MAX_STRING_LENGTH];
578  uint32_t subvendor_id; //< The subsystem vendor id
579  uint64_t device_id; //< The device id of a GPU
580  uint32_t rev_id;
581  char asic_serial[AMDSMI_NORMAL_STRING_LENGTH];
582  uint16_t oam_id; //< 0xFFFF if not supported
583  uint16_t reserved[37];
585 
586 typedef enum {
587  AMDSMI_LINK_TYPE_PCIE,
588  AMDSMI_LINK_TYPE_XGMI,
589  AMDSMI_LINK_TYPE_NOT_APPLICABLE,
590  AMDSMI_LINK_TYPE_UNKNOWN
591 } amdsmi_link_type_t;
592 
593 typedef struct {
594  uint32_t num_links;
595  struct _links {
596  amdsmi_bdf_t bdf;
597  uint32_t bit_rate;
598  uint32_t max_bandwidth;
599  amdsmi_link_type_t link_type;
600  uint64_t read;
601  uint64_t write;
602  uint64_t reserved[2];
603  } links[AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK];
604  uint64_t reserved[7];
606 
607 typedef struct {
608  amdsmi_vram_type_t vram_type;
609  amdsmi_vram_vendor_type_t vram_vendor;
610  uint64_t vram_size_mb;
612 
613 
614 typedef struct {
615  char driver_version[AMDSMI_MAX_STRING_LENGTH];
616  char driver_date[AMDSMI_MAX_STRING_LENGTH];
617  char driver_name[AMDSMI_MAX_STRING_LENGTH];
619 
620 typedef struct {
621  char model_number[AMDSMI_NORMAL_STRING_LENGTH];
622  char product_serial[AMDSMI_NORMAL_STRING_LENGTH];
623  char fru_id[AMDSMI_NORMAL_STRING_LENGTH];
624  char product_name[AMDSMI_PRODUCT_NAME_LENGTH];
625  char manufacturer_name[AMDSMI_NORMAL_STRING_LENGTH];
626  uint32_t reserved[32];
628 
629 typedef struct {
630  uint32_t current_socket_power;
631  uint32_t average_socket_power;
632  uint32_t gfx_voltage; // GFX voltage measurement in mV
633  uint32_t soc_voltage; // SOC voltage measurement in mV
634  uint32_t mem_voltage; // MEM voltage measurement in mV
635  uint32_t power_limit; // The power limit;
636  uint32_t reserved[11];
638 
639 typedef struct {
640  uint32_t cur_clk;
641  uint32_t min_clk;
642  uint32_t max_clk;
643  uint32_t sleep_clk;
644  uint32_t reserved[4];
646 
653 typedef struct {
654  uint32_t gfx_activity;
655  uint32_t umc_activity;
656  uint32_t mm_activity;
657  uint32_t reserved[13];
659 
660 typedef uint32_t amdsmi_process_handle_t;
661 
662 typedef struct {
663  char name[AMDSMI_NORMAL_STRING_LENGTH];
664  amdsmi_process_handle_t pid;
665  uint64_t mem;
666  struct engine_usage_ {
667  uint64_t gfx;
668  uint64_t enc;
669  uint32_t reserved[12];
670  } engine_usage;
671  struct memory_usage_ {
672  uint64_t gtt_mem;
673  uint64_t cpu_mem;
674  uint64_t vram_mem;
675  uint32_t reserved[10];
676  } memory_usage;
677  char container_name[AMDSMI_NORMAL_STRING_LENGTH];
678  uint32_t reserved[4];
680 
682 #define AMDSMI_MAX_NUM_FREQUENCIES 33
683 
686 #define AMDSMI_MAX_FAN_SPEED 255
687 
689 #define AMDSMI_NUM_VOLTAGE_CURVE_POINTS 3
693 typedef enum {
695  AMDSMI_DEV_PERF_LEVEL_FIRST = AMDSMI_DEV_PERF_LEVEL_AUTO,
696 
711 
712  AMDSMI_DEV_PERF_LEVEL_LAST = AMDSMI_DEV_PERF_LEVEL_DETERMINISM,
713 
716 
729 typedef uintptr_t amdsmi_event_handle_t;
730 
737 typedef enum {
740  AMDSMI_EVNT_GRP_INVALID = 0xFFFFFFFF
742 
749 typedef enum {
750  AMDSMI_EVNT_FIRST = AMDSMI_EVNT_GRP_XGMI,
751 
752  AMDSMI_EVNT_XGMI_FIRST = AMDSMI_EVNT_GRP_XGMI,
753  AMDSMI_EVNT_XGMI_0_NOP_TX = AMDSMI_EVNT_XGMI_FIRST,
758 
771  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
781 
782  AMDSMI_EVNT_XGMI_LAST = AMDSMI_EVNT_XGMI_1_BEATS_TX, // 5
783 
784  AMDSMI_EVNT_XGMI_DATA_OUT_FIRST = AMDSMI_EVNT_GRP_XGMI_DATA_OUT, // 10
785 
786  /*
787  * @brief Events in the AMDSMI_EVNT_GRP_XGMI_DATA_OUT group measure
788  * the number of beats sent on an XGMI link. Each beat represents
789  * 32 bytes. AMDSMI_EVNT_XGMI_DATA_OUT_n represents the number of
790  * outbound beats (each representing 32 bytes) on link n.<br><br>
791  *
792  * XGMI throughput can be calculated by multiplying a event
793  * such as ::AMDSMI_EVNT_XGMI_DATA_OUT_n by 32 and dividing by
794  * the time for which event collection occurred,
795  * ::amdsmi_counter_value_t.time_running (which is in nanoseconds). To get
796  * bytes per second, multiply this value by 10<sup>9</sup>.<br>
797  * <br>
798  * Throughput = BEATS/time_running * 10<sup>9</sup> (bytes/second)<br>
799  */
800  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
801  AMDSMI_EVNT_XGMI_DATA_OUT_0 = AMDSMI_EVNT_XGMI_DATA_OUT_FIRST,
807  AMDSMI_EVNT_XGMI_DATA_OUT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_5,
808 
809  AMDSMI_EVNT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_LAST,
811 
815 typedef enum {
820 
824 typedef struct {
825  uint64_t value;
826  uint64_t time_enabled;
828  uint64_t time_running;
831 
835 typedef enum {
837  AMDSMI_EVT_NOTIF_FIRST = AMDSMI_EVT_NOTIF_VMFAULT,
838  AMDSMI_EVT_NOTIF_THERMAL_THROTTLE = 2,
839  AMDSMI_EVT_NOTIF_GPU_PRE_RESET = 3,
840  AMDSMI_EVT_NOTIF_GPU_POST_RESET = 4,
841 
842  AMDSMI_EVT_NOTIF_LAST = AMDSMI_EVT_NOTIF_GPU_POST_RESET
844 
848 #define AMDSMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
849 
851 #define MAX_EVENT_NOTIFICATION_MSG_SIZE 64
852 
856 typedef struct {
861 
867 typedef enum {
869  AMDSMI_TEMP_FIRST = AMDSMI_TEMP_CURRENT,
870 
901 
902  AMDSMI_TEMP_LAST = AMDSMI_TEMP_HIGHEST
904 
910 typedef enum {
912 
913  AMDSMI_VOLT_FIRST = AMDSMI_VOLT_CURRENT,
921 
922  AMDSMI_VOLT_LAST = AMDSMI_VOLT_HIGHEST
924 
929 typedef enum {
930  AMDSMI_VOLT_TYPE_FIRST = 0,
931 
932  AMDSMI_VOLT_TYPE_VDDGFX = AMDSMI_VOLT_TYPE_FIRST,
934  AMDSMI_VOLT_TYPE_LAST = AMDSMI_VOLT_TYPE_VDDGFX,
935  AMDSMI_VOLT_TYPE_INVALID = 0xFFFFFFFF
937 
944 typedef enum {
950 
952  AMDSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK = 0x20,
955 
957  AMDSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF
959 
963 typedef enum {
964  AMDSMI_GPU_BLOCK_INVALID = 0x0000000000000000,
966  AMDSMI_GPU_BLOCK_FIRST = 0x0000000000000001,
967 
968  AMDSMI_GPU_BLOCK_UMC = AMDSMI_GPU_BLOCK_FIRST,
969  AMDSMI_GPU_BLOCK_SDMA = 0x0000000000000002,
970  AMDSMI_GPU_BLOCK_GFX = 0x0000000000000004,
971  AMDSMI_GPU_BLOCK_MMHUB = 0x0000000000000008,
972  AMDSMI_GPU_BLOCK_ATHUB = 0x0000000000000010,
973  AMDSMI_GPU_BLOCK_PCIE_BIF = 0x0000000000000020,
974  AMDSMI_GPU_BLOCK_HDP = 0x0000000000000040,
975  AMDSMI_GPU_BLOCK_XGMI_WAFL = 0x0000000000000080,
976  AMDSMI_GPU_BLOCK_DF = 0x0000000000000100,
977  AMDSMI_GPU_BLOCK_SMN = 0x0000000000000200,
978  AMDSMI_GPU_BLOCK_SEM = 0x0000000000000400,
979  AMDSMI_GPU_BLOCK_MP0 = 0x0000000000000800,
980  AMDSMI_GPU_BLOCK_MP1 = 0x0000000000001000,
981  AMDSMI_GPU_BLOCK_FUSE = 0x0000000000002000,
982 
985  AMDSMI_GPU_BLOCK_RESERVED = 0x8000000000000000
987 
991 typedef enum {
1000 
1001  AMDSMI_RAS_ERR_STATE_LAST = AMDSMI_RAS_ERR_STATE_ENABLED,
1002  AMDSMI_RAS_ERR_STATE_INVALID = 0xFFFFFFFF
1004 
1008 typedef enum {
1009  AMDSMI_MEM_TYPE_FIRST = 0,
1010 
1011  AMDSMI_MEM_TYPE_VRAM = AMDSMI_MEM_TYPE_FIRST,
1014 
1015  AMDSMI_MEM_TYPE_LAST = AMDSMI_MEM_TYPE_GTT
1017 
1021 typedef enum {
1024  AMDSMI_FREQ_IND_INVALID = 0xFFFFFFFF
1026 
1030 typedef enum {
1031  AMDSMI_XGMI_STATUS_NO_ERRORS = 0,
1032  AMDSMI_XGMI_STATUS_ERROR,
1033  AMDSMI_XGMI_STATUS_MULTIPLE_ERRORS,
1035 
1039 typedef uint64_t amdsmi_bit_field_t;
1040 
1044 typedef enum {
1052 
1056 typedef enum {
1061  AMDSMI_IOLINK_TYPE_SIZE = 0xFFFFFFFF
1063 
1067 typedef enum {
1070  AMDSMI_COARSE_GRAIN_GFX_ACTIVITY = AMDSMI_UTILIZATION_COUNTER_FIRST,
1072  AMDSMI_UTILIZATION_COUNTER_LAST = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY
1074 
1078 typedef enum {
1081  AMDSMI_INVALID_POWER = 0xFFFFFFFF
1083 
1087 typedef struct {
1089  uint64_t value;
1091 
1095 typedef struct {
1096  uint64_t page_address;
1097  uint64_t page_size;
1100 
1104 #define AMDSMI_MAX_NUM_POWER_PROFILES (sizeof(amdsmi_bit_field_t) * 8)
1105 
1111 typedef struct {
1116 
1121 
1125  uint32_t num_profiles;
1127 
1131 typedef struct {
1136 
1140  uint32_t num_supported;
1141 
1145  uint32_t current;
1146 
1151  uint64_t frequency[AMDSMI_MAX_NUM_FREQUENCIES];
1153 
1157 typedef struct {
1158  uint32_t policy_id;
1159  char policy_description[AMDSMI_MAX_NAME];
1161 
1162 #define AMDSMI_MAX_NUM_PM_POLICIES 32
1163 
1167 typedef struct {
1171  uint32_t num_supported;
1172 
1176  uint32_t current;
1177 
1182  amdsmi_dpm_policy_entry_t policies[AMDSMI_MAX_NUM_PM_POLICIES];
1184 
1190 typedef struct {
1195 
1202 
1206 typedef struct {
1207  uint32_t year;
1208  uint32_t major;
1209  uint32_t minor;
1210  uint32_t release;
1211  const char *build;
1213 
1217 typedef struct {
1218  uint64_t frequency;
1219  uint64_t voltage;
1221 
1227 typedef struct {
1231 
1235 typedef struct {
1242 
1246 typedef struct {
1252 
1257  uint32_t num_regions;
1259 
1267 typedef struct {
1268  // TODO(amd) Doxygen documents
1269  // Note: This should match: AMDGpuMetricsHeader_v1_t
1271  uint16_t structure_size;
1272  uint8_t format_revision;
1273  uint8_t content_revision;
1276 
1277 typedef struct {
1278  // TODO(amd) Doxygen documents
1279  // Note: This structure is extended to fit the needs of different GPU metric
1280  // versions when exposing data through the structure.
1281  // Depending on the version, some data members will hold data, and
1282  // some will not. A good example is the set of 'current clocks':
1283  // - current_gfxclk, current_socclk, current_vclk0, current_dclk0
1284  // These are single-valued data members, up to version 1.3.
1285  // For version 1.4 and up these are multi-valued data members (arrays)
1286  // and their counterparts;
1287  // - current_gfxclks[], current_socclks[], current_vclk0s[],
1288  // current_dclk0s[]
1289  // will hold the data
1291  amd_metrics_table_header_t common_header;
1292 
1293  /*
1294  * v1.0 Base
1295  */
1296  // Temperature (C)
1297  uint16_t temperature_edge;
1298  uint16_t temperature_hotspot;
1299  uint16_t temperature_mem;
1300  uint16_t temperature_vrgfx;
1301  uint16_t temperature_vrsoc;
1302  uint16_t temperature_vrmem;
1303 
1304  // Utilization (%)
1305  uint16_t average_gfx_activity;
1306  uint16_t average_umc_activity; // memory controller
1307  uint16_t average_mm_activity; // UVD or VCN
1308 
1309  // Power (W) /Energy (15.259uJ per 1ns)
1310  uint16_t average_socket_power;
1311  uint64_t energy_accumulator; // v1 mod. (32->64)
1312 
1313  // Driver attached timestamp (in ns)
1314  uint64_t system_clock_counter; // v1 mod. (moved from top of struct)
1315 
1316  // Average clocks (MHz)
1317  uint16_t average_gfxclk_frequency;
1318  uint16_t average_socclk_frequency;
1319  uint16_t average_uclk_frequency;
1320  uint16_t average_vclk0_frequency;
1321  uint16_t average_dclk0_frequency;
1322  uint16_t average_vclk1_frequency;
1323  uint16_t average_dclk1_frequency;
1324 
1325  // Current clocks (MHz)
1326  uint16_t current_gfxclk;
1327  uint16_t current_socclk;
1328  uint16_t current_uclk;
1329  uint16_t current_vclk0;
1330  uint16_t current_dclk0;
1331  uint16_t current_vclk1;
1332  uint16_t current_dclk1;
1333 
1334  // Throttle status
1335  uint32_t throttle_status;
1336 
1337  // Fans (RPM)
1338  uint16_t current_fan_speed;
1339 
1340  // Link width (number of lanes) /speed (0.1 GT/s)
1341  uint16_t pcie_link_width; // v1 mod.(8->16)
1342  uint16_t pcie_link_speed; // in 0.1 GT/s; v1 mod. (8->16)
1343 
1344 
1345  /*
1346  * v1.1 additions
1347  */
1348  uint32_t gfx_activity_acc; // new in v1
1349  uint32_t mem_activity_acc; // new in v1
1350  uint16_t temperature_hbm[AMDSMI_NUM_HBM_INSTANCES]; // new in v1
1351 
1352 
1353  /*
1354  * v1.2 additions
1355  */
1356  // PMFW attached timestamp (10ns resolution)
1357  uint64_t firmware_timestamp;
1358 
1359 
1360  /*
1361  * v1.3 additions
1362  */
1363  // Voltage (mV)
1364  uint16_t voltage_soc;
1365  uint16_t voltage_gfx;
1366  uint16_t voltage_mem;
1367 
1368  // Throttle status
1369  uint64_t indep_throttle_status;
1370 
1371 
1372  /*
1373  * v1.4 additions
1374  */
1375  // Power (Watts)
1376  uint16_t current_socket_power;
1377 
1378  // Utilization (%)
1379  uint16_t vcn_activity[AMDSMI_MAX_NUM_VCN];
1380 
1381  // Clock Lock Status. Each bit corresponds to clock instance
1382  uint32_t gfxclk_lock_status;
1383 
1384  // XGMI bus width and bitrate (in GB/s)
1385  uint16_t xgmi_link_width;
1386  uint16_t xgmi_link_speed;
1387 
1388  // PCIe accumulated bandwidth (GB/sec)
1389  uint64_t pcie_bandwidth_acc;
1390 
1391  // PCIe instantaneous bandwidth (GB/sec)
1392  uint64_t pcie_bandwidth_inst;
1393 
1394  // PCIE L0 to recovery state transition accumulated count
1395  uint64_t pcie_l0_to_recov_count_acc;
1396 
1397  // PCIE replay accumulated count
1398  uint64_t pcie_replay_count_acc;
1399 
1400  // PCIE replay rollover accumulated count
1401  uint64_t pcie_replay_rover_count_acc;
1402 
1403  // XGMI accumulated data transfer size (KB)
1404  uint64_t xgmi_read_data_acc[AMDSMI_MAX_NUM_XGMI_LINKS];
1405  uint64_t xgmi_write_data_acc[AMDSMI_MAX_NUM_XGMI_LINKS];
1406 
1407  // Current clock frequencies (MHz)
1408  uint16_t current_gfxclks[AMDSMI_MAX_NUM_GFX_CLKS];
1409  uint16_t current_socclks[AMDSMI_MAX_NUM_CLKS];
1410  uint16_t current_vclk0s[AMDSMI_MAX_NUM_CLKS];
1411  uint16_t current_dclk0s[AMDSMI_MAX_NUM_CLKS];
1412 
1413  /*
1414  * v1.5 additions
1415  */
1416  // JPEG activity % per AID
1417  uint16_t jpeg_activity[AMDSMI_MAX_NUM_JPEG];
1418 
1419  // PCIE NAK sent accumulated count
1420  uint32_t pcie_nak_sent_count_acc;
1421 
1422  // PCIE NAK received accumulated count
1423  uint32_t pcie_nak_rcvd_count_acc;
1426 
1427 
1428 #define MAX_AMDSMI_NAME_LENGTH 64
1429 
1433 typedef struct {
1434  char name[MAX_AMDSMI_NAME_LENGTH];
1435  uint64_t value;
1437 
1441 typedef enum {
1442  AMDSMI_REG_XGMI,
1443  AMDSMI_REG_WAFL,
1444  AMDSMI_REG_PCIE,
1445  AMDSMI_REG_USR,
1446  AMDSMI_REG_USR1,
1448 
1452 typedef struct {
1453  uint32_t ras_eeprom_version;
1454  // PARITY error(bit 0), Single Bit correctable (bit1),
1455  // Double bit error detection (bit2), Poison (bit 3).
1458 
1462 typedef struct {
1465  uint64_t deferred_count;
1466  uint64_t reserved[5];
1468 
1472 typedef struct {
1473  uint32_t process_id;
1474  uint32_t pasid;
1475  uint64_t vram_usage;
1476  uint64_t sdma_usage;
1477  uint32_t cu_occupancy;
1479 
1482 #define AMDSMI_DEFAULT_VARIANT 0xFFFFFFFFFFFFFFFF
1483 
1484 #ifdef ENABLE_ESMI_LIB
1488 typedef struct {
1489  uint8_t debug;
1490  uint8_t minor;
1491  uint8_t major;
1492  uint8_t unused;
1494 
1498 typedef struct {
1499  uint32_t max_bw;
1500  uint32_t utilized_bw;
1501  uint32_t utilized_pct;
1503 
1507 typedef struct {
1508  uint8_t range : 3;
1509  uint8_t ref_rate : 1;
1511 
1515 typedef struct {
1516  uint16_t power : 15;
1517  uint16_t update_rate : 9;
1518  uint8_t dimm_addr;
1520 
1524 typedef struct {
1525  uint16_t sensor : 11;
1526  uint16_t update_rate : 9;
1527  uint8_t dimm_addr;
1528  float temp;
1530 
1534 typedef enum {
1535  AGG_BW0 = 1,
1536  RD_BW0 = 2,
1537  WR_BW0 = 4
1539 
1547 typedef struct {
1549  char *link_name;
1551 
1556 typedef struct {
1557  uint8_t max_dpm_level;
1558  uint8_t min_dpm_level;
1560 
1564 typedef struct __attribute__((__packed__)){
1565  uint32_t accumulation_counter;
1566 
1567  /* TEMPERATURE */
1568  uint32_t max_socket_temperature;
1569  uint32_t max_vr_temperature;
1570  uint32_t max_hbm_temperature;
1571  uint64_t max_socket_temperature_acc;
1572  uint64_t max_vr_temperature_acc;
1573  uint64_t max_hbm_temperature_acc;
1574 
1575  /* POWER */
1576  uint32_t socket_power_limit;
1577  uint32_t max_socket_power_limit;
1578  uint32_t socket_power;
1579 
1580  /* ENERGY */
1581  uint64_t timestamp;
1582  uint64_t socket_energy_acc;
1583  uint64_t ccd_energy_acc;
1584  uint64_t xcd_energy_acc;
1585  uint64_t aid_energy_acc;
1586  uint64_t hbm_energy_acc;
1587 
1588  /* FREQUENCY */
1589  uint32_t cclk_frequency_limit;
1590  uint32_t gfxclk_frequency_limit;
1591  uint32_t fclk_frequency;
1592  uint32_t uclk_frequency;
1593  uint32_t socclk_frequency[4];
1594  uint32_t vclk_frequency[4];
1595  uint32_t dclk_frequency[4];
1596  uint32_t lclk_frequency[4];
1597  uint64_t gfxclk_frequency_acc[8];
1598  uint64_t cclk_frequency_acc[96];
1599 
1600  /* FREQUENCY RANGE */
1601  uint32_t max_cclk_frequency;
1602  uint32_t min_cclk_frequency;
1603  uint32_t max_gfxclk_frequency;
1604  uint32_t min_gfxclk_frequency;
1605  uint32_t fclk_frequency_table[4];
1606  uint32_t uclk_frequency_table[4];
1607  uint32_t socclk_frequency_table[4];
1608  uint32_t vclk_frequency_table[4];
1609  uint32_t dclk_frequency_table[4];
1610  uint32_t lclk_frequency_table[4];
1611  uint32_t max_lclk_dpm_range;
1612  uint32_t min_lclk_dpm_range;
1613 
1614  /* XGMI */
1615  uint32_t xgmi_width;
1616  uint32_t xgmi_bitrate;
1617  uint64_t xgmi_read_bandwidth_acc[8];
1618  uint64_t xgmi_write_bandwidth_acc[8];
1619 
1620  /* ACTIVITY */
1621  uint32_t socket_c0_residency;
1622  uint32_t socket_gfx_busy;
1623  uint32_t dram_bandwidth_utilization;
1624  uint64_t socket_c0_residency_acc;
1625  uint64_t socket_gfx_busy_acc;
1626  uint64_t dram_bandwidth_acc;
1627  uint32_t max_dram_bandwidth;
1628  uint64_t dram_bandwidth_utilization_acc;
1629  uint64_t pcie_bandwidth_acc[4];
1630 
1631  /* THROTTLERS */
1632  uint32_t prochot_residency_acc;
1633  uint32_t ppt_residency_acc;
1634  uint32_t socket_thm_residency_acc;
1635  uint32_t vr_thm_residency_acc;
1636  uint32_t hbm_thm_residency_acc;
1637  uint32_t spare;
1638 
1639  /* New items at the end to maintain driver compatibility */
1640  uint32_t gfxclk_frequency[8];
1641 } amdsmi_hsmp_metrics_table_t;
1642 
1646 static char* const amdsmi_hsmp_freqlimit_src_names[] = {
1647  "cHTC-Active",
1648  "PROCHOT",
1649  "TDC limit",
1650  "PPT Limit",
1651  "OPN Max",
1652  "Reliability Limit",
1653  "APML Agent",
1654  "HSMP Agent"
1655 };
1656 #endif
1657 
1658 /*****************************************************************************/
1685 amdsmi_status_t amdsmi_init(uint64_t init_flags);
1686 
1699 
1702 /*****************************************************************************/
1738  amdsmi_socket_handle* socket_handles);
1739 
1740 #ifdef ENABLE_ESMI_LIB
1768  amdsmi_cpusocket_handle* socket_handles);
1769 #endif
1770 
1789  amdsmi_socket_handle socket_handle,
1790  size_t len, char *name);
1791 
1792 #ifdef ENABLE_ESMI_LIB
1810  amdsmi_processor_handle processor_handle,
1811  size_t len, char *name);
1812 
1835  uint32_t* processor_count, uint32_t* nr_cpusockets,
1836  uint32_t* nr_cpucores, uint32_t* nr_gpus);
1837 
1857 amdsmi_status_t amdsmi_get_processor_handles_by_type(amdsmi_socket_handle socket_handle,
1858  processor_type_t processor_type,
1859  amdsmi_processor_handle* processor_handles,
1860  uint32_t* processor_count);
1861 #endif
1862 
1897 amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle,
1898  uint32_t *processor_count,
1899  amdsmi_processor_handle* processor_handles);
1900 
1901 #ifdef ENABLE_ESMI_LIB
1926 amdsmi_status_t amdsmi_get_cpucore_handles(amdsmi_cpusocket_handle socket_handle,
1927  uint32_t *processor_count,
1928  amdsmi_processor_handle* processor_handles);
1929 #endif
1930 
1949  processor_type_t* processor_type);
1950 
1967  amdsmi_processor_handle* processor_handle);
1968 
1971 /*****************************************************************************/
2003 
2020 
2055  size_t len);
2056 
2082  uint32_t len);
2083 
2106 
2141 amdsmi_get_gpu_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len);
2142 
2145 /*****************************************************************************/
2172  amdsmi_pcie_bandwidth_t *bandwidth);
2173 
2209 
2232  int32_t *numa_node);
2233 
2259  uint64_t *received, uint64_t *max_pkt_sz);
2260 
2283  uint64_t *counter);
2284 
2287 /*****************************************************************************/
2326  uint64_t bw_bitmask);
2327 
2330 /*****************************************************************************/
2366 amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power,
2367  float *counter_resolution, uint64_t *timestamp);
2368 
2371 /*****************************************************************************/
2397  amdsmi_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap);
2398 
2419  amdsmi_set_gpu_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved,
2421 
2424 /*****************************************************************************/
2455  uint64_t *total);
2456 
2481  uint64_t *used);
2482 
2503 amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages,
2505 
2519  amdsmi_processor_handle processor_handle, amdsmi_ras_feature_t *ras_feature);
2520 
2521 
2547  amdsmi_gpu_block_t block,
2548  amdsmi_ras_err_state_t *state);
2549 
2585  uint32_t *num_pages,
2586  amdsmi_retired_page_record_t *records);
2587 
2621  uint32_t sensor_ind, int64_t *speed);
2622 
2649  uint32_t sensor_ind, int64_t *speed);
2650 
2676  uint32_t sensor_ind, uint64_t *max_speed);
2677 
2708  amdsmi_temperature_type_t sensor_type,
2709  amdsmi_temperature_metric_t metric, int64_t *temperature);
2710 
2724  amdsmi_processor_handle processor_handle, amdsmi_gpu_cache_info_t *info);
2725 
2756  amdsmi_voltage_type_t sensor_type,
2757  amdsmi_voltage_metric_t metric, int64_t *voltage);
2758 
2761 /*****************************************************************************/
2782 amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind);
2783 
2807  uint32_t sensor_ind, uint64_t speed);
2808 
2811 /*****************************************************************************/
2846  amdsmi_utilization_counter_t utilization_counters[],
2847  uint32_t count,
2848  uint64_t *timestamp);
2849 
2872  amdsmi_dev_perf_level_t *perf);
2873 
2896 
2920  uint32_t *od);
2921 
2945 
2959 
2982 
3003 
3025  amdsmi_gpu_metrics_t *pgpu_metrics);
3026 
3059  amdsmi_processor_handle processor_handle,
3060  amdsmi_name_value_t** pm_metrics,
3061  uint32_t *num_of_metrics);
3062 
3097  amdsmi_processor_handle processor_handle,
3098  amdsmi_reg_type_t reg_type,
3099  amdsmi_name_value_t** reg_metrics,
3100  uint32_t *num_of_metrics);
3101 
3125  uint64_t minclkvalue,
3126  uint64_t maxclkvalue,
3127  amdsmi_clk_type_t clkType);
3128 
3152  amdsmi_freq_ind_t level,
3153  uint64_t clkvalue,
3154  amdsmi_clk_type_t clkType);
3155 
3178  uint32_t vpoint,
3179  uint64_t clkvalue,
3180  uint64_t voltvalue);
3181 
3220  uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer);
3221 
3256  amdsmi_get_gpu_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind,
3258 
3261 /*****************************************************************************/
3289 
3329 
3365  amdsmi_clk_type_t clk_type, uint64_t freq_bitmask);
3366 
3385  amdsmi_dpm_policy_t* policy);
3386 
3407  uint32_t policy_id);
3410 /*****************************************************************************/
3432 
3435 /*****************************************************************************/
3468 
3496  uint64_t *enabled_blocks);
3497 
3523  amdsmi_gpu_block_t block,
3524  amdsmi_ras_err_state_t *state);
3525 
3542 amdsmi_status_code_to_string(amdsmi_status_t status, const char **status_string);
3543 
3546 /*****************************************************************************/
3667 
3696  amdsmi_event_handle_t *evnt_handle);
3697 
3714 
3736  amdsmi_counter_command_t cmd, void *cmd_args);
3737 
3758  amdsmi_counter_value_t *value);
3759 
3782  amdsmi_event_group_t grp, uint32_t *available);
3783 
3786 /*****************************************************************************/
3824 
3845 
3878 amdsmi_get_gpu_compute_process_gpus(uint32_t pid, uint32_t *dv_indices,
3879  uint32_t *num_devices);
3880 
3883 /*****************************************************************************/
3913 
3930 
3933 /*****************************************************************************/
3952  amdsmi_link_metrics_t *link_metrics);
3953 
3972 amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node);
3973 
3996  uint64_t *weight);
3997 
4023  amdsmi_processor_handle processor_handle_dst,
4024  uint64_t *min_bandwidth,
4025  uint64_t *max_bandwidth);
4026 
4053  amdsmi_processor_handle processor_handle_dst,
4054  uint64_t *hops, amdsmi_io_link_type_t *type);
4055 
4078  amdsmi_processor_handle processor_handle_dst,
4079  bool *accessible);
4080 
4083 /*****************************************************************************/
4122  char *compute_partition, uint32_t len);
4123 
4150  amdsmi_compute_partition_type_t compute_partition);
4151 
4170  // end of compute_partition
4172 
4173 /*****************************************************************************/
4212  char *memory_partition, uint32_t len);
4213 
4239  amdsmi_memory_partition_type_t memory_partition);
4240 
4261  // end of memory_partition
4263 
4264 /*****************************************************************************/
4288 
4319 
4359  uint32_t *num_elem, amdsmi_evt_notification_data_t *data);
4360 
4378 
4395 
4413 amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid);
4414 
4415 /*****************************************************************************/
4439 
4442 /*****************************************************************************/
4466 
4480  amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info);
4481 
4496 
4512 amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind,
4513  amdsmi_power_cap_info_t *info);
4514 
4528  amdsmi_pcie_info_t *info);
4529 
4545 
4548 /*****************************************************************************/
4566 
4582 
4585 /*****************************************************************************/
4605 
4621 
4635 
4655 
4672 
4673 
4676 /*****************************************************************************/
4710 amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t *max_processes, amdsmi_process_handle_t *list);
4711 
4728 amdsmi_get_gpu_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle_t process, amdsmi_proc_info_t *info);
4729 
4732 /*****************************************************************************/
4753 
4757 #ifdef ENABLE_ESMI_LIB
4758 /*****************************************************************************/
4775  uint64_t *penergy);
4776 
4789  uint64_t *penergy);
4790 
4793 /*****************************************************************************/
4809  amdsmi_smu_fw_version_t *amdsmi_smu_fw);
4810 
4822  uint32_t *proto_ver);
4823 
4836  uint32_t *prochot);
4837 
4852  uint32_t *fclk, uint32_t *mclk);
4853 
4866  uint32_t *cclk);
4867 
4882  uint16_t *freq, char **src_type);
4883 
4898  uint16_t *fmax, uint16_t *fmin);
4899 
4912  uint32_t *freq);
4913 
4916 /*****************************************************************************/
4933  uint32_t *ppower);
4934 
4947  uint32_t *pcap);
4948 
4961  uint32_t *pmax);
4962 
4975  uint32_t *power);
4976 
4989  uint32_t pcap);
4990 
5003  uint8_t mode);
5004 
5007 /*****************************************************************************/
5024  uint32_t *pboostlimit);
5025 
5038  uint32_t *pc0_residency);
5039 
5052  uint32_t boostlimit);
5053 
5066  uint32_t boostlimit);
5067 
5070 /*****************************************************************************/
5086  amdsmi_ddr_bw_metrics_t *ddr_bw);
5087 
5090 /*****************************************************************************/
5107  uint32_t *ptmon);
5108 
5111 /*****************************************************************************/
5128  uint8_t dimm_addr,
5130 
5143  uint8_t dimm_addr,
5144  amdsmi_dimm_power_t *dimm_pow);
5145 
5158  uint8_t dimm_addr,
5159  amdsmi_dimm_thermal_t *dimm_temp);
5160 
5163 /*****************************************************************************/
5179  uint8_t min, uint8_t max);
5180 
5183 /*****************************************************************************/
5200  uint8_t min_link_width, uint8_t max_link_width);
5201 
5204 /*****************************************************************************/
5219 
5232  uint8_t pstate);
5233 
5247  uint8_t nbio_id, uint8_t min, uint8_t max);
5248 
5261  uint8_t nbio_id, amdsmi_dpm_level_t *nbio);
5262 
5275  uint8_t rate_ctrl, uint8_t *prev_mode);
5276 
5289  uint8_t max_pstate, uint8_t min_pstate);
5290 
5293 /*****************************************************************************/
5310  amdsmi_link_id_bw_type_t link, uint32_t *io_bw);
5311 
5324  amdsmi_link_id_bw_type_t link, uint32_t *xgmi_bw);
5325 
5328 /*****************************************************************************/
5344  uint32_t *metrics_version);
5345 
5357  amdsmi_hsmp_metrics_table_t *metrics_table);
5358 
5361 /*****************************************************************************/
5378  uint32_t *pcore_ind);
5379 
5388 
5397 
5413 amdsmi_status_t amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string);
5414 #endif
5416 #ifdef __cplusplus
5417 }
5418 #endif // __cplusplus
5419 #endif // INCLUDE_AMDSMI_H_
#define AMDSMI_MAX_DATE_LENGTH
Definition: amdsmi.h:80
amdsmi_evt_notification_type_t
Definition: amdsmi.h:835
@ AMDSMI_EVT_NOTIF_VMFAULT
VM page fault.
Definition: amdsmi.h:836
#define AMDSMI_MAX_NUM_CLKS
This should match MAX_NUM_CLKS.
Definition: amdsmi.h:115
#define AMDSMI_MAX_NUM_XGMI_LINKS
This should match MAX_NUM_XGMI_LINKS.
Definition: amdsmi.h:120
amdsmi_freq_ind_t
The values of this enum are used as frequency identifiers.
Definition: amdsmi.h:1021
@ AMDSMI_FREQ_IND_INVALID
An invalid frequency index.
Definition: amdsmi.h:1024
@ AMDSMI_FREQ_IND_MAX
Index used for the maximum frequency value.
Definition: amdsmi.h:1023
@ AMDSMI_FREQ_IND_MIN
Index used for the minimum frequency value.
Definition: amdsmi.h:1022
amdsmi_reg_type_t
This register type for register table.
Definition: amdsmi.h:1441
uintptr_t amdsmi_event_handle_t
Available clock types.
Definition: amdsmi.h:729
amdsmi_memory_type_t
Types of memory.
Definition: amdsmi.h:1008
@ AMDSMI_MEM_TYPE_VRAM
VRAM memory.
Definition: amdsmi.h:1011
@ AMDSMI_MEM_TYPE_VIS_VRAM
VRAM memory that is visible.
Definition: amdsmi.h:1012
@ AMDSMI_MEM_TYPE_GTT
GTT memory.
Definition: amdsmi.h:1013
amdsmi_status_t amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid)
Returns the UUID of the device.
amdsmi_clk_type_t
Definition: amdsmi.h:261
@ CLK_TYPE_DF
running on a separate clock)
Definition: amdsmi.h:265
@ CLK_TYPE_SYS
System clock.
Definition: amdsmi.h:262
@ CLK_TYPE_DCEF
Display Controller Engine clock.
Definition: amdsmi.h:267
#define MAX_EVENT_NOTIFICATION_MSG_SIZE
Maximum number of characters an event notification message will be.
Definition: amdsmi.h:851
amdsmi_io_link_type_t
Types for IO Link.
Definition: amdsmi.h:1056
@ AMDSMI_IOLINK_TYPE_SIZE
Max of IO Link types.
Definition: amdsmi.h:1061
@ AMDSMI_IOLINK_TYPE_UNDEFINED
unknown type.
Definition: amdsmi.h:1057
@ AMDSMI_IOLINK_TYPE_NUMIOLINKTYPES
Number of IO Link types.
Definition: amdsmi.h:1060
@ AMDSMI_IOLINK_TYPE_XGMI
XGMI.
Definition: amdsmi.h:1059
@ AMDSMI_IOLINK_TYPE_PCIEXPRESS
PCI Express.
Definition: amdsmi.h:1058
amdsmi_init_flags_t
Initialization flags.
Definition: amdsmi.h:69
@ AMDSMI_INIT_ALL_PROCESSORS
Initialize all processors.
Definition: amdsmi.h:70
#define AMDSMI_NUM_HBM_INSTANCES
This should match NUM_HBM_INSTANCES.
Definition: amdsmi.h:105
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:737
@ AMDSMI_EVNT_GRP_XGMI
Data Fabric (XGMI) related events.
Definition: amdsmi.h:738
@ AMDSMI_EVNT_GRP_XGMI_DATA_OUT
XGMI Outbound data.
Definition: amdsmi.h:739
amdsmi_ras_err_state_t
The current ECC state.
Definition: amdsmi.h:991
@ AMDSMI_RAS_ERR_STATE_PARITY
ECC errors present, but type unknown.
Definition: amdsmi.h:994
@ AMDSMI_RAS_ERR_STATE_SING_C
Single correctable error.
Definition: amdsmi.h:995
@ AMDSMI_RAS_ERR_STATE_MULT_UC
Multiple uncorrectable errors.
Definition: amdsmi.h:996
@ AMDSMI_RAS_ERR_STATE_POISON
page. Treat as uncorrectable.
Definition: amdsmi.h:997
@ AMDSMI_RAS_ERR_STATE_ENABLED
ECC is enabled.
Definition: amdsmi.h:999
@ AMDSMI_RAS_ERR_STATE_NONE
No current errors.
Definition: amdsmi.h:992
@ AMDSMI_RAS_ERR_STATE_DISABLED
ECC is disabled.
Definition: amdsmi.h:993
amdsmi_io_bw_encoding_t
xGMI Bandwidth Encoding types
Definition: amdsmi.h:1534
@ AGG_BW0
Aggregate Bandwidth.
Definition: amdsmi.h:1535
@ RD_BW0
Read Bandwidth.
Definition: amdsmi.h:1536
@ WR_BW0
Write Bandwdith.
Definition: amdsmi.h:1537
amdsmi_event_type_t
Event type enum. Events belonging to a particular event group amdsmi_event_group_t should begin enume...
Definition: amdsmi.h:749
@ AMDSMI_EVNT_XGMI_0_BEATS_TX
Data beats sent to neighbor 0; Each beat represents 32 bytes.
Definition: amdsmi.h:772
@ AMDSMI_EVNT_XGMI_DATA_OUT_3
Outbound beats to neighbor 3.
Definition: amdsmi.h:804
@ AMDSMI_EVNT_XGMI_0_NOP_TX
NOPs sent to neighbor 0.
Definition: amdsmi.h:753
@ AMDSMI_EVNT_XGMI_1_NOP_TX
NOPs sent to neighbor 1.
Definition: amdsmi.h:773
@ AMDSMI_EVNT_XGMI_0_RESPONSE_TX
neighbor 0
Definition: amdsmi.h:756
@ AMDSMI_EVNT_XGMI_1_BEATS_TX
Definition: amdsmi.h:778
@ AMDSMI_EVNT_XGMI_DATA_OUT_4
Outbound beats to neighbor 4.
Definition: amdsmi.h:805
@ AMDSMI_EVNT_XGMI_DATA_OUT_1
Outbound beats to neighbor 1.
Definition: amdsmi.h:802
@ AMDSMI_EVNT_XGMI_DATA_OUT_2
Outbound beats to neighbor 2.
Definition: amdsmi.h:803
@ AMDSMI_EVNT_XGMI_1_REQUEST_TX
neighbor 1
Definition: amdsmi.h:774
@ AMDSMI_EVNT_XGMI_DATA_OUT_5
Outbound beats to neighbor 5.
Definition: amdsmi.h:806
@ AMDSMI_EVNT_XGMI_0_REQUEST_TX
neighbor 0
Definition: amdsmi.h:754
@ AMDSMI_EVNT_XGMI_1_RESPONSE_TX
neighbor 1
Definition: amdsmi.h:776
processor_type_t
Processor types detectable by AMD SMI AMD_CPU - CPU Socket is a physical component that holds the CPU...
Definition: amdsmi.h:191
amdsmi_fw_block_t
The values of this enum are used to identify the various firmware blocks.
Definition: amdsmi.h:339
amdsmi_memory_page_status_t
Reserved Memory Page States.
Definition: amdsmi.h:1044
@ AMDSMI_MEM_PAGE_STATUS_UNRESERVABLE
Unable to reserve this page.
Definition: amdsmi.h:1050
@ AMDSMI_MEM_PAGE_STATUS_RESERVED
and not available for use
Definition: amdsmi.h:1045
@ AMDSMI_MEM_PAGE_STATUS_PENDING
Definition: amdsmi.h:1047
amdsmi_xgmi_status_t
XGMI Status.
Definition: amdsmi.h:1030
amdsmi_dev_perf_level_t
PowerPlay performance levels.
Definition: amdsmi.h:693
@ AMDSMI_DEV_PERF_LEVEL_STABLE_STD
clocks
Definition: amdsmi.h:703
@ AMDSMI_DEV_PERF_LEVEL_STABLE_PEAK
Stable power state with peak clocks.
Definition: amdsmi.h:705
@ AMDSMI_DEV_PERF_LEVEL_AUTO
Performance level is "auto".
Definition: amdsmi.h:694
@ AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK
system clock
Definition: amdsmi.h:708
@ AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK
memory clock
Definition: amdsmi.h:706
@ AMDSMI_DEV_PERF_LEVEL_DETERMINISM
Performance determinism state.
Definition: amdsmi.h:710
@ AMDSMI_DEV_PERF_LEVEL_LOW
regardless of workload
Definition: amdsmi.h:697
@ AMDSMI_DEV_PERF_LEVEL_HIGH
regardless of workload
Definition: amdsmi.h:699
@ AMDSMI_DEV_PERF_LEVEL_MANUAL
setting the AMDSMI_CLK_TYPE_SYS speed
Definition: amdsmi.h:701
@ AMDSMI_DEV_PERF_LEVEL_UNKNOWN
Unknown performance level.
Definition: amdsmi.h:714
amdsmi_utilization_counter_type_t
The utilization counter type.
Definition: amdsmi.h:1067
@ AMDSMI_COARSE_GRAIN_MEM_ACTIVITY
Memory Activity.
Definition: amdsmi.h:1071
@ AMDSMI_UTILIZATION_COUNTER_FIRST
GFX Activity.
Definition: amdsmi.h:1068
amdsmi_memory_partition_type_t
Memory Partitions. This enum is used to identify various memory partition types.
Definition: amdsmi.h:300
@ MEMORY_PARTITION_NPS1
Definition: amdsmi.h:302
@ MEMORY_PARTITION_NPS4
Definition: amdsmi.h:307
@ MEMORY_PARTITION_NPS2
Definition: amdsmi.h:304
@ MEMORY_PARTITION_NPS8
Definition: amdsmi.h:310
amdsmi_voltage_metric_t
Voltage Metrics. This enum is used to identify various Volatge metrics. Corresponding values will be ...
Definition: amdsmi.h:910
@ AMDSMI_VOLT_LOWEST
Historical minimum voltage.
Definition: amdsmi.h:919
@ AMDSMI_VOLT_MAX_CRIT
Voltage critical max value.
Definition: amdsmi.h:917
@ AMDSMI_VOLT_HIGHEST
Historical maximum voltage.
Definition: amdsmi.h:920
@ AMDSMI_VOLT_MIN
Voltage min value.
Definition: amdsmi.h:916
@ AMDSMI_VOLT_AVERAGE
Average voltage.
Definition: amdsmi.h:918
@ AMDSMI_VOLT_CURRENT
Voltage current value.
Definition: amdsmi.h:911
@ AMDSMI_VOLT_MAX
Voltage max value.
Definition: amdsmi.h:914
@ AMDSMI_VOLT_MIN_CRIT
Voltage critical min value.
Definition: amdsmi.h:915
uint64_t amdsmi_bit_field_t
Bitfield used in various AMDSMI calls.
Definition: amdsmi.h:1039
amdsmi_voltage_type_t
This ennumeration is used to indicate which type of voltage reading should be obtained.
Definition: amdsmi.h:929
@ AMDSMI_VOLT_TYPE_INVALID
Invalid type.
Definition: amdsmi.h:935
@ AMDSMI_VOLT_TYPE_VDDGFX
voltage
Definition: amdsmi.h:932
void * amdsmi_processor_handle
opaque handler point to underlying implementation
Definition: amdsmi.h:179
amdsmi_cache_property_type_t
cache properties
Definition: amdsmi.h:543
amdsmi_status_t
Error codes returned by amdsmi functions.
Definition: amdsmi.h:206
@ AMDSMI_STATUS_NOT_INIT
Device not initialized.
Definition: amdsmi.h:231
@ AMDSMI_STATUS_NON_AMD_CPU
System has different cpu than AMD.
Definition: amdsmi.h:240
@ AMDSMI_ARG_PTR_NULL
Parsed argument is invalid.
Definition: amdsmi.h:249
@ AMDSMI_NO_HSMP_SUP
HSMP not supported.
Definition: amdsmi.h:244
@ AMDSMI_STATUS_INVAL
Invalid parameters.
Definition: amdsmi.h:209
@ AMDSMI_STATUS_BUSY
Device busy.
Definition: amdsmi.h:229
@ AMDSMI_NO_MSR_DRV
MSR driver not found.
Definition: amdsmi.h:242
@ AMDSMI_STATUS_UNKNOWN_ERROR
An unknown error occurred.
Definition: amdsmi.h:255
@ AMDSMI_STATUS_DRIVER_NOT_LOADED
Processor driver not loaded.
Definition: amdsmi.h:233
@ AMDSMI_STATUS_FILE_ERROR
Problem accessing a file.
Definition: amdsmi.h:222
@ AMDSMI_STATUS_DRM_ERROR
Error when call libdrm.
Definition: amdsmi.h:214
@ AMDSMI_STATUS_IO
I/O Error.
Definition: amdsmi.h:220
@ AMDSMI_NO_DRV
No Energy and HSMP driver present.
Definition: amdsmi.h:247
@ AMDSMI_STATUS_NO_DATA
No data was found for a given input.
Definition: amdsmi.h:235
@ AMDSMI_STATUS_RETRY
Retry operation.
Definition: amdsmi.h:217
@ AMDSMI_STATUS_UNEXPECTED_SIZE
An unexpected amount of data was read.
Definition: amdsmi.h:237
@ AMDSMI_STATUS_SETTING_UNAVAILABLE
Setting is not available.
Definition: amdsmi.h:251
@ AMDSMI_STATUS_INTERNAL_EXCEPTION
An internal exception was caught.
Definition: amdsmi.h:224
@ AMDSMI_STATUS_MAP_ERROR
The internal library error did not map to a status code.
Definition: amdsmi.h:254
@ AMDSMI_STATUS_FAIL_LOAD_SYMBOL
Fail to load symbol.
Definition: amdsmi.h:213
@ AMDSMI_STATUS_INSUFFICIENT_SIZE
Not enough resources were available for the operation.
Definition: amdsmi.h:236
@ AMDSMI_STATUS_INIT_ERROR
An error occurred when initializing internal data structures.
Definition: amdsmi.h:226
@ AMDSMI_NO_HSMP_DRV
HSMP driver not found.
Definition: amdsmi.h:243
@ AMDSMI_STATUS_OUT_OF_RESOURCES
Not enough memory.
Definition: amdsmi.h:223
@ AMDSMI_STATUS_NO_SLOT
No more free slot.
Definition: amdsmi.h:232
@ AMDSMI_STATUS_INTERRUPT
An interrupt occurred during execution of function.
Definition: amdsmi.h:219
@ AMDSMI_STATUS_SUCCESS
Call succeeded.
Definition: amdsmi.h:207
@ AMDSMI_HSMP_TIMEOUT
HSMP message is timedout.
Definition: amdsmi.h:246
@ AMDSMI_STATUS_ADDRESS_FAULT
Bad address.
Definition: amdsmi.h:221
@ AMDSMI_NO_ENERGY_DRV
Energy driver not found.
Definition: amdsmi.h:241
@ AMDSMI_FILE_NOT_FOUND
file or directory not found
Definition: amdsmi.h:248
@ AMDSMI_STATUS_NOT_YET_IMPLEMENTED
Not implemented yet.
Definition: amdsmi.h:211
@ AMDSMI_STATUS_NO_PERM
Permission Denied.
Definition: amdsmi.h:218
@ AMDSMI_STATUS_NOT_FOUND
Device Not found.
Definition: amdsmi.h:230
@ AMDSMI_STATUS_FAIL_LOAD_MODULE
Fail to load lib.
Definition: amdsmi.h:212
@ AMDSMI_STATUS_AMDGPU_RESTART_ERR
AMDGPU restart failed.
Definition: amdsmi.h:250
@ AMDSMI_STATUS_NOT_SUPPORTED
Command not supported.
Definition: amdsmi.h:210
@ AMDSMI_NO_HSMP_MSG_SUP
HSMP message/feature not supported.
Definition: amdsmi.h:245
@ AMDSMI_STATUS_UNEXPECTED_DATA
The data read or provided to function is not what was expected.
Definition: amdsmi.h:238
@ AMDSMI_STATUS_API_FAILED
API call failed.
Definition: amdsmi.h:215
@ AMDSMI_STATUS_TIMEOUT
Timeout in API call.
Definition: amdsmi.h:216
@ AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS
The provided input is out of allowable or safe range.
Definition: amdsmi.h:225
@ AMDSMI_STATUS_REFCOUNT_OVERFLOW
An internal reference counter exceeded INT32_MAX.
Definition: amdsmi.h:227
#define AMDSMI_MAX_NUM_JPEG
This should match AMDSMI_MAX_NUM_JPEG (8*4=32)
Definition: amdsmi.h:140
amdsmi_temperature_metric_t
Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values ...
Definition: amdsmi.h:867
@ AMDSMI_TEMP_CRITICAL_HYST
Definition: amdsmi.h:881
@ AMDSMI_TEMP_CRITICAL
greater than corresponding temp_max values.
Definition: amdsmi.h:879
@ AMDSMI_TEMP_OFFSET
Definition: amdsmi.h:897
@ AMDSMI_TEMP_EMERGENCY
Definition: amdsmi.h:884
@ AMDSMI_TEMP_LOWEST
temperature reading by the chip.
Definition: amdsmi.h:899
@ AMDSMI_TEMP_CRIT_MIN
Definition: amdsmi.h:891
@ AMDSMI_TEMP_EMERGENCY_HYST
Definition: amdsmi.h:888
@ AMDSMI_TEMP_CURRENT
Temperature current value.
Definition: amdsmi.h:868
@ AMDSMI_TEMP_MIN
Temperature min value.
Definition: amdsmi.h:872
@ AMDSMI_TEMP_HIGHEST
Historical maximum temperature.
Definition: amdsmi.h:900
@ AMDSMI_TEMP_CRIT_MIN_HYST
Definition: amdsmi.h:894
@ AMDSMI_TEMP_MIN_HYST
Definition: amdsmi.h:876
@ AMDSMI_TEMP_MAX_HYST
Definition: amdsmi.h:873
@ AMDSMI_TEMP_MAX
Temperature max value.
Definition: amdsmi.h:871
amdsmi_gpu_block_t
This enum is used to identify different GPU blocks.
Definition: amdsmi.h:963
@ AMDSMI_GPU_BLOCK_XGMI_WAFL
XGMI block.
Definition: amdsmi.h:975
@ AMDSMI_GPU_BLOCK_LAST
for supported blocks
Definition: amdsmi.h:983
@ AMDSMI_GPU_BLOCK_GFX
GFX block.
Definition: amdsmi.h:970
@ AMDSMI_GPU_BLOCK_INVALID
invalid block
Definition: amdsmi.h:964
@ AMDSMI_GPU_BLOCK_MP0
MP0 block.
Definition: amdsmi.h:979
@ AMDSMI_GPU_BLOCK_HDP
HDP block.
Definition: amdsmi.h:974
@ AMDSMI_GPU_BLOCK_ATHUB
ATHUB block.
Definition: amdsmi.h:972
@ AMDSMI_GPU_BLOCK_MP1
MP1 block.
Definition: amdsmi.h:980
@ AMDSMI_GPU_BLOCK_PCIE_BIF
PCIE_BIF block.
Definition: amdsmi.h:973
@ AMDSMI_GPU_BLOCK_SDMA
SDMA block.
Definition: amdsmi.h:969
@ AMDSMI_GPU_BLOCK_UMC
UMC block.
Definition: amdsmi.h:968
@ AMDSMI_GPU_BLOCK_FUSE
Fuse block.
Definition: amdsmi.h:981
@ AMDSMI_GPU_BLOCK_DF
DF block.
Definition: amdsmi.h:976
@ AMDSMI_GPU_BLOCK_MMHUB
MMHUB block.
Definition: amdsmi.h:971
@ AMDSMI_GPU_BLOCK_SMN
SMN block.
Definition: amdsmi.h:977
@ AMDSMI_GPU_BLOCK_SEM
SEM block.
Definition: amdsmi.h:978
struct __attribute__((__packed__))
HSMP Metrics table (supported only with hsmp proto version 6).
Definition: amdsmi.h:1564
amdsmi_status_t amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf)
Returns BDF of the given device.
amdsmi_power_type_t
Power types.
Definition: amdsmi.h:1078
@ AMDSMI_INVALID_POWER
Invalid / Undetected Power.
Definition: amdsmi.h:1081
@ AMDSMI_CURRENT_POWER
Current / Instant Power.
Definition: amdsmi.h:1080
@ AMDSMI_AVERAGE_POWER
Average Power.
Definition: amdsmi.h:1079
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:321
#define AMDSMI_MAX_NUM_FREQUENCIES
Guaranteed maximum possible number of supported frequencies.
Definition: amdsmi.h:682
amdsmi_counter_command_t
Definition: amdsmi.h:815
@ AMDSMI_CNTR_CMD_STOP
be used before reading.
Definition: amdsmi.h:817
@ AMDSMI_CNTR_CMD_START
Start the counter.
Definition: amdsmi.h:816
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:944
@ AMDSMI_PWR_PROF_PRST_COMPUTE_MASK
Compute Saving Profile.
Definition: amdsmi.h:948
@ AMDSMI_PWR_PROF_PRST_POWER_SAVING_MASK
Power Saving Profile.
Definition: amdsmi.h:947
@ AMDSMI_PWR_PROF_PRST_VIDEO_MASK
Video Power Profile.
Definition: amdsmi.h:946
@ AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT
Default Boot Up Profile.
Definition: amdsmi.h:953
@ AMDSMI_PWR_PROF_PRST_LAST
Invalid power profile.
Definition: amdsmi.h:954
@ AMDSMI_PWR_PROF_PRST_CUSTOM_MASK
Custom Power Profile.
Definition: amdsmi.h:945
@ AMDSMI_PWR_PROF_PRST_VR_MASK
VR Power Profile.
Definition: amdsmi.h:949
#define AMDSMI_MAX_NUM_GFX_CLKS
This should match MAX_NUM_GFX_CLKS.
Definition: amdsmi.h:125
#define AMDSMI_NUM_VOLTAGE_CURVE_POINTS
The number of points that make up a voltage-frequency curve definition.
Definition: amdsmi.h:689
amdsmi_compute_partition_type_t
Compute Partition. This enum is used to identify various compute partitioning settings.
Definition: amdsmi.h:282
@ COMPUTE_PARTITION_TPX
Definition: amdsmi.h:290
@ COMPUTE_PARTITION_CPX
Definition: amdsmi.h:284
@ COMPUTE_PARTITION_DPX
Definition: amdsmi.h:288
@ COMPUTE_PARTITION_QPX
Definition: amdsmi.h:292
@ COMPUTE_PARTITION_SPX
Definition: amdsmi.h:286
#define AMDSMI_MAX_NUM_VCN
This should match MAX_NUM_VCN.
Definition: amdsmi.h:110
amdsmi_status_t amdsmi_get_processor_info(amdsmi_processor_handle processor_handle, size_t len, char *name)
Get information about the given processor.
amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t *processor_count, amdsmi_processor_handle *processor_handles)
Get the list of the processor handles associated to a socket.
amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_handle, processor_type_t *processor_type)
Get the processor type of the processor_handle.
amdsmi_status_t amdsmi_get_cpucore_handles(amdsmi_cpusocket_handle socket_handle, uint32_t *processor_count, amdsmi_processor_handle *processor_handles)
Get the list of the cpu core handles associated to a cpu socket.
amdsmi_status_t amdsmi_get_socket_info(amdsmi_socket_handle socket_handle, size_t len, char *name)
Get information about the given 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_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle *processor_handle)
Get processor handle with the matching bdf.
amdsmi_status_t amdsmi_get_processor_handles_by_type(amdsmi_socket_handle socket_handle, processor_type_t processor_type, amdsmi_processor_handle *processor_handles, uint32_t *processor_count)
Get processor list as per processor type.
amdsmi_status_t amdsmi_get_cpusocket_handles(uint32_t *socket_count, amdsmi_cpusocket_handle *socket_handles)
Get the list of cpu socket handles in the system.
amdsmi_status_t amdsmi_get_processor_count_from_handles(amdsmi_processor_handle *processor_handles, uint32_t *processor_count, uint32_t *nr_cpusockets, uint32_t *nr_cpucores, uint32_t *nr_gpus)
Get respective processor counts from the processor handles.
amdsmi_status_t amdsmi_status_code_to_string(amdsmi_status_t status, const char **status_string)
Get a description of a provided AMDSMI error status.
amdsmi_status_t amdsmi_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state)
Retrieve the ECC status for a GPU block. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec)
Retrieve the error counts for a GPU block. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks)
Retrieve the enabled ECC bit-mask. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_set_gpu_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask)
Specify which events to collect for a device.
amdsmi_status_t amdsmi_stop_gpu_event_notification(amdsmi_processor_handle processor_handle)
Close any file handles and free any resources used by event notification for a GPU.
amdsmi_status_t amdsmi_init_gpu_event_notification(amdsmi_processor_handle processor_handle)
Prepare to collect event notifications for a GPU.
amdsmi_status_t amdsmi_get_gpu_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_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node)
Retrieve the NUMA CPU node number for a device.
amdsmi_status_t amdsmi_topo_get_link_type(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *hops, amdsmi_io_link_type_t *type)
Retrieve the hops and the connection type between 2 GPUs.
amdsmi_status_t amdsmi_get_minmax_bandwidth_between_processors(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_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_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, bool *accessible)
Return P2P availability status between 2 GPUs.
amdsmi_status_t amdsmi_get_link_metrics(amdsmi_processor_handle processor_handle, amdsmi_link_metrics_t *link_metrics)
Return link metric information.
amdsmi_status_t amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *weight)
Retrieve the weight for a connection between 2 GPUs.
amdsmi_status_t amdsmi_get_gpu_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len)
Get the name string for the device subsytem.
amdsmi_status_t amdsmi_get_gpu_revision(amdsmi_processor_handle processor_handle, uint16_t *revision)
Get the device revision associated with the device.
amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_handle, char *name, size_t len)
Get the name string for a give vendor ID.
amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint16_t *id)
Get the device id associated with the device with provided device handler.
amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len)
Get the vram vendor string of a device.
amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id)
Get the subsystem device id associated with the device with provided processor 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_get_gpu_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total)
Get the total amount of memory that exists.
amdsmi_status_t amdsmi_get_gpu_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state)
Returns if RAS features are enabled or disabled for given block. It is not supported on virtual machi...
amdsmi_status_t amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info)
Get the bad pages of a processor. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_gpu_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records)
Get information about reserved ("retired") memory pages. It is not supported on virtual machine guest...
amdsmi_status_t amdsmi_get_gpu_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used)
Get the current memory usage.
amdsmi_status_t amdsmi_get_gpu_ras_feature_info(amdsmi_processor_handle processor_handle, amdsmi_ras_feature_t *ras_feature)
Returns RAS features info.
amdsmi_status_t amdsmi_get_hsmp_metrics_table(amdsmi_processor_handle processor_handle, amdsmi_hsmp_metrics_table_t *metrics_table)
Get HSMP metrics table.
amdsmi_status_t amdsmi_get_hsmp_metrics_table_version(amdsmi_processor_handle processor_handle, uint32_t *metrics_version)
Get HSMP metrics table version.
amdsmi_status_t amdsmi_set_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask)
Control the set of allowed PCIe bandwidths that can be used. It is not supported on virtual machine g...
amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity(amdsmi_processor_handle processor_handle, int32_t *numa_node)
Get the NUMA node associated with a device.
amdsmi_status_t amdsmi_get_gpu_pci_throughput(amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz)
Get PCIe traffic information. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth)
Get the list of possible PCIe bandwidths that are available. It is not supported on virtual machine g...
amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle processor_handle, uint64_t *counter)
Get PCIe replay counter.
amdsmi_status_t amdsmi_get_gpu_bdf_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid)
Get the unique PCI device identifier associated for a device.
amdsmi_status_t amdsmi_get_gpu_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available)
Get the number of currently available counters. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_gpu_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_gpu_control_counter(amdsmi_event_handle_t evt_handle, amdsmi_counter_command_t cmd, void *cmd_args)
Issue performance counter control commands. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_gpu_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group)
Tell if an event group is supported by a given device. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_gpu_destroy_counter(amdsmi_event_handle_t evnt_handle)
Deallocate a performance counter object.
amdsmi_status_t amdsmi_gpu_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle)
Create a performance counter object.
amdsmi_status_t amdsmi_set_gpu_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl)
Set the PowerPlay performance level associated with the device with provided processor handle with th...
amdsmi_status_t amdsmi_set_dpm_policy(amdsmi_processor_handle processor_handle, uint32_t policy_id)
Set the dpm policy for the processor.
amdsmi_status_t amdsmi_set_gpu_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t od)
Set the overdrive percent associated with the device with provided processor handle with the provided...
amdsmi_status_t amdsmi_get_dpm_policy(amdsmi_processor_handle processor_handle, amdsmi_dpm_policy_t *policy)
Get the dpm policy for the processor.
amdsmi_status_t amdsmi_set_clk_freq(amdsmi_processor_handle processor_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. It is not supported ...
amdsmi_status_t amdsmi_get_gpu_metrics_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics)
This function retrieves the gpu metrics information. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_gpu_power_profile_presets(amdsmi_processor_handle processor_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_get_gpu_pm_metrics_info(amdsmi_processor_handle processor_handle, amdsmi_name_value_t **pm_metrics, uint32_t *num_of_metrics)
Get the pm metrics table with provided device index.
amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle processor_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_get_gpu_metrics_header_info(amdsmi_processor_handle processor_handle, amd_metrics_table_header_t *header_value)
Get the 'metrics_header_info' from the GPU metrics associated with the device.
amdsmi_status_t amdsmi_reset_gpu(amdsmi_processor_handle processor_handle)
Reset the gpu associated with the device with provided processor handle. It is not supported on virtu...
amdsmi_status_t amdsmi_set_gpu_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue)
This function sets 1 of the 3 voltage curve points. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_set_gpu_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType)
This function sets the clock range information. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_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_gpu_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf)
Get the performance level of the device. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_set_gpu_perf_determinism_mode(amdsmi_processor_handle processor_handle, uint64_t clkvalue)
Enter performance determinism mode with provided processor handle. It is not supported on virtual mac...
amdsmi_status_t amdsmi_get_gpu_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv)
This function retrieves the voltage/frequency curve information. It is not supported on virtual machi...
amdsmi_status_t amdsmi_get_gpu_od_volt_curve_regions(amdsmi_processor_handle processor_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_get_gpu_reg_table_info(amdsmi_processor_handle processor_handle, amdsmi_reg_type_t reg_type, amdsmi_name_value_t **reg_metrics, uint32_t *num_of_metrics)
Get the register metrics table with provided device index and register type.
amdsmi_status_t amdsmi_get_gpu_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t *od)
Get the overdrive percent associated with the device with provided processor handle....
amdsmi_status_t amdsmi_set_gpu_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType)
This function sets the clock frequency information. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_set_gpu_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed)
Set the fan speed for the specified device with the provided speed, in RPMs. It is not supported on v...
amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind)
Reset the fan to automatic driver control. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_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_get_gpu_fan_speed(amdsmi_processor_handle processor_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_get_gpu_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed)
Get the max. fan speed of the device with provided processor handle. It is not supported on virtual m...
amdsmi_status_t amdsmi_get_gpu_cache_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_cache_info_t *info)
Returns gpu cache info.
amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed)
Get the fan speed in RPMs of the device with the specified processor handle and 0-based sensor index....
amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_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_set_gpu_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile)
Set the power performance profile. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap)
Set the maximum gpu power cap value. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp)
Get the energy accumulator counter of the processor with provided processor handle....
amdsmi_status_t amdsmi_get_gpu_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_gpu_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_gpu_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_lib_version(amdsmi_version_t *version)
Get the build version information for the currently running build of AMDSMI.
amdsmi_status_t amdsmi_gpu_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status)
Retrieve the XGMI error status for a device. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_reset_gpu_xgmi_error(amdsmi_processor_handle processor_handle)
Reset the XGMI error status for a device. It is not supported on virtual machine guest.
amdsmi_status_t amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info)
Returns the power caps as currently configured in the system. It is not supported on virtual machine ...
amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info)
Returns the PCIe info for the GPU.
amdsmi_status_t amdsmi_get_gpu_vram_info(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info)
Returns vram info.
amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *info)
Returns the board part number and board information for the requested device.
amdsmi_status_t amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info)
Returns the ASIC information for the device.
amdsmi_status_t amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_t *info)
Returns XGMI information for the GPU.
amdsmi_status_t amdsmi_get_cpu_family(uint32_t *cpu_family)
Get CPU family.
amdsmi_status_t amdsmi_first_online_core_on_cpu_socket(amdsmi_processor_handle processor_handle, uint32_t *pcore_ind)
Get first online core on socket.
amdsmi_status_t amdsmi_get_cpu_model(uint32_t *cpu_model)
Get CPU model.
amdsmi_status_t amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string)
Get a description of provided AMDSMI error status for esmi errors.
amdsmi_status_t amdsmi_get_cpu_current_io_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_link_id_bw_type_t link, uint32_t *io_bw)
Get current input output bandwidth.
amdsmi_status_t amdsmi_get_cpu_current_xgmi_bw(amdsmi_processor_handle processor_handle, amdsmi_link_id_bw_type_t link, uint32_t *xgmi_bw)
Get current input output bandwidth.
amdsmi_status_t amdsmi_set_gpu_compute_partition(amdsmi_processor_handle processor_handle, amdsmi_compute_partition_type_t compute_partition)
Modifies a selected device's compute partition setting.
amdsmi_status_t amdsmi_get_gpu_compute_partition(amdsmi_processor_handle processor_handle, char *compute_partition, uint32_t len)
Retrieves the current compute partitioning for a desired device.
amdsmi_status_t amdsmi_reset_gpu_compute_partition(amdsmi_processor_handle processor_handle)
Reverts a selected device's compute partition setting back to its boot state.
amdsmi_status_t amdsmi_get_cpu_ddr_bw(amdsmi_processor_handle processor_handle, amdsmi_ddr_bw_metrics_t *ddr_bw)
Get the DDR bandwidth data.
amdsmi_status_t amdsmi_get_cpu_dimm_power_consumption(amdsmi_processor_handle processor_handle, uint8_t dimm_addr, amdsmi_dimm_power_t *dimm_pow)
Get DIMM power consumption.
amdsmi_status_t amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(amdsmi_processor_handle processor_handle, uint8_t dimm_addr, amdsmi_temp_range_refresh_rate_t *rate)
Get DIMM temperature range and refresh rate.
amdsmi_status_t amdsmi_get_cpu_dimm_thermal_sensor(amdsmi_processor_handle processor_handle, uint8_t dimm_addr, amdsmi_dimm_thermal_t *dimm_temp)
Get DIMM thermal sensor value.
amdsmi_status_t amdsmi_get_gpu_total_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec)
Returns the total number of ECC errors (correctable, uncorrectable and deferred) in the given GPU....
amdsmi_status_t amdsmi_get_cpu_socket_energy(amdsmi_processor_handle processor_handle, uint64_t *penergy)
Get the socket energy for a given socket.
amdsmi_status_t amdsmi_get_cpu_core_energy(amdsmi_processor_handle processor_handle, uint64_t *penergy)
Get the core energy for a given core.
amdsmi_status_t amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info)
Returns the static information for the vBIOS on the device.
amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info)
Returns the firmware versions running on the device.
amdsmi_status_t amdsmi_set_cpu_gmi3_link_width_range(amdsmi_processor_handle processor_handle, uint8_t min_link_width, uint8_t max_link_width)
Set gmi3 link width range.
amdsmi_status_t amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_info_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_gpu_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_usage_t *info)
Returns the VRAM usage (both total and used memory) in MegaBytes.
amdsmi_status_t amdsmi_get_gpu_activity(amdsmi_processor_handle processor_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_clock_info(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_info_t *info)
Returns the measurements of the clocks in the GPU for the GFX and multimedia engines and Memory....
amdsmi_status_t amdsmi_is_gpu_power_management_enabled(amdsmi_processor_handle processor_handle, bool *enabled)
Returns is power management enabled.
amdsmi_status_t amdsmi_get_gpu_memory_partition(amdsmi_processor_handle processor_handle, char *memory_partition, uint32_t len)
Retrieves the current memory partition for a desired device.
amdsmi_status_t amdsmi_reset_gpu_memory_partition(amdsmi_processor_handle processor_handle)
Reverts a selected device's memory partition setting back to its boot state.
amdsmi_status_t amdsmi_set_gpu_memory_partition(amdsmi_processor_handle processor_handle, amdsmi_memory_partition_type_t memory_partition)
Modifies a selected device's current memory partition setting.
amdsmi_status_t amdsmi_set_cpu_core_boostlimit(amdsmi_processor_handle processor_handle, uint32_t boostlimit)
Set the core boostlimit value.
amdsmi_status_t amdsmi_get_cpu_socket_c0_residency(amdsmi_processor_handle processor_handle, uint32_t *pc0_residency)
Get the socket c0 residency.
amdsmi_status_t amdsmi_set_cpu_socket_boostlimit(amdsmi_processor_handle processor_handle, uint32_t boostlimit)
Set the socket boostlimit value.
amdsmi_status_t amdsmi_get_cpu_core_boostlimit(amdsmi_processor_handle processor_handle, uint32_t *pboostlimit)
Get the core boost limit.
amdsmi_status_t amdsmi_get_cpu_socket_power_cap_max(amdsmi_processor_handle processor_handle, uint32_t *pmax)
Get the maximum power cap value for a given socket.
amdsmi_status_t amdsmi_set_cpu_socket_power_cap(amdsmi_processor_handle processor_handle, uint32_t pcap)
Set the power cap value for a given socket.
amdsmi_status_t amdsmi_get_cpu_socket_power(amdsmi_processor_handle processor_handle, uint32_t *ppower)
Get the socket power.
amdsmi_status_t amdsmi_get_cpu_socket_power_cap(amdsmi_processor_handle processor_handle, uint32_t *pcap)
Get the socket power cap.
amdsmi_status_t amdsmi_get_cpu_pwr_svi_telemetry_all_rails(amdsmi_processor_handle processor_handle, uint32_t *power)
Get the SVI based power telemetry for all rails.
amdsmi_status_t amdsmi_set_cpu_pwr_efficiency_mode(amdsmi_processor_handle processor_handle, uint8_t mode)
Set the power efficiency profile policy.
amdsmi_status_t amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t *max_processes, amdsmi_process_handle_t *list)
Returns the list of processes running on a given GPU including itself.
amdsmi_status_t amdsmi_get_gpu_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle_t 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_cpu_apb_disable(amdsmi_processor_handle processor_handle, uint8_t pstate)
Disable APB.
amdsmi_status_t amdsmi_set_cpu_socket_lclk_dpm_level(amdsmi_processor_handle processor_handle, uint8_t nbio_id, uint8_t min, uint8_t max)
Set NBIO lclk dpm level value.
amdsmi_status_t amdsmi_set_cpu_pcie_link_rate(amdsmi_processor_handle processor_handle, uint8_t rate_ctrl, uint8_t *prev_mode)
Set pcie link rate.
amdsmi_status_t amdsmi_get_cpu_socket_lclk_dpm_level(amdsmi_processor_handle processor_handle, uint8_t nbio_id, amdsmi_dpm_level_t *nbio)
Get NBIO LCLK dpm level.
amdsmi_status_t amdsmi_set_cpu_df_pstate_range(amdsmi_processor_handle processor_handle, uint8_t max_pstate, uint8_t min_pstate)
Set df pstate range.
amdsmi_status_t amdsmi_cpu_apb_enable(amdsmi_processor_handle processor_handle)
Enable APB.
amdsmi_status_t amdsmi_get_gpu_driver_info(amdsmi_processor_handle processor_handle, amdsmi_driver_info_t *info)
Returns the driver version information.
amdsmi_status_t amdsmi_get_cpu_fclk_mclk(amdsmi_processor_handle processor_handle, uint32_t *fclk, uint32_t *mclk)
Get Data fabric clock and Memory clock in MHz.
amdsmi_status_t amdsmi_get_cpu_prochot_status(amdsmi_processor_handle processor_handle, uint32_t *prochot)
Get normalized status of the processor's PROCHOT status.
amdsmi_status_t amdsmi_get_cpu_hsmp_proto_ver(amdsmi_processor_handle processor_handle, uint32_t *proto_ver)
Get HSMP protocol Version.
amdsmi_status_t amdsmi_get_cpu_smu_fw_version(amdsmi_processor_handle processor_handle, amdsmi_smu_fw_version_t *amdsmi_smu_fw)
Get SMU Firmware Version.
amdsmi_status_t amdsmi_get_cpu_socket_current_active_freq_limit(amdsmi_processor_handle processor_handle, uint16_t *freq, char **src_type)
Get current active frequency limit of the socket.
amdsmi_status_t amdsmi_get_cpu_core_current_freq_limit(amdsmi_processor_handle processor_handle, uint32_t *freq)
Get socket frequency limit of the core.
amdsmi_status_t amdsmi_get_cpu_socket_freq_range(amdsmi_processor_handle processor_handle, uint16_t *fmax, uint16_t *fmin)
Get socket frequency range.
amdsmi_status_t amdsmi_get_cpu_cclk_limit(amdsmi_processor_handle processor_handle, uint32_t *cclk)
Get core clock in MHz.
amdsmi_status_t amdsmi_get_cpu_socket_temperature(amdsmi_processor_handle processor_handle, uint32_t *ptmon)
Get socket temperature.
amdsmi_status_t amdsmi_set_cpu_xgmi_width(amdsmi_processor_handle processor_handle, uint8_t min, uint8_t max)
Set xgmi width.
The following structures hold the gpu metrics values for a device.
Definition: amdsmi.h:1267
Definition: amdsmi.h:574
Definition: amdsmi.h:486
Definition: amdsmi.h:620
Definition: amdsmi.h:639
Definition: amdsmi.h:824
uint64_t time_enabled
Definition: amdsmi.h:826
uint64_t time_running
Definition: amdsmi.h:828
uint64_t value
Counter value.
Definition: amdsmi.h:825
DDR bandwidth metrics.
Definition: amdsmi.h:1498
uint32_t max_bw
DDR Maximum theoritical bandwidth in GB/s.
Definition: amdsmi.h:1499
uint32_t utilized_bw
DDR bandwidth utilization in GB/s.
Definition: amdsmi.h:1500
uint32_t utilized_pct
DDR bandwidth utilization in % of theoritical max.
Definition: amdsmi.h:1501
DIMM Power(mW), power update rate(ms) and dimm address.
Definition: amdsmi.h:1515
uint8_t dimm_addr
Dimm address[7:0](8 bit data)
Definition: amdsmi.h:1518
uint16_t update_rate
Time since last update[16:8](9 bit data)
Definition: amdsmi.h:1517
uint16_t power
Dimm power consumption[31:17](15 bits data)
Definition: amdsmi.h:1516
DIMM temperature(°C) and update rate(ms) and dimm address.
Definition: amdsmi.h:1524
uint16_t sensor
Dimm thermal sensor[31:21](11 bit data)
Definition: amdsmi.h:1525
float temp
temperature in degree celcius
Definition: amdsmi.h:1528
uint16_t update_rate
Time since last update[16:8](9 bit data)
Definition: amdsmi.h:1526
uint8_t dimm_addr
Dimm address[7:0](8 bit data)
Definition: amdsmi.h:1527
max and min LCLK DPM level on a given NBIO ID. Valid max and min DPM level values are 0 - 1.
Definition: amdsmi.h:1556
uint8_t min_dpm_level
Min LCLK DPM level[7:0](8 bit data)
Definition: amdsmi.h:1558
uint8_t max_dpm_level
Max LCLK DPM level[15:8](8 bit data)
Definition: amdsmi.h:1557
The dpm policy.
Definition: amdsmi.h:1157
This structure holds information about dpm policies.
Definition: amdsmi.h:1167
uint32_t num_supported
Definition: amdsmi.h:1171
uint32_t current
Definition: amdsmi.h:1176
Definition: amdsmi.h:614
Definition: amdsmi.h:653
This structure holds error counts.
Definition: amdsmi.h:1462
uint64_t uncorrectable_count
Accumulated uncorrectable errors.
Definition: amdsmi.h:1464
uint64_t correctable_count
Accumulated correctable errors.
Definition: amdsmi.h:1463
uint64_t deferred_count
Accumulated deferred errors.
Definition: amdsmi.h:1465
Definition: amdsmi.h:856
amdsmi_processor_handle processor_handle
Handler of device that corresponds to the event.
Definition: amdsmi.h:857
amdsmi_evt_notification_type_t event
Event type.
Definition: amdsmi.h:858
This structure holds 2 amdsmi_range_t's, one for frequency and one for voltage. These 2 ranges indica...
Definition: amdsmi.h:1227
amdsmi_range_t freq_range
The frequency range for this VDDC Curve point.
Definition: amdsmi.h:1228
amdsmi_range_t volt_range
The voltage range for this VDDC Curve point.
Definition: amdsmi.h:1229
This structure holds information about clock frequencies.
Definition: amdsmi.h:1131
uint32_t current
Definition: amdsmi.h:1145
uint32_t num_supported
Definition: amdsmi.h:1140
bool has_deep_sleep
Definition: amdsmi.h:1135
Definition: amdsmi.h:479
Definition: amdsmi.h:566
Definition: amdsmi.h:564
Definition: amdsmi.h:553
Definition: amdsmi.h:551
Definition: amdsmi.h:1277
This structure holds the name value pairs.
Definition: amdsmi.h:1433
uint64_t value
Use uint64_t to make it universal.
Definition: amdsmi.h:1435
This structure represents a point on the frequency-voltage plane.
Definition: amdsmi.h:1217
uint64_t frequency
Frequency coordinate (in Hz)
Definition: amdsmi.h:1218
uint64_t voltage
Voltage coordinate (in mV)
Definition: amdsmi.h:1219
Definition: amdsmi.h:1235
This structure holds the frequency-voltage values for a device.
Definition: amdsmi.h:1246
amdsmi_range_t curr_mclk_range
(upper bound only)
Definition: amdsmi.h:1248
amdsmi_range_t mclk_freq_limits
The range possible of MCLK values.
Definition: amdsmi.h:1251
uint32_t num_regions
The number of voltage curve regions.
Definition: amdsmi.h:1257
amdsmi_range_t curr_sclk_range
The current SCLK frequency range.
Definition: amdsmi.h:1247
amdsmi_range_t sclk_freq_limits
The range possible of SCLK values.
Definition: amdsmi.h:1250
amdsmi_od_volt_curve_t curve
The current voltage curve.
Definition: amdsmi.h:1256
This structure holds information about the possible PCIe bandwidths. Specifically,...
Definition: amdsmi.h:1190
amdsmi_frequencies_t transfer_rate
Definition: amdsmi.h:1194
Definition: amdsmi.h:509
uint64_t pcie_nak_received_count
total number of NAKs issued on the PCIe link by the receiver
Definition: amdsmi.h:517
uint64_t pcie_replay_count
total number of the replays issued on the PCIe link
Definition: amdsmi.h:513
uint16_t pcie_width
current PCIe width
Definition: amdsmi.h:510
uint32_t pcie_speed
current PCIe speed in MT/s
Definition: amdsmi.h:511
uint32_t pcie_bandwidth
current PCIe bandwidth Mb/s
Definition: amdsmi.h:512
uint64_t pcie_l0_to_recovery_count
total number of times the PCIe link transitioned from L0 to the recovery state
Definition: amdsmi.h:514
uint64_t pcie_nak_sent_count
total number of NAKs issued on the PCIe link by the device
Definition: amdsmi.h:516
uint64_t pcie_replay_roll_over_count
total number of replay rollovers issued on the PCIe link
Definition: amdsmi.h:515
Definition: amdsmi.h:502
uint16_t max_pcie_width
maximum number of PCIe lanes
Definition: amdsmi.h:503
amdsmi_card_form_factor_t slot_type
card form factor
Definition: amdsmi.h:506
uint32_t max_pcie_speed
maximum PCIe speed
Definition: amdsmi.h:504
uint32_t pcie_interface_version
PCIe interface version.
Definition: amdsmi.h:505
Definition: amdsmi.h:501
Definition: amdsmi.h:523
Definition: amdsmi.h:629
This structure contains information about which power profiles are supported by the system for a give...
Definition: amdsmi.h:1111
amdsmi_bit_field_t available_profiles
Definition: amdsmi.h:1115
amdsmi_power_profile_preset_masks_t current
Definition: amdsmi.h:1120
uint32_t num_profiles
Definition: amdsmi.h:1125
Definition: amdsmi.h:666
Definition: amdsmi.h:671
Definition: amdsmi.h:662
This structure contains information specific to a process.
Definition: amdsmi.h:1472
uint64_t sdma_usage
SDMA usage in microseconds.
Definition: amdsmi.h:1476
uint32_t process_id
Process ID.
Definition: amdsmi.h:1473
uint32_t cu_occupancy
Compute Unit usage in percent.
Definition: amdsmi.h:1477
uint32_t pasid
PASID.
Definition: amdsmi.h:1474
uint64_t vram_usage
VRAM usage.
Definition: amdsmi.h:1475
This structure represents a range (e.g., frequencies or voltages).
Definition: amdsmi.h:459
uint64_t lower_bound
Lower bound of range.
Definition: amdsmi.h:460
uint64_t upper_bound
Upper bound of range.
Definition: amdsmi.h:461
This structure holds ras feature.
Definition: amdsmi.h:1452
uint32_t ecc_correction_schema_flag
ecc_correction_schema mask
Definition: amdsmi.h:1456
Reserved Memory Page Record.
Definition: amdsmi.h:1095
uint64_t page_size
Page size.
Definition: amdsmi.h:1097
amdsmi_memory_page_status_t status
Page "reserved" status.
Definition: amdsmi.h:1098
uint64_t page_address
Start address of page.
Definition: amdsmi.h:1096
This structure holds SMU Firmware version information.
Definition: amdsmi.h:1488
uint8_t debug
SMU fw Debug version number.
Definition: amdsmi.h:1489
uint8_t major
SMU fw Major version number.
Definition: amdsmi.h:1491
uint8_t unused
reserved fields
Definition: amdsmi.h:1492
uint8_t minor
SMU fw Minor version number.
Definition: amdsmi.h:1490
temperature range and refresh rate metrics of a DIMM
Definition: amdsmi.h:1507
uint8_t range
temp range[2:0](3 bit data)
Definition: amdsmi.h:1508
uint8_t ref_rate
DDR refresh rate mode[3](1 bit data)
Definition: amdsmi.h:1509
The utilization counter data.
Definition: amdsmi.h:1087
amdsmi_utilization_counter_type_t type
Utilization counter type.
Definition: amdsmi.h:1088
uint64_t value
Utilization counter value.
Definition: amdsmi.h:1089
Definition: amdsmi.h:532
This structure holds version information.
Definition: amdsmi.h:1206
uint32_t minor
Minor version.
Definition: amdsmi.h:1209
uint32_t major
Major version.
Definition: amdsmi.h:1208
const char * build
Full Build version string.
Definition: amdsmi.h:1211
uint32_t year
Last 2 digits of the Year released.
Definition: amdsmi.h:1207
uint32_t release
Patch, build or stepping version.
Definition: amdsmi.h:1210
Definition: amdsmi.h:607
Definition: amdsmi.h:473
Definition: amdsmi.h:465
Definition: amdsmi.h:485