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 2
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_CEM,
499  AMDSMI_CARD_FORM_FACTOR_UNKNOWN
500 } amdsmi_card_form_factor_t;
501 
502 typedef struct {
503  struct pcie_static_ {
504  uint16_t max_pcie_width;
505  uint32_t max_pcie_speed;
507  amdsmi_card_form_factor_t slot_type;
508  uint64_t reserved[10];
509  } pcie_static;
510  struct pcie_metric_ {
511  uint16_t pcie_width;
512  uint32_t pcie_speed;
513  uint32_t pcie_bandwidth;
514  uint64_t pcie_replay_count;
519  uint64_t reserved[13];
520  } pcie_metric;
521  uint64_t reserved[32];
523 
524 typedef struct {
525  uint64_t power_cap;
526  uint64_t default_power_cap;
527  uint64_t dpm_cap;
528  uint64_t min_power_cap;
529  uint64_t max_power_cap;
530  uint64_t reserved[3];
532 
533 typedef struct {
534  char name[AMDSMI_MAX_STRING_LENGTH];
535  char build_date[AMDSMI_MAX_DATE_LENGTH];
536  char part_number[AMDSMI_MAX_STRING_LENGTH];
537  char version[AMDSMI_NORMAL_STRING_LENGTH];
538  uint32_t reserved[16];
540 
544 typedef enum {
545  AMDSMI_CACHE_PROPERTY_ENABLED = 0x00000001,
546  AMDSMI_CACHE_PROPERTY_DATA_CACHE = 0x00000002,
547  AMDSMI_CACHE_PROPERTY_INST_CACHE = 0x00000004,
548  AMDSMI_CACHE_PROPERTY_CPU_CACHE = 0x00000008,
549  AMDSMI_CACHE_PROPERTY_SIMD_CACHE = 0x00000010,
551 
552 typedef struct {
553  uint32_t num_cache_types;
554  struct cache_ {
555  uint32_t cache_properties; // amdsmi_cache_property_type_t which is a bitmask
556  uint32_t cache_size; /* In KB */
557  uint32_t cache_level;
558  uint32_t max_num_cu_shared; /* Indicates how many Compute Units share this cache instance */
559  uint32_t num_cache_instance; /* total number of instance of this cache type */
560  uint32_t reserved[3];
561  } cache[AMDSMI_MAX_CACHE_TYPES];
562  uint32_t reserved[15];
564 
565 typedef struct {
566  uint8_t num_fw_info;
567  struct fw_info_list_ {
568  amdsmi_fw_block_t fw_id;
569  uint64_t fw_version;
570  uint64_t reserved[2];
571  } fw_info_list[FW_ID__MAX];
572  uint32_t reserved[7];
574 
575 typedef struct {
576  char market_name[AMDSMI_MAX_STRING_LENGTH];
577  uint32_t vendor_id; //< Use 32 bit to be compatible with other platform.
578  char vendor_name[AMDSMI_MAX_STRING_LENGTH];
579  uint32_t subvendor_id; //< The subsystem vendor id
580  uint64_t device_id; //< The device id of a GPU
581  uint32_t rev_id;
582  char asic_serial[AMDSMI_NORMAL_STRING_LENGTH];
583  uint16_t oam_id; //< 0xFFFF if not supported
584  uint16_t reserved[37];
586 
587 typedef enum {
588  AMDSMI_LINK_TYPE_PCIE,
589  AMDSMI_LINK_TYPE_XGMI,
590  AMDSMI_LINK_TYPE_NOT_APPLICABLE,
591  AMDSMI_LINK_TYPE_UNKNOWN
592 } amdsmi_link_type_t;
593 
594 typedef struct {
595  uint32_t num_links;
596  struct _links {
597  amdsmi_bdf_t bdf;
598  uint32_t bit_rate;
599  uint32_t max_bandwidth;
600  amdsmi_link_type_t link_type;
601  uint64_t read;
602  uint64_t write;
603  uint64_t reserved[2];
604  } links[AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK];
605  uint64_t reserved[7];
607 
608 typedef struct {
609  amdsmi_vram_type_t vram_type;
610  amdsmi_vram_vendor_type_t vram_vendor;
611  uint64_t vram_size_mb;
613 
614 
615 typedef struct {
616  char driver_version[AMDSMI_MAX_STRING_LENGTH];
617  char driver_date[AMDSMI_MAX_STRING_LENGTH];
618  char driver_name[AMDSMI_MAX_STRING_LENGTH];
620 
621 typedef struct {
622  char model_number[AMDSMI_NORMAL_STRING_LENGTH];
623  char product_serial[AMDSMI_NORMAL_STRING_LENGTH];
624  char fru_id[AMDSMI_NORMAL_STRING_LENGTH];
625  char product_name[AMDSMI_PRODUCT_NAME_LENGTH];
626  char manufacturer_name[AMDSMI_NORMAL_STRING_LENGTH];
627  uint32_t reserved[32];
629 
630 typedef struct {
631  uint32_t current_socket_power;
632  uint32_t average_socket_power;
633  uint32_t gfx_voltage; // GFX voltage measurement in mV
634  uint32_t soc_voltage; // SOC voltage measurement in mV
635  uint32_t mem_voltage; // MEM voltage measurement in mV
636  uint32_t power_limit; // The power limit;
637  uint32_t reserved[11];
639 
640 typedef struct {
641  uint32_t cur_clk;
642  uint32_t min_clk;
643  uint32_t max_clk;
644  uint32_t sleep_clk;
645  uint32_t reserved[4];
647 
654 typedef struct {
655  uint32_t gfx_activity;
656  uint32_t umc_activity;
657  uint32_t mm_activity;
658  uint32_t reserved[13];
660 typedef uint32_t amdsmi_process_handle_t;
661 
662 
663 typedef struct {
664  char name[AMDSMI_NORMAL_STRING_LENGTH];
665  amdsmi_process_handle_t pid;
666  uint64_t mem;
667  struct engine_usage_ {
668  uint64_t gfx;
669  uint64_t enc;
670  uint32_t reserved[12];
671  } engine_usage;
672  struct memory_usage_ {
673  uint64_t gtt_mem;
674  uint64_t cpu_mem;
675  uint64_t vram_mem;
676  uint32_t reserved[10];
677  } memory_usage;
678  char container_name[AMDSMI_NORMAL_STRING_LENGTH];
679  uint32_t reserved[4];
681 
682 
684 #define AMDSMI_MAX_NUM_FREQUENCIES 33
685 
688 #define AMDSMI_MAX_FAN_SPEED 255
689 
691 #define AMDSMI_NUM_VOLTAGE_CURVE_POINTS 3
695 typedef enum {
697  AMDSMI_DEV_PERF_LEVEL_FIRST = AMDSMI_DEV_PERF_LEVEL_AUTO,
698 
713 
714  AMDSMI_DEV_PERF_LEVEL_LAST = AMDSMI_DEV_PERF_LEVEL_DETERMINISM,
715 
718 
731 typedef uintptr_t amdsmi_event_handle_t;
732 
739 typedef enum {
742  AMDSMI_EVNT_GRP_INVALID = 0xFFFFFFFF
744 
751 typedef enum {
752  AMDSMI_EVNT_FIRST = AMDSMI_EVNT_GRP_XGMI,
753 
754  AMDSMI_EVNT_XGMI_FIRST = AMDSMI_EVNT_GRP_XGMI,
755  AMDSMI_EVNT_XGMI_0_NOP_TX = AMDSMI_EVNT_XGMI_FIRST,
760 
773  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
783 
784  AMDSMI_EVNT_XGMI_LAST = AMDSMI_EVNT_XGMI_1_BEATS_TX, // 5
785 
786  AMDSMI_EVNT_XGMI_DATA_OUT_FIRST = AMDSMI_EVNT_GRP_XGMI_DATA_OUT, // 10
787 
788  /*
789  * @brief Events in the AMDSMI_EVNT_GRP_XGMI_DATA_OUT group measure
790  * the number of beats sent on an XGMI link. Each beat represents
791  * 32 bytes. AMDSMI_EVNT_XGMI_DATA_OUT_n represents the number of
792  * outbound beats (each representing 32 bytes) on link n.<br><br>
793  *
794  * XGMI throughput can be calculated by multiplying a event
795  * such as ::AMDSMI_EVNT_XGMI_DATA_OUT_n by 32 and dividing by
796  * the time for which event collection occurred,
797  * ::amdsmi_counter_value_t.time_running (which is in nanoseconds). To get
798  * bytes per second, multiply this value by 10<sup>9</sup>.<br>
799  * <br>
800  * Throughput = BEATS/time_running * 10<sup>9</sup> (bytes/second)<br>
801  */
802  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
803  AMDSMI_EVNT_XGMI_DATA_OUT_0 = AMDSMI_EVNT_XGMI_DATA_OUT_FIRST,
809  AMDSMI_EVNT_XGMI_DATA_OUT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_5,
810 
811  AMDSMI_EVNT_LAST = AMDSMI_EVNT_XGMI_DATA_OUT_LAST,
813 
817 typedef enum {
822 
826 typedef struct {
827  uint64_t value;
828  uint64_t time_enabled;
830  uint64_t time_running;
833 
837 typedef enum {
839  AMDSMI_EVT_NOTIF_FIRST = AMDSMI_EVT_NOTIF_VMFAULT,
840  AMDSMI_EVT_NOTIF_THERMAL_THROTTLE = 2,
841  AMDSMI_EVT_NOTIF_GPU_PRE_RESET = 3,
842  AMDSMI_EVT_NOTIF_GPU_POST_RESET = 4,
843 
844  AMDSMI_EVT_NOTIF_LAST = AMDSMI_EVT_NOTIF_GPU_POST_RESET
846 
850 #define AMDSMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
851 
853 #define MAX_EVENT_NOTIFICATION_MSG_SIZE 64
854 
858 typedef struct {
863 
869 typedef enum {
871  AMDSMI_TEMP_FIRST = AMDSMI_TEMP_CURRENT,
872 
903 
904  AMDSMI_TEMP_LAST = AMDSMI_TEMP_HIGHEST
906 
912 typedef enum {
914 
915  AMDSMI_VOLT_FIRST = AMDSMI_VOLT_CURRENT,
923 
924  AMDSMI_VOLT_LAST = AMDSMI_VOLT_HIGHEST
926 
931 typedef enum {
932  AMDSMI_VOLT_TYPE_FIRST = 0,
933 
934  AMDSMI_VOLT_TYPE_VDDGFX = AMDSMI_VOLT_TYPE_FIRST,
936  AMDSMI_VOLT_TYPE_LAST = AMDSMI_VOLT_TYPE_VDDGFX,
937  AMDSMI_VOLT_TYPE_INVALID = 0xFFFFFFFF
939 
946 typedef enum {
952 
954  AMDSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK = 0x20,
957 
959  AMDSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF
961 
965 typedef enum {
966  AMDSMI_GPU_BLOCK_INVALID = 0x0000000000000000,
968  AMDSMI_GPU_BLOCK_FIRST = 0x0000000000000001,
969 
970  AMDSMI_GPU_BLOCK_UMC = AMDSMI_GPU_BLOCK_FIRST,
971  AMDSMI_GPU_BLOCK_SDMA = 0x0000000000000002,
972  AMDSMI_GPU_BLOCK_GFX = 0x0000000000000004,
973  AMDSMI_GPU_BLOCK_MMHUB = 0x0000000000000008,
974  AMDSMI_GPU_BLOCK_ATHUB = 0x0000000000000010,
975  AMDSMI_GPU_BLOCK_PCIE_BIF = 0x0000000000000020,
976  AMDSMI_GPU_BLOCK_HDP = 0x0000000000000040,
977  AMDSMI_GPU_BLOCK_XGMI_WAFL = 0x0000000000000080,
978  AMDSMI_GPU_BLOCK_DF = 0x0000000000000100,
979  AMDSMI_GPU_BLOCK_SMN = 0x0000000000000200,
980  AMDSMI_GPU_BLOCK_SEM = 0x0000000000000400,
981  AMDSMI_GPU_BLOCK_MP0 = 0x0000000000000800,
982  AMDSMI_GPU_BLOCK_MP1 = 0x0000000000001000,
983  AMDSMI_GPU_BLOCK_FUSE = 0x0000000000002000,
984  AMDSMI_GPU_BLOCK_MCA = 0x0000000000004000,
985  AMDSMI_GPU_BLOCK_VCN = 0x0000000000008000,
986  AMDSMI_GPU_BLOCK_JPEG = 0x0000000000010000,
987  AMDSMI_GPU_BLOCK_IH = 0x0000000000020000,
988  AMDSMI_GPU_BLOCK_MPIO = 0x0000000000040000,
989 
992  AMDSMI_GPU_BLOCK_RESERVED = 0x8000000000000000
994 
998 typedef enum {
1007 
1008  AMDSMI_RAS_ERR_STATE_LAST = AMDSMI_RAS_ERR_STATE_ENABLED,
1009  AMDSMI_RAS_ERR_STATE_INVALID = 0xFFFFFFFF
1011 
1015 typedef enum {
1016  AMDSMI_MEM_TYPE_FIRST = 0,
1017 
1018  AMDSMI_MEM_TYPE_VRAM = AMDSMI_MEM_TYPE_FIRST,
1021 
1022  AMDSMI_MEM_TYPE_LAST = AMDSMI_MEM_TYPE_GTT
1024 
1028 typedef enum {
1031  AMDSMI_FREQ_IND_INVALID = 0xFFFFFFFF
1033 
1037 typedef enum {
1038  AMDSMI_XGMI_STATUS_NO_ERRORS = 0,
1039  AMDSMI_XGMI_STATUS_ERROR,
1040  AMDSMI_XGMI_STATUS_MULTIPLE_ERRORS,
1042 
1046 typedef uint64_t amdsmi_bit_field_t;
1047 
1051 typedef enum {
1059 
1063 typedef enum {
1068  AMDSMI_IOLINK_TYPE_SIZE = 0xFFFFFFFF
1070 
1074 typedef enum {
1077  AMDSMI_COARSE_GRAIN_GFX_ACTIVITY = AMDSMI_UTILIZATION_COUNTER_FIRST,
1079  AMDSMI_UTILIZATION_COUNTER_LAST = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY
1081 
1085 typedef enum {
1088  AMDSMI_INVALID_POWER = 0xFFFFFFFF
1090 
1094 typedef struct {
1096  uint64_t value;
1098 
1102 typedef struct {
1103  uint64_t page_address;
1104  uint64_t page_size;
1107 
1111 #define AMDSMI_MAX_NUM_POWER_PROFILES (sizeof(amdsmi_bit_field_t) * 8)
1112 
1118 typedef struct {
1123 
1128 
1132  uint32_t num_profiles;
1134 
1138 typedef struct {
1143 
1147  uint32_t num_supported;
1148 
1152  uint32_t current;
1153 
1158  uint64_t frequency[AMDSMI_MAX_NUM_FREQUENCIES];
1160 
1164 typedef struct {
1165  uint32_t policy_id;
1166  char policy_description[AMDSMI_MAX_NAME];
1168 
1169 #define AMDSMI_MAX_NUM_PM_POLICIES 32
1170 
1174 typedef struct {
1178  uint32_t num_supported;
1179 
1183  uint32_t current;
1184 
1189  amdsmi_dpm_policy_entry_t policies[AMDSMI_MAX_NUM_PM_POLICIES];
1191 
1197 typedef struct {
1202 
1209 
1213 typedef struct {
1214  uint32_t year;
1215  uint32_t major;
1216  uint32_t minor;
1217  uint32_t release;
1218  const char *build;
1220 
1224 typedef struct {
1225  uint64_t frequency;
1226  uint64_t voltage;
1228 
1234 typedef struct {
1238 
1242 typedef struct {
1249 
1253 typedef struct {
1259 
1264  uint32_t num_regions;
1266 
1274 typedef struct {
1275  // TODO(amd) Doxygen documents
1276  // Note: This should match: AMDGpuMetricsHeader_v1_t
1278  uint16_t structure_size;
1279  uint8_t format_revision;
1280  uint8_t content_revision;
1283 
1284 typedef struct {
1285  // TODO(amd) Doxygen documents
1286  // Note: This structure is extended to fit the needs of different GPU metric
1287  // versions when exposing data through the structure.
1288  // Depending on the version, some data members will hold data, and
1289  // some will not. A good example is the set of 'current clocks':
1290  // - current_gfxclk, current_socclk, current_vclk0, current_dclk0
1291  // These are single-valued data members, up to version 1.3.
1292  // For version 1.4 and up these are multi-valued data members (arrays)
1293  // and their counterparts;
1294  // - current_gfxclks[], current_socclks[], current_vclk0s[],
1295  // current_dclk0s[]
1296  // will hold the data
1298  amd_metrics_table_header_t common_header;
1299 
1300  /*
1301  * v1.0 Base
1302  */
1303  // Temperature (C)
1304  uint16_t temperature_edge;
1305  uint16_t temperature_hotspot;
1306  uint16_t temperature_mem;
1307  uint16_t temperature_vrgfx;
1308  uint16_t temperature_vrsoc;
1309  uint16_t temperature_vrmem;
1310 
1311  // Utilization (%)
1312  uint16_t average_gfx_activity;
1313  uint16_t average_umc_activity; // memory controller
1314  uint16_t average_mm_activity; // UVD or VCN
1315 
1316  // Power (W) /Energy (15.259uJ per 1ns)
1317  uint16_t average_socket_power;
1318  uint64_t energy_accumulator; // v1 mod. (32->64)
1319 
1320  // Driver attached timestamp (in ns)
1321  uint64_t system_clock_counter; // v1 mod. (moved from top of struct)
1322 
1323  // Average clocks (MHz)
1324  uint16_t average_gfxclk_frequency;
1325  uint16_t average_socclk_frequency;
1326  uint16_t average_uclk_frequency;
1327  uint16_t average_vclk0_frequency;
1328  uint16_t average_dclk0_frequency;
1329  uint16_t average_vclk1_frequency;
1330  uint16_t average_dclk1_frequency;
1331 
1332  // Current clocks (MHz)
1333  uint16_t current_gfxclk;
1334  uint16_t current_socclk;
1335  uint16_t current_uclk;
1336  uint16_t current_vclk0;
1337  uint16_t current_dclk0;
1338  uint16_t current_vclk1;
1339  uint16_t current_dclk1;
1340 
1341  // Throttle status
1342  uint32_t throttle_status;
1343 
1344  // Fans (RPM)
1345  uint16_t current_fan_speed;
1346 
1347  // Link width (number of lanes) /speed (0.1 GT/s)
1348  uint16_t pcie_link_width; // v1 mod.(8->16)
1349  uint16_t pcie_link_speed; // in 0.1 GT/s; v1 mod. (8->16)
1350 
1351 
1352  /*
1353  * v1.1 additions
1354  */
1355  uint32_t gfx_activity_acc; // new in v1
1356  uint32_t mem_activity_acc; // new in v1
1357  uint16_t temperature_hbm[AMDSMI_NUM_HBM_INSTANCES]; // new in v1
1358 
1359 
1360  /*
1361  * v1.2 additions
1362  */
1363  // PMFW attached timestamp (10ns resolution)
1364  uint64_t firmware_timestamp;
1365 
1366 
1367  /*
1368  * v1.3 additions
1369  */
1370  // Voltage (mV)
1371  uint16_t voltage_soc;
1372  uint16_t voltage_gfx;
1373  uint16_t voltage_mem;
1374 
1375  // Throttle status
1376  uint64_t indep_throttle_status;
1377 
1378 
1379  /*
1380  * v1.4 additions
1381  */
1382  // Power (Watts)
1383  uint16_t current_socket_power;
1384 
1385  // Utilization (%)
1386  uint16_t vcn_activity[AMDSMI_MAX_NUM_VCN];
1387 
1388  // Clock Lock Status. Each bit corresponds to clock instance
1389  uint32_t gfxclk_lock_status;
1390 
1391  // XGMI bus width and bitrate (in GB/s)
1392  uint16_t xgmi_link_width;
1393  uint16_t xgmi_link_speed;
1394 
1395  // PCIe accumulated bandwidth (GB/sec)
1396  uint64_t pcie_bandwidth_acc;
1397 
1398  // PCIe instantaneous bandwidth (GB/sec)
1399  uint64_t pcie_bandwidth_inst;
1400 
1401  // PCIE L0 to recovery state transition accumulated count
1402  uint64_t pcie_l0_to_recov_count_acc;
1403 
1404  // PCIE replay accumulated count
1405  uint64_t pcie_replay_count_acc;
1406 
1407  // PCIE replay rollover accumulated count
1408  uint64_t pcie_replay_rover_count_acc;
1409 
1410  // XGMI accumulated data transfer size (KB)
1411  uint64_t xgmi_read_data_acc[AMDSMI_MAX_NUM_XGMI_LINKS];
1412  uint64_t xgmi_write_data_acc[AMDSMI_MAX_NUM_XGMI_LINKS];
1413 
1414  // Current clock frequencies (MHz)
1415  uint16_t current_gfxclks[AMDSMI_MAX_NUM_GFX_CLKS];
1416  uint16_t current_socclks[AMDSMI_MAX_NUM_CLKS];
1417  uint16_t current_vclk0s[AMDSMI_MAX_NUM_CLKS];
1418  uint16_t current_dclk0s[AMDSMI_MAX_NUM_CLKS];
1419 
1420  /*
1421  * v1.5 additions
1422  */
1423  // JPEG activity % per AID
1424  uint16_t jpeg_activity[AMDSMI_MAX_NUM_JPEG];
1425 
1426  // PCIE NAK sent accumulated count
1427  uint32_t pcie_nak_sent_count_acc;
1428 
1429  // PCIE NAK received accumulated count
1430  uint32_t pcie_nak_rcvd_count_acc;
1433 
1434 
1435 #define MAX_AMDSMI_NAME_LENGTH 64
1436 
1440 typedef struct {
1441  char name[MAX_AMDSMI_NAME_LENGTH];
1442  uint64_t value;
1444 
1448 typedef enum {
1449  AMDSMI_REG_XGMI,
1450  AMDSMI_REG_WAFL,
1451  AMDSMI_REG_PCIE,
1452  AMDSMI_REG_USR,
1453  AMDSMI_REG_USR1,
1455 
1459 typedef struct {
1460  uint32_t ras_eeprom_version;
1461  // PARITY error(bit 0), Single Bit correctable (bit1),
1462  // Double bit error detection (bit2), Poison (bit 3).
1465 
1469 typedef struct {
1472  uint64_t deferred_count;
1473  uint64_t reserved[5];
1475 
1479 typedef struct {
1480  uint32_t process_id;
1481  uint32_t pasid;
1482  uint64_t vram_usage;
1483  uint64_t sdma_usage;
1484  uint32_t cu_occupancy;
1486 
1489 #define AMDSMI_DEFAULT_VARIANT 0xFFFFFFFFFFFFFFFF
1490 
1491 #ifdef ENABLE_ESMI_LIB
1495 typedef struct {
1496  uint8_t debug;
1497  uint8_t minor;
1498  uint8_t major;
1499  uint8_t unused;
1501 
1505 typedef struct {
1506  uint32_t max_bw;
1507  uint32_t utilized_bw;
1508  uint32_t utilized_pct;
1510 
1514 typedef struct {
1515  uint8_t range : 3;
1516  uint8_t ref_rate : 1;
1518 
1522 typedef struct {
1523  uint16_t power : 15;
1524  uint16_t update_rate : 9;
1525  uint8_t dimm_addr;
1527 
1531 typedef struct {
1532  uint16_t sensor : 11;
1533  uint16_t update_rate : 9;
1534  uint8_t dimm_addr;
1535  float temp;
1537 
1541 typedef enum {
1542  AGG_BW0 = 1,
1543  RD_BW0 = 2,
1544  WR_BW0 = 4
1546 
1554 typedef struct {
1556  char *link_name;
1558 
1563 typedef struct {
1564  uint8_t max_dpm_level;
1565  uint8_t min_dpm_level;
1567 
1571 typedef struct __attribute__((__packed__)){
1572  uint32_t accumulation_counter;
1573 
1574  /* TEMPERATURE */
1575  uint32_t max_socket_temperature;
1576  uint32_t max_vr_temperature;
1577  uint32_t max_hbm_temperature;
1578  uint64_t max_socket_temperature_acc;
1579  uint64_t max_vr_temperature_acc;
1580  uint64_t max_hbm_temperature_acc;
1581 
1582  /* POWER */
1583  uint32_t socket_power_limit;
1584  uint32_t max_socket_power_limit;
1585  uint32_t socket_power;
1586 
1587  /* ENERGY */
1588  uint64_t timestamp;
1589  uint64_t socket_energy_acc;
1590  uint64_t ccd_energy_acc;
1591  uint64_t xcd_energy_acc;
1592  uint64_t aid_energy_acc;
1593  uint64_t hbm_energy_acc;
1594 
1595  /* FREQUENCY */
1596  uint32_t cclk_frequency_limit;
1597  uint32_t gfxclk_frequency_limit;
1598  uint32_t fclk_frequency;
1599  uint32_t uclk_frequency;
1600  uint32_t socclk_frequency[4];
1601  uint32_t vclk_frequency[4];
1602  uint32_t dclk_frequency[4];
1603  uint32_t lclk_frequency[4];
1604  uint64_t gfxclk_frequency_acc[8];
1605  uint64_t cclk_frequency_acc[96];
1606 
1607  /* FREQUENCY RANGE */
1608  uint32_t max_cclk_frequency;
1609  uint32_t min_cclk_frequency;
1610  uint32_t max_gfxclk_frequency;
1611  uint32_t min_gfxclk_frequency;
1612  uint32_t fclk_frequency_table[4];
1613  uint32_t uclk_frequency_table[4];
1614  uint32_t socclk_frequency_table[4];
1615  uint32_t vclk_frequency_table[4];
1616  uint32_t dclk_frequency_table[4];
1617  uint32_t lclk_frequency_table[4];
1618  uint32_t max_lclk_dpm_range;
1619  uint32_t min_lclk_dpm_range;
1620 
1621  /* XGMI */
1622  uint32_t xgmi_width;
1623  uint32_t xgmi_bitrate;
1624  uint64_t xgmi_read_bandwidth_acc[8];
1625  uint64_t xgmi_write_bandwidth_acc[8];
1626 
1627  /* ACTIVITY */
1628  uint32_t socket_c0_residency;
1629  uint32_t socket_gfx_busy;
1630  uint32_t dram_bandwidth_utilization;
1631  uint64_t socket_c0_residency_acc;
1632  uint64_t socket_gfx_busy_acc;
1633  uint64_t dram_bandwidth_acc;
1634  uint32_t max_dram_bandwidth;
1635  uint64_t dram_bandwidth_utilization_acc;
1636  uint64_t pcie_bandwidth_acc[4];
1637 
1638  /* THROTTLERS */
1639  uint32_t prochot_residency_acc;
1640  uint32_t ppt_residency_acc;
1641  uint32_t socket_thm_residency_acc;
1642  uint32_t vr_thm_residency_acc;
1643  uint32_t hbm_thm_residency_acc;
1644  uint32_t spare;
1645 
1646  /* New items at the end to maintain driver compatibility */
1647  uint32_t gfxclk_frequency[8];
1648 } amdsmi_hsmp_metrics_table_t;
1649 
1653 static char* const amdsmi_hsmp_freqlimit_src_names[] = {
1654  "cHTC-Active",
1655  "PROCHOT",
1656  "TDC limit",
1657  "PPT Limit",
1658  "OPN Max",
1659  "Reliability Limit",
1660  "APML Agent",
1661  "HSMP Agent"
1662 };
1663 #endif
1664 
1665 /*****************************************************************************/
1692 amdsmi_status_t amdsmi_init(uint64_t init_flags);
1693 
1706 
1709 /*****************************************************************************/
1745  amdsmi_socket_handle* socket_handles);
1746 
1747 #ifdef ENABLE_ESMI_LIB
1775  amdsmi_cpusocket_handle* socket_handles);
1776 #endif
1777 
1796  amdsmi_socket_handle socket_handle,
1797  size_t len, char *name);
1798 
1799 #ifdef ENABLE_ESMI_LIB
1817  amdsmi_processor_handle processor_handle,
1818  size_t len, char *name);
1819 
1842  uint32_t* processor_count, uint32_t* nr_cpusockets,
1843  uint32_t* nr_cpucores, uint32_t* nr_gpus);
1844 
1864 amdsmi_status_t amdsmi_get_processor_handles_by_type(amdsmi_socket_handle socket_handle,
1865  processor_type_t processor_type,
1866  amdsmi_processor_handle* processor_handles,
1867  uint32_t* processor_count);
1868 #endif
1869 
1904 amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle,
1905  uint32_t *processor_count,
1906  amdsmi_processor_handle* processor_handles);
1907 
1908 #ifdef ENABLE_ESMI_LIB
1933 amdsmi_status_t amdsmi_get_cpucore_handles(amdsmi_cpusocket_handle socket_handle,
1934  uint32_t *processor_count,
1935  amdsmi_processor_handle* processor_handles);
1936 #endif
1937 
1956  processor_type_t* processor_type);
1957 
1974  amdsmi_processor_handle* processor_handle);
1975 
1978 /*****************************************************************************/
2010 
2027 
2062  size_t len);
2063 
2089  uint32_t len);
2090 
2113 
2148 amdsmi_get_gpu_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len);
2149 
2152 /*****************************************************************************/
2179  amdsmi_pcie_bandwidth_t *bandwidth);
2180 
2216 
2239  int32_t *numa_node);
2240 
2266  uint64_t *received, uint64_t *max_pkt_sz);
2267 
2290  uint64_t *counter);
2291 
2294 /*****************************************************************************/
2333  uint64_t bw_bitmask);
2334 
2337 /*****************************************************************************/
2373 amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power,
2374  float *counter_resolution, uint64_t *timestamp);
2375 
2378 /*****************************************************************************/
2404  amdsmi_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap);
2405 
2426  amdsmi_set_gpu_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved,
2428 
2431 /*****************************************************************************/
2462  uint64_t *total);
2463 
2488  uint64_t *used);
2489 
2510 amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages,
2512 
2526  amdsmi_processor_handle processor_handle, amdsmi_ras_feature_t *ras_feature);
2527 
2528 
2554  amdsmi_gpu_block_t block,
2555  amdsmi_ras_err_state_t *state);
2556 
2592  uint32_t *num_pages,
2593  amdsmi_retired_page_record_t *records);
2594 
2628  uint32_t sensor_ind, int64_t *speed);
2629 
2656  uint32_t sensor_ind, int64_t *speed);
2657 
2683  uint32_t sensor_ind, uint64_t *max_speed);
2684 
2715  amdsmi_temperature_type_t sensor_type,
2716  amdsmi_temperature_metric_t metric, int64_t *temperature);
2717 
2731  amdsmi_processor_handle processor_handle, amdsmi_gpu_cache_info_t *info);
2732 
2763  amdsmi_voltage_type_t sensor_type,
2764  amdsmi_voltage_metric_t metric, int64_t *voltage);
2765 
2768 /*****************************************************************************/
2789 amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind);
2790 
2814  uint32_t sensor_ind, uint64_t speed);
2815 
2818 /*****************************************************************************/
2853  amdsmi_utilization_counter_t utilization_counters[],
2854  uint32_t count,
2855  uint64_t *timestamp);
2856 
2879  amdsmi_dev_perf_level_t *perf);
2880 
2903 
2927  uint32_t *od);
2928 
2952 
2966 
2989 
3010 
3032  amdsmi_gpu_metrics_t *pgpu_metrics);
3033 
3066  amdsmi_processor_handle processor_handle,
3067  amdsmi_name_value_t** pm_metrics,
3068  uint32_t *num_of_metrics);
3069 
3104  amdsmi_processor_handle processor_handle,
3105  amdsmi_reg_type_t reg_type,
3106  amdsmi_name_value_t** reg_metrics,
3107  uint32_t *num_of_metrics);
3108 
3132  uint64_t minclkvalue,
3133  uint64_t maxclkvalue,
3134  amdsmi_clk_type_t clkType);
3135 
3159  amdsmi_freq_ind_t level,
3160  uint64_t clkvalue,
3161  amdsmi_clk_type_t clkType);
3162 
3185  uint32_t vpoint,
3186  uint64_t clkvalue,
3187  uint64_t voltvalue);
3188 
3227  uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer);
3228 
3263  amdsmi_get_gpu_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind,
3265 
3268 /*****************************************************************************/
3296 
3336 
3372  amdsmi_clk_type_t clk_type, uint64_t freq_bitmask);
3373 
3392  amdsmi_dpm_policy_t* policy);
3393 
3414  uint32_t policy_id);
3415 
3434  amdsmi_dpm_policy_t* xgmi_plpd);
3435 
3456  uint32_t plpd_id);
3457 
3458 
3477  uint32_t* pisolate);
3478 
3497  uint32_t pisolate);
3498 
3518  uint32_t sclean);
3519 
3522 /*****************************************************************************/
3544 
3547 /*****************************************************************************/
3580 
3608  uint64_t *enabled_blocks);
3609 
3635  amdsmi_gpu_block_t block,
3636  amdsmi_ras_err_state_t *state);
3637 
3654 amdsmi_status_code_to_string(amdsmi_status_t status, const char **status_string);
3655 
3658 /*****************************************************************************/
3779 
3808  amdsmi_event_handle_t *evnt_handle);
3809 
3826 
3848  amdsmi_counter_command_t cmd, void *cmd_args);
3849 
3870  amdsmi_counter_value_t *value);
3871 
3894  amdsmi_event_group_t grp, uint32_t *available);
3895 
3898 /*****************************************************************************/
3936 
3957 
3990 amdsmi_get_gpu_compute_process_gpus(uint32_t pid, uint32_t *dv_indices,
3991  uint32_t *num_devices);
3992 
3995 /*****************************************************************************/
4025 
4042 
4045 /*****************************************************************************/
4064  amdsmi_link_metrics_t *link_metrics);
4065 
4084 amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node);
4085 
4108  uint64_t *weight);
4109 
4135  amdsmi_processor_handle processor_handle_dst,
4136  uint64_t *min_bandwidth,
4137  uint64_t *max_bandwidth);
4138 
4165  amdsmi_processor_handle processor_handle_dst,
4166  uint64_t *hops, amdsmi_io_link_type_t *type);
4167 
4190  amdsmi_processor_handle processor_handle_dst,
4191  bool *accessible);
4192 
4195 /*****************************************************************************/
4234  char *compute_partition, uint32_t len);
4235 
4262  amdsmi_compute_partition_type_t compute_partition);
4263 
4282  // end of compute_partition
4284 
4285 /*****************************************************************************/
4324  char *memory_partition, uint32_t len);
4325 
4351  amdsmi_memory_partition_type_t memory_partition);
4352 
4373  // end of memory_partition
4375 
4376 /*****************************************************************************/
4400 
4431 
4471  uint32_t *num_elem, amdsmi_evt_notification_data_t *data);
4472 
4490 
4507 
4525 amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid);
4526 
4527 /*****************************************************************************/
4551 
4554 /*****************************************************************************/
4578 
4592  amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info);
4593 
4608 
4625 amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind,
4626  amdsmi_power_cap_info_t *info);
4627 
4641  amdsmi_pcie_info_t *info);
4642 
4658 
4661 /*****************************************************************************/
4679 
4695 
4698 /*****************************************************************************/
4718 
4734 
4748 
4768 
4785 
4786 
4789 /*****************************************************************************/
4840  // Note: If the reserved size for processes is smaller than the number of
4841  // actual processes running. The AMDSMI_STATUS_OUT_OF_RESOURCES is
4842  // an indication the caller should handle the situation (resize).
4843  // The max_processes is always changed to reflect the actual size of
4844  // list of processes running, so the caller knows where it is at.
4845  //
4847 amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t *max_processes, amdsmi_proc_info_t *list);
4848 
4851 /*****************************************************************************/
4872 
4876 #ifdef ENABLE_ESMI_LIB
4877 /*****************************************************************************/
4894  uint64_t *penergy);
4895 
4908  uint64_t *penergy);
4909 
4912 /*****************************************************************************/
4928  amdsmi_smu_fw_version_t *amdsmi_smu_fw);
4929 
4941  uint32_t *proto_ver);
4942 
4955  uint32_t *prochot);
4956 
4971  uint32_t *fclk, uint32_t *mclk);
4972 
4985  uint32_t *cclk);
4986 
5001  uint16_t *freq, char **src_type);
5002 
5017  uint16_t *fmax, uint16_t *fmin);
5018 
5031  uint32_t *freq);
5032 
5035 /*****************************************************************************/
5052  uint32_t *ppower);
5053 
5066  uint32_t *pcap);
5067 
5080  uint32_t *pmax);
5081 
5094  uint32_t *power);
5095 
5108  uint32_t pcap);
5109 
5122  uint8_t mode);
5123 
5126 /*****************************************************************************/
5143  uint32_t *pboostlimit);
5144 
5157  uint32_t *pc0_residency);
5158 
5171  uint32_t boostlimit);
5172 
5185  uint32_t boostlimit);
5186 
5189 /*****************************************************************************/
5205  amdsmi_ddr_bw_metrics_t *ddr_bw);
5206 
5209 /*****************************************************************************/
5226  uint32_t *ptmon);
5227 
5230 /*****************************************************************************/
5247  uint8_t dimm_addr,
5249 
5262  uint8_t dimm_addr,
5263  amdsmi_dimm_power_t *dimm_pow);
5264 
5277  uint8_t dimm_addr,
5278  amdsmi_dimm_thermal_t *dimm_temp);
5279 
5282 /*****************************************************************************/
5298  uint8_t min, uint8_t max);
5299 
5302 /*****************************************************************************/
5319  uint8_t min_link_width, uint8_t max_link_width);
5320 
5323 /*****************************************************************************/
5338 
5351  uint8_t pstate);
5352 
5366  uint8_t nbio_id, uint8_t min, uint8_t max);
5367 
5380  uint8_t nbio_id, amdsmi_dpm_level_t *nbio);
5381 
5394  uint8_t rate_ctrl, uint8_t *prev_mode);
5395 
5408  uint8_t max_pstate, uint8_t min_pstate);
5409 
5412 /*****************************************************************************/
5429  amdsmi_link_id_bw_type_t link, uint32_t *io_bw);
5430 
5443  amdsmi_link_id_bw_type_t link, uint32_t *xgmi_bw);
5444 
5447 /*****************************************************************************/
5463  uint32_t *metrics_version);
5464 
5476  amdsmi_hsmp_metrics_table_t *metrics_table);
5477 
5480 /*****************************************************************************/
5497  uint32_t *pcore_ind);
5498 
5507 
5516 
5532 amdsmi_status_t amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string);
5533 #endif
5535 #ifdef __cplusplus
5536 }
5537 #endif // __cplusplus
5538 #endif // INCLUDE_AMDSMI_H_
#define AMDSMI_MAX_DATE_LENGTH
Definition: amdsmi.h:80
amdsmi_evt_notification_type_t
Definition: amdsmi.h:837
@ AMDSMI_EVT_NOTIF_VMFAULT
VM page fault.
Definition: amdsmi.h:838
#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:1028
@ AMDSMI_FREQ_IND_INVALID
An invalid frequency index.
Definition: amdsmi.h:1031
@ AMDSMI_FREQ_IND_MAX
Index used for the maximum frequency value.
Definition: amdsmi.h:1030
@ AMDSMI_FREQ_IND_MIN
Index used for the minimum frequency value.
Definition: amdsmi.h:1029
amdsmi_reg_type_t
This register type for register table.
Definition: amdsmi.h:1448
uintptr_t amdsmi_event_handle_t
Available clock types.
Definition: amdsmi.h:731
amdsmi_memory_type_t
Types of memory.
Definition: amdsmi.h:1015
@ AMDSMI_MEM_TYPE_VRAM
VRAM memory.
Definition: amdsmi.h:1018
@ AMDSMI_MEM_TYPE_VIS_VRAM
VRAM memory that is visible.
Definition: amdsmi.h:1019
@ AMDSMI_MEM_TYPE_GTT
GTT memory.
Definition: amdsmi.h:1020
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:853
amdsmi_io_link_type_t
Types for IO Link.
Definition: amdsmi.h:1063
@ AMDSMI_IOLINK_TYPE_SIZE
Max of IO Link types.
Definition: amdsmi.h:1068
@ AMDSMI_IOLINK_TYPE_UNDEFINED
unknown type.
Definition: amdsmi.h:1064
@ AMDSMI_IOLINK_TYPE_NUMIOLINKTYPES
Number of IO Link types.
Definition: amdsmi.h:1067
@ AMDSMI_IOLINK_TYPE_XGMI
XGMI.
Definition: amdsmi.h:1066
@ AMDSMI_IOLINK_TYPE_PCIEXPRESS
PCI Express.
Definition: amdsmi.h:1065
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:739
@ AMDSMI_EVNT_GRP_XGMI
Data Fabric (XGMI) related events.
Definition: amdsmi.h:740
@ AMDSMI_EVNT_GRP_XGMI_DATA_OUT
XGMI Outbound data.
Definition: amdsmi.h:741
amdsmi_ras_err_state_t
The current ECC state.
Definition: amdsmi.h:998
@ AMDSMI_RAS_ERR_STATE_PARITY
ECC errors present, but type unknown.
Definition: amdsmi.h:1001
@ AMDSMI_RAS_ERR_STATE_SING_C
Single correctable error.
Definition: amdsmi.h:1002
@ AMDSMI_RAS_ERR_STATE_MULT_UC
Multiple uncorrectable errors.
Definition: amdsmi.h:1003
@ AMDSMI_RAS_ERR_STATE_POISON
page. Treat as uncorrectable.
Definition: amdsmi.h:1004
@ AMDSMI_RAS_ERR_STATE_ENABLED
ECC is enabled.
Definition: amdsmi.h:1006
@ AMDSMI_RAS_ERR_STATE_NONE
No current errors.
Definition: amdsmi.h:999
@ AMDSMI_RAS_ERR_STATE_DISABLED
ECC is disabled.
Definition: amdsmi.h:1000
amdsmi_io_bw_encoding_t
xGMI Bandwidth Encoding types
Definition: amdsmi.h:1541
@ AGG_BW0
Aggregate Bandwidth.
Definition: amdsmi.h:1542
@ RD_BW0
Read Bandwidth.
Definition: amdsmi.h:1543
@ WR_BW0
Write Bandwdith.
Definition: amdsmi.h:1544
amdsmi_event_type_t
Event type enum. Events belonging to a particular event group amdsmi_event_group_t should begin enume...
Definition: amdsmi.h:751
@ AMDSMI_EVNT_XGMI_0_BEATS_TX
Data beats sent to neighbor 0; Each beat represents 32 bytes.
Definition: amdsmi.h:774
@ AMDSMI_EVNT_XGMI_DATA_OUT_3
Outbound beats to neighbor 3.
Definition: amdsmi.h:806
@ AMDSMI_EVNT_XGMI_0_NOP_TX
NOPs sent to neighbor 0.
Definition: amdsmi.h:755
@ AMDSMI_EVNT_XGMI_1_NOP_TX
NOPs sent to neighbor 1.
Definition: amdsmi.h:775
@ AMDSMI_EVNT_XGMI_0_RESPONSE_TX
neighbor 0
Definition: amdsmi.h:758
@ AMDSMI_EVNT_XGMI_1_BEATS_TX
Definition: amdsmi.h:780
@ AMDSMI_EVNT_XGMI_DATA_OUT_4
Outbound beats to neighbor 4.
Definition: amdsmi.h:807
@ AMDSMI_EVNT_XGMI_DATA_OUT_1
Outbound beats to neighbor 1.
Definition: amdsmi.h:804
@ AMDSMI_EVNT_XGMI_DATA_OUT_2
Outbound beats to neighbor 2.
Definition: amdsmi.h:805
@ AMDSMI_EVNT_XGMI_1_REQUEST_TX
neighbor 1
Definition: amdsmi.h:776
@ AMDSMI_EVNT_XGMI_DATA_OUT_5
Outbound beats to neighbor 5.
Definition: amdsmi.h:808
@ AMDSMI_EVNT_XGMI_0_REQUEST_TX
neighbor 0
Definition: amdsmi.h:756
@ AMDSMI_EVNT_XGMI_1_RESPONSE_TX
neighbor 1
Definition: amdsmi.h:778
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:1051
@ AMDSMI_MEM_PAGE_STATUS_UNRESERVABLE
Unable to reserve this page.
Definition: amdsmi.h:1057
@ AMDSMI_MEM_PAGE_STATUS_RESERVED
and not available for use
Definition: amdsmi.h:1052
@ AMDSMI_MEM_PAGE_STATUS_PENDING
Definition: amdsmi.h:1054
amdsmi_xgmi_status_t
XGMI Status.
Definition: amdsmi.h:1037
amdsmi_dev_perf_level_t
PowerPlay performance levels.
Definition: amdsmi.h:695
@ AMDSMI_DEV_PERF_LEVEL_STABLE_STD
clocks
Definition: amdsmi.h:705
@ AMDSMI_DEV_PERF_LEVEL_STABLE_PEAK
Stable power state with peak clocks.
Definition: amdsmi.h:707
@ AMDSMI_DEV_PERF_LEVEL_AUTO
Performance level is "auto".
Definition: amdsmi.h:696
@ AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK
system clock
Definition: amdsmi.h:710
@ AMDSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK
memory clock
Definition: amdsmi.h:708
@ AMDSMI_DEV_PERF_LEVEL_DETERMINISM
Performance determinism state.
Definition: amdsmi.h:712
@ AMDSMI_DEV_PERF_LEVEL_LOW
regardless of workload
Definition: amdsmi.h:699
@ AMDSMI_DEV_PERF_LEVEL_HIGH
regardless of workload
Definition: amdsmi.h:701
@ AMDSMI_DEV_PERF_LEVEL_MANUAL
setting the AMDSMI_CLK_TYPE_SYS speed
Definition: amdsmi.h:703
@ AMDSMI_DEV_PERF_LEVEL_UNKNOWN
Unknown performance level.
Definition: amdsmi.h:716
amdsmi_utilization_counter_type_t
The utilization counter type.
Definition: amdsmi.h:1074
@ AMDSMI_COARSE_GRAIN_MEM_ACTIVITY
Memory Activity.
Definition: amdsmi.h:1078
@ AMDSMI_UTILIZATION_COUNTER_FIRST
GFX Activity.
Definition: amdsmi.h:1075
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:912
@ AMDSMI_VOLT_LOWEST
Historical minimum voltage.
Definition: amdsmi.h:921
@ AMDSMI_VOLT_MAX_CRIT
Voltage critical max value.
Definition: amdsmi.h:919
@ AMDSMI_VOLT_HIGHEST
Historical maximum voltage.
Definition: amdsmi.h:922
@ AMDSMI_VOLT_MIN
Voltage min value.
Definition: amdsmi.h:918
@ AMDSMI_VOLT_AVERAGE
Average voltage.
Definition: amdsmi.h:920
@ AMDSMI_VOLT_CURRENT
Voltage current value.
Definition: amdsmi.h:913
@ AMDSMI_VOLT_MAX
Voltage max value.
Definition: amdsmi.h:916
@ AMDSMI_VOLT_MIN_CRIT
Voltage critical min value.
Definition: amdsmi.h:917
uint64_t amdsmi_bit_field_t
Bitfield used in various AMDSMI calls.
Definition: amdsmi.h:1046
amdsmi_voltage_type_t
This ennumeration is used to indicate which type of voltage reading should be obtained.
Definition: amdsmi.h:931
@ AMDSMI_VOLT_TYPE_INVALID
Invalid type.
Definition: amdsmi.h:937
@ AMDSMI_VOLT_TYPE_VDDGFX
voltage
Definition: amdsmi.h:934
void * amdsmi_processor_handle
opaque handler point to underlying implementation
Definition: amdsmi.h:179
amdsmi_cache_property_type_t
cache properties
Definition: amdsmi.h:544
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:869
@ AMDSMI_TEMP_CRITICAL_HYST
Definition: amdsmi.h:883
@ AMDSMI_TEMP_CRITICAL
greater than corresponding temp_max values.
Definition: amdsmi.h:881
@ AMDSMI_TEMP_OFFSET
Definition: amdsmi.h:899
@ AMDSMI_TEMP_EMERGENCY
Definition: amdsmi.h:886
@ AMDSMI_TEMP_LOWEST
temperature reading by the chip.
Definition: amdsmi.h:901
@ AMDSMI_TEMP_CRIT_MIN
Definition: amdsmi.h:893
@ AMDSMI_TEMP_EMERGENCY_HYST
Definition: amdsmi.h:890
@ AMDSMI_TEMP_CURRENT
Temperature current value.
Definition: amdsmi.h:870
@ AMDSMI_TEMP_MIN
Temperature min value.
Definition: amdsmi.h:874
@ AMDSMI_TEMP_HIGHEST
Historical maximum temperature.
Definition: amdsmi.h:902
@ AMDSMI_TEMP_CRIT_MIN_HYST
Definition: amdsmi.h:896
@ AMDSMI_TEMP_MIN_HYST
Definition: amdsmi.h:878
@ AMDSMI_TEMP_MAX_HYST
Definition: amdsmi.h:875
@ AMDSMI_TEMP_MAX
Temperature max value.
Definition: amdsmi.h:873
amdsmi_gpu_block_t
This enum is used to identify different GPU blocks.
Definition: amdsmi.h:965
@ AMDSMI_GPU_BLOCK_XGMI_WAFL
XGMI block.
Definition: amdsmi.h:977
@ AMDSMI_GPU_BLOCK_LAST
Definition: amdsmi.h:990
@ AMDSMI_GPU_BLOCK_GFX
GFX block.
Definition: amdsmi.h:972
@ AMDSMI_GPU_BLOCK_IH
IH block.
Definition: amdsmi.h:987
@ AMDSMI_GPU_BLOCK_VCN
VCN block.
Definition: amdsmi.h:985
@ AMDSMI_GPU_BLOCK_INVALID
Definition: amdsmi.h:966
@ AMDSMI_GPU_BLOCK_MP0
MP0 block.
Definition: amdsmi.h:981
@ AMDSMI_GPU_BLOCK_HDP
HDP block.
Definition: amdsmi.h:976
@ AMDSMI_GPU_BLOCK_MPIO
MPIO block.
Definition: amdsmi.h:988
@ AMDSMI_GPU_BLOCK_ATHUB
ATHUB block.
Definition: amdsmi.h:974
@ AMDSMI_GPU_BLOCK_MP1
MP1 block.
Definition: amdsmi.h:982
@ AMDSMI_GPU_BLOCK_PCIE_BIF
PCIE_BIF block.
Definition: amdsmi.h:975
@ AMDSMI_GPU_BLOCK_SDMA
SDMA block.
Definition: amdsmi.h:971
@ AMDSMI_GPU_BLOCK_JPEG
JPEG block.
Definition: amdsmi.h:986
@ AMDSMI_GPU_BLOCK_UMC
UMC block.
Definition: amdsmi.h:970
@ AMDSMI_GPU_BLOCK_FUSE
Fuse block.
Definition: amdsmi.h:983
@ AMDSMI_GPU_BLOCK_DF
DF block.
Definition: amdsmi.h:978
@ AMDSMI_GPU_BLOCK_MMHUB
MMHUB block.
Definition: amdsmi.h:973
@ AMDSMI_GPU_BLOCK_SMN
SMN block.
Definition: amdsmi.h:979
@ AMDSMI_GPU_BLOCK_SEM
SEM block.
Definition: amdsmi.h:980
@ AMDSMI_GPU_BLOCK_MCA
MCA block.
Definition: amdsmi.h:984
struct __attribute__((__packed__))
HSMP Metrics table (supported only with hsmp proto version 6).
Definition: amdsmi.h:1571
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:1085
@ AMDSMI_INVALID_POWER
Invalid / Undetected Power.
Definition: amdsmi.h:1088
@ AMDSMI_CURRENT_POWER
Current / Instant Power.
Definition: amdsmi.h:1087
@ AMDSMI_AVERAGE_POWER
Average Power.
Definition: amdsmi.h:1086
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:684
amdsmi_counter_command_t
Definition: amdsmi.h:817
@ AMDSMI_CNTR_CMD_STOP
be used before reading.
Definition: amdsmi.h:819
@ AMDSMI_CNTR_CMD_START
Start the counter.
Definition: amdsmi.h:818
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:946
@ AMDSMI_PWR_PROF_PRST_COMPUTE_MASK
Compute Saving Profile.
Definition: amdsmi.h:950
@ AMDSMI_PWR_PROF_PRST_POWER_SAVING_MASK
Power Saving Profile.
Definition: amdsmi.h:949
@ AMDSMI_PWR_PROF_PRST_VIDEO_MASK
Video Power Profile.
Definition: amdsmi.h:948
@ AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT
Default Boot Up Profile.
Definition: amdsmi.h:955
@ AMDSMI_PWR_PROF_PRST_LAST
Invalid power profile.
Definition: amdsmi.h:956
@ AMDSMI_PWR_PROF_PRST_CUSTOM_MASK
Custom Power Profile.
Definition: amdsmi.h:947
@ AMDSMI_PWR_PROF_PRST_VR_MASK
VR Power Profile.
Definition: amdsmi.h:951
#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:691
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_get_xgmi_plpd(amdsmi_processor_handle processor_handle, amdsmi_dpm_policy_t *xgmi_plpd)
Get the xgmi per-link power down policy parameter for the processor.
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_gpu_clear_sram_data(amdsmi_processor_handle processor_handle, uint32_t sclean)
Clear the GPU SRAM data.
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_set_gpu_process_isolation(amdsmi_processor_handle processor_handle, uint32_t pisolate)
Enable/disable the system Process Isolation.
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_get_gpu_process_isolation(amdsmi_processor_handle processor_handle, uint32_t *pisolate)
Get the status of the Process Isolation.
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_set_xgmi_plpd(amdsmi_processor_handle processor_handle, uint32_t plpd_id)
Set the xgmi per-link power down policy parameter for the processor.
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. Power in units of uW....
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_proc_info_t *list)
Returns the list of processes running on a given GPU including itself.
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:1274
Definition: amdsmi.h:575
Definition: amdsmi.h:486
Definition: amdsmi.h:621
Definition: amdsmi.h:640
Definition: amdsmi.h:826
uint64_t time_enabled
Definition: amdsmi.h:828
uint64_t time_running
Definition: amdsmi.h:830
uint64_t value
Counter value.
Definition: amdsmi.h:827
DDR bandwidth metrics.
Definition: amdsmi.h:1505
uint32_t max_bw
DDR Maximum theoritical bandwidth in GB/s.
Definition: amdsmi.h:1506
uint32_t utilized_bw
DDR bandwidth utilization in GB/s.
Definition: amdsmi.h:1507
uint32_t utilized_pct
DDR bandwidth utilization in % of theoritical max.
Definition: amdsmi.h:1508
DIMM Power(mW), power update rate(ms) and dimm address.
Definition: amdsmi.h:1522
uint8_t dimm_addr
Dimm address[7:0](8 bit data)
Definition: amdsmi.h:1525
uint16_t update_rate
Time since last update[16:8](9 bit data)
Definition: amdsmi.h:1524
uint16_t power
Dimm power consumption[31:17](15 bits data)
Definition: amdsmi.h:1523
DIMM temperature(°C) and update rate(ms) and dimm address.
Definition: amdsmi.h:1531
uint16_t sensor
Dimm thermal sensor[31:21](11 bit data)
Definition: amdsmi.h:1532
float temp
temperature in degree celcius
Definition: amdsmi.h:1535
uint16_t update_rate
Time since last update[16:8](9 bit data)
Definition: amdsmi.h:1533
uint8_t dimm_addr
Dimm address[7:0](8 bit data)
Definition: amdsmi.h:1534
max and min LCLK DPM level on a given NBIO ID. Valid max and min DPM level values are 0 - 1.
Definition: amdsmi.h:1563
uint8_t min_dpm_level
Min LCLK DPM level[7:0](8 bit data)
Definition: amdsmi.h:1565
uint8_t max_dpm_level
Max LCLK DPM level[15:8](8 bit data)
Definition: amdsmi.h:1564
The dpm policy.
Definition: amdsmi.h:1164
This structure holds information about dpm policies.
Definition: amdsmi.h:1174
uint32_t num_supported
Definition: amdsmi.h:1178
uint32_t current
Definition: amdsmi.h:1183
Definition: amdsmi.h:615
Definition: amdsmi.h:654
This structure holds error counts.
Definition: amdsmi.h:1469
uint64_t uncorrectable_count
Accumulated uncorrectable errors.
Definition: amdsmi.h:1471
uint64_t correctable_count
Accumulated correctable errors.
Definition: amdsmi.h:1470
uint64_t deferred_count
Accumulated deferred errors.
Definition: amdsmi.h:1472
Definition: amdsmi.h:858
amdsmi_processor_handle processor_handle
Handler of device that corresponds to the event.
Definition: amdsmi.h:859
amdsmi_evt_notification_type_t event
Event type.
Definition: amdsmi.h:860
This structure holds 2 amdsmi_range_t's, one for frequency and one for voltage. These 2 ranges indica...
Definition: amdsmi.h:1234
amdsmi_range_t freq_range
The frequency range for this VDDC Curve point.
Definition: amdsmi.h:1235
amdsmi_range_t volt_range
The voltage range for this VDDC Curve point.
Definition: amdsmi.h:1236
This structure holds information about clock frequencies.
Definition: amdsmi.h:1138
uint32_t current
Definition: amdsmi.h:1152
uint32_t num_supported
Definition: amdsmi.h:1147
bool has_deep_sleep
Definition: amdsmi.h:1142
Definition: amdsmi.h:479
Definition: amdsmi.h:567
Definition: amdsmi.h:565
Definition: amdsmi.h:554
Definition: amdsmi.h:552
Definition: amdsmi.h:1284
This structure holds the name value pairs.
Definition: amdsmi.h:1440
uint64_t value
Use uint64_t to make it universal.
Definition: amdsmi.h:1442
This structure represents a point on the frequency-voltage plane.
Definition: amdsmi.h:1224
uint64_t frequency
Frequency coordinate (in Hz)
Definition: amdsmi.h:1225
uint64_t voltage
Voltage coordinate (in mV)
Definition: amdsmi.h:1226
Definition: amdsmi.h:1242
This structure holds the frequency-voltage values for a device.
Definition: amdsmi.h:1253
amdsmi_range_t curr_mclk_range
(upper bound only)
Definition: amdsmi.h:1255
amdsmi_range_t mclk_freq_limits
The range possible of MCLK values.
Definition: amdsmi.h:1258
uint32_t num_regions
The number of voltage curve regions.
Definition: amdsmi.h:1264
amdsmi_range_t curr_sclk_range
The current SCLK frequency range.
Definition: amdsmi.h:1254
amdsmi_range_t sclk_freq_limits
The range possible of SCLK values.
Definition: amdsmi.h:1257
amdsmi_od_volt_curve_t curve
The current voltage curve.
Definition: amdsmi.h:1263
This structure holds information about the possible PCIe bandwidths. Specifically,...
Definition: amdsmi.h:1197
amdsmi_frequencies_t transfer_rate
Definition: amdsmi.h:1201
Definition: amdsmi.h:510
uint64_t pcie_nak_received_count
total number of NAKs issued on the PCIe link by the receiver
Definition: amdsmi.h:518
uint64_t pcie_replay_count
total number of the replays issued on the PCIe link
Definition: amdsmi.h:514
uint16_t pcie_width
current PCIe width
Definition: amdsmi.h:511
uint32_t pcie_speed
current PCIe speed in MT/s
Definition: amdsmi.h:512
uint32_t pcie_bandwidth
current instantaneous PCIe bandwidth in Mb/s
Definition: amdsmi.h:513
uint64_t pcie_l0_to_recovery_count
total number of times the PCIe link transitioned from L0 to the recovery state
Definition: amdsmi.h:515
uint64_t pcie_nak_sent_count
total number of NAKs issued on the PCIe link by the device
Definition: amdsmi.h:517
uint64_t pcie_replay_roll_over_count
total number of replay rollovers issued on the PCIe link
Definition: amdsmi.h:516
Definition: amdsmi.h:503
uint16_t max_pcie_width
maximum number of PCIe lanes
Definition: amdsmi.h:504
amdsmi_card_form_factor_t slot_type
card form factor
Definition: amdsmi.h:507
uint32_t max_pcie_speed
maximum PCIe speed
Definition: amdsmi.h:505
uint32_t pcie_interface_version
PCIe interface version.
Definition: amdsmi.h:506
Definition: amdsmi.h:502
Definition: amdsmi.h:524
uint64_t power_cap
current power cap (uW)
Definition: amdsmi.h:525
uint64_t dpm_cap
dpm power cap (MHz)
Definition: amdsmi.h:527
uint64_t max_power_cap
maximum power cap (uW)
Definition: amdsmi.h:529
uint64_t default_power_cap
default power cap (uW)
Definition: amdsmi.h:526
uint64_t min_power_cap
minimum power cap (uW)
Definition: amdsmi.h:528
Definition: amdsmi.h:630
This structure contains information about which power profiles are supported by the system for a give...
Definition: amdsmi.h:1118
amdsmi_bit_field_t available_profiles
Definition: amdsmi.h:1122
amdsmi_power_profile_preset_masks_t current
Definition: amdsmi.h:1127
uint32_t num_profiles
Definition: amdsmi.h:1132
Definition: amdsmi.h:667
Definition: amdsmi.h:672
Definition: amdsmi.h:663
This structure contains information specific to a process.
Definition: amdsmi.h:1479
uint64_t sdma_usage
SDMA usage in microseconds.
Definition: amdsmi.h:1483
uint32_t process_id
Process ID.
Definition: amdsmi.h:1480
uint32_t cu_occupancy
Compute Unit usage in percent.
Definition: amdsmi.h:1484
uint32_t pasid
PASID.
Definition: amdsmi.h:1481
uint64_t vram_usage
VRAM usage.
Definition: amdsmi.h:1482
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:1459
uint32_t ecc_correction_schema_flag
ecc_correction_schema mask
Definition: amdsmi.h:1463
Reserved Memory Page Record.
Definition: amdsmi.h:1102
uint64_t page_size
Page size.
Definition: amdsmi.h:1104
amdsmi_memory_page_status_t status
Page "reserved" status.
Definition: amdsmi.h:1105
uint64_t page_address
Start address of page.
Definition: amdsmi.h:1103
This structure holds SMU Firmware version information.
Definition: amdsmi.h:1495
uint8_t debug
SMU fw Debug version number.
Definition: amdsmi.h:1496
uint8_t major
SMU fw Major version number.
Definition: amdsmi.h:1498
uint8_t unused
reserved fields
Definition: amdsmi.h:1499
uint8_t minor
SMU fw Minor version number.
Definition: amdsmi.h:1497
temperature range and refresh rate metrics of a DIMM
Definition: amdsmi.h:1514
uint8_t range
temp range[2:0](3 bit data)
Definition: amdsmi.h:1515
uint8_t ref_rate
DDR refresh rate mode[3](1 bit data)
Definition: amdsmi.h:1516
The utilization counter data.
Definition: amdsmi.h:1094
amdsmi_utilization_counter_type_t type
Utilization counter type.
Definition: amdsmi.h:1095
uint64_t value
Utilization counter value.
Definition: amdsmi.h:1096
Definition: amdsmi.h:533
This structure holds version information.
Definition: amdsmi.h:1213
uint32_t minor
Minor version.
Definition: amdsmi.h:1216
uint32_t major
Major version.
Definition: amdsmi.h:1215
const char * build
Full Build version string.
Definition: amdsmi.h:1218
uint32_t year
Last 2 digits of the Year released.
Definition: amdsmi.h:1214
uint32_t release
Patch, build or stepping version.
Definition: amdsmi.h:1217
Definition: amdsmi.h:608
Definition: amdsmi.h:473
Definition: amdsmi.h:465
Definition: amdsmi.h:485