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  * Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
29 #ifndef __AMDSMI_H__
30 #define __AMDSMI_H__
31 
32 #ifndef __KERNEL__
33 #include <stdint.h>
34 #include <stdbool.h>
35 #include <stddef.h>
36 #endif
37 
43 typedef enum {
45  AMDSMI_INIT_AMD_CPUS = (1 << 0),
46  AMDSMI_INIT_AMD_GPUS = (1 << 1),
47  AMDSMI_INIT_NON_AMD_CPUS = (1 << 2),
48  AMDSMI_INIT_NON_AMD_GPUS = (1 << 3),
49  AMDSMI_INIT_AMD_APUS = (AMDSMI_INIT_AMD_CPUS | AMDSMI_INIT_AMD_GPUS) // Default option
51 
55 #define AMDSMI_MAX_DEVICES 32
56 #define AMDSMI_MAX_VF_COUNT 32
57 #define AMDSMI_PF_INDEX (AMDSMI_MAX_VF_COUNT - 1)
58 #define AMDSMI_MAX_STRING_LENGTH 256
59 #define AMDSMI_MAX_DRIVER_INFO_RSVD 64
60 #define AMDSMI_MAX_MM_IP_COUNT 8
61 #define AMDSMI_MAX_CACHE_TYPES 10
62 #define AMDSMI_MAX_NUM_PM_POLICIES 32
63 #define AMDSMI_MAX_NAME 32
64 
66 #define AMDSMI_MAX_DRIVER_NUM 2
67 
69 #define AMDSMI_MAX_DATE_LENGTH 32
70 
71 #define AMDSMI_GPU_UUID_SIZE 38
72 
73 #define AMDSMI_DFC_FW_NUMBER_OF_ENTRIES 9
74 
75 #define AMDSMI_MAX_WHITE_LIST_ELEMENTS 16
76 #define AMDSMI_MAX_BLACK_LIST_ELEMENTS 64
77 #define AMDSMI_MAX_UUID_ELEMENTS 16
78 #define AMDSMI_MAX_TA_WHITE_LIST_ELEMENTS 8
79 
80 #define AMDSMI_MAX_ERR_RECORDS 10
81 
83 #define AMDSMI_EVENT_MSG_SIZE 256
84 
85 #define AMDSMI_MAX_PROFILE_COUNT 16
86 
90 #define AMDSMI_TIME_FORMAT "%02d:%02d:%02d.%03d"
91 #define AMDSMI_DATE_FORMAT "%04d-%02d-%02d:%02d:%02d:%02d.%03d"
92 
98 #define AMDSMI_MASK_ALL (~0ULL)
99 
101 #define AMDSMI_MASK_DEFAULT ((1ULL << 62) - 1)
102 
104 #define AMDSMI_MASK_INIT (0ULL)
105 
107 #define AMDSMI_MASK_HIGH_AND_MED_SEVERITY (~((1ULL << 61) - 1))
108 
112 #define AMDSMI_MASK_HIGH_ERROR_SEVERITY_ONLY(mask) (mask & ((1ULL << 60) - 1))
113 #define AMDSMI_MASK_INCLUDE_MED_ERROR_SEVERITY(mask) (mask | (1ULL << 60))
114 #define AMDSMI_MASK_INCLUDE_LOW_ERROR_SEVERITY(mask) (mask | (1ULL << 61))
115 #define AMDSMI_MASK_INCLUDE_WARN_SEVERITY(mask) (mask | (1ULL << 62))
116 #define AMDSMI_MASK_INCLUDE_INFO_SEVERITY(mask) (mask | (1ULL << 63))
117 
121 #define AMDSMI_MASK_HIGH_SEVERITY_ONLY(mask) (mask & ((1ULL << 62) - 1))
122 #define AMDSMI_MASK_INCLUDE_MED_SEVERITY(mask) AMDSMI_MASK_INCLUDE_WARN_SEVERITY(mask)
123 #define AMDSMI_MASK_INCLUDE_LOW_SEVERITY(mask) AMDSMI_MASK_INCLUDE_INFO_SEVERITY(mask)
124 
125 #define AMDSMI_MASK_INCLUDE_CATEGORY(mask, cate) (mask | (1ULL << cate))
126 #define AMDSMI_MASK_EXCLUDE_CATEGORY(mask, cate) (mask & (~(1ULL << cate)))
127 
128 #define AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK 64
129 #define AMDSMI_MAX_FB_SHARING_GROUPS 64
130 #define AMDSMI_MAX_NUM_CONNECTED_NODES 64
131 
132 #define AMDSMI_MAX_NUM_METRICS_V1 255
133 #define AMDSMI_MAX_NUM_METRICS AMDSMI_MAX_NUM_METRICS_V1
134 
135 #define AMDSMI_MAX_BAD_PAGE_RECORD_V1 512
136 #define AMDSMI_MAX_BAD_PAGE_RECORD_V2 16384
137 #define AMDSMI_MAX_BAD_PAGE_RECORD AMDSMI_MAX_BAD_PAGE_RECORD_V2
138 
139 #define AMDSMI_MAX_CP_PROFILE_RESOURCES 32
140 #define AMDSMI_MAX_ACCELERATOR_PARTITIONS 8
141 #define AMDSMI_MAX_ACCELERATOR_PROFILE 32
142 #define AMDSMI_MAX_NUM_NUMA_NODES 32
143 
145 typedef void *amdsmi_socket_handle;
146 typedef void *amdsmi_event_set;
147 typedef void *amdsmi_processor_handle;
148 
152 typedef enum {
154  // Library usage errors
174  AMDSMI_STATUS_MORE_DATA = 20,
175  // Processor related errors
181  // Data and size errors
186  //esmi errors
199 
200  // General errors
201  AMDSMI_STATUS_MAP_ERROR = 0xFFFFFFFE,
204 
208 typedef enum {
209  AMDSMI_CACHE_PROPERTY_ENABLED = 0x00000001,
210  AMDSMI_CACHE_PROPERTY_DATA_CACHE = 0x00000002,
211  AMDSMI_CACHE_PROPERTY_INST_CACHE = 0x00000004,
212  AMDSMI_CACHE_PROPERTY_CPU_CACHE = 0x00000008,
213  AMDSMI_CACHE_PROPERTY_SIMD_CACHE = 0x00000010,
215 
216 typedef enum {
217  AMDSMI_FW_ID_SMU = 1,
218  AMDSMI_FW_ID_FIRST = AMDSMI_FW_ID_SMU,
219  AMDSMI_FW_ID_CP_CE,
220  AMDSMI_FW_ID_CP_PFP,
221  AMDSMI_FW_ID_CP_ME,
222  AMDSMI_FW_ID_CP_MEC_JT1,
223  AMDSMI_FW_ID_CP_MEC_JT2,
224  AMDSMI_FW_ID_CP_MEC1,
225  AMDSMI_FW_ID_CP_MEC2,
226  AMDSMI_FW_ID_RLC,
227  AMDSMI_FW_ID_SDMA0,
228  AMDSMI_FW_ID_SDMA1,
229  AMDSMI_FW_ID_SDMA2,
230  AMDSMI_FW_ID_SDMA3,
231  AMDSMI_FW_ID_SDMA4,
232  AMDSMI_FW_ID_SDMA5,
233  AMDSMI_FW_ID_SDMA6,
234  AMDSMI_FW_ID_SDMA7,
235  AMDSMI_FW_ID_VCN,
236  AMDSMI_FW_ID_UVD,
237  AMDSMI_FW_ID_VCE,
238  AMDSMI_FW_ID_ISP,
241  AMDSMI_FW_ID_RLC_RESTORE_LIST_GPM_MEM,
242  AMDSMI_FW_ID_RLC_RESTORE_LIST_SRM_MEM,
243  AMDSMI_FW_ID_RLC_RESTORE_LIST_CNTL,
244  AMDSMI_FW_ID_RLC_V,
245  AMDSMI_FW_ID_MMSCH,
246  AMDSMI_FW_ID_PSP_SYSDRV,
247  AMDSMI_FW_ID_PSP_SOSDRV,
248  AMDSMI_FW_ID_PSP_TOC,
249  AMDSMI_FW_ID_PSP_KEYDB,
250  AMDSMI_FW_ID_DFC,
251  AMDSMI_FW_ID_PSP_SPL,
252  AMDSMI_FW_ID_DRV_CAP,
253  AMDSMI_FW_ID_MC,
254  AMDSMI_FW_ID_PSP_BL,
255  AMDSMI_FW_ID_CP_PM4,
256  AMDSMI_FW_ID_RLC_P,
257  AMDSMI_FW_ID_SEC_POLICY_STAGE2,
258  AMDSMI_FW_ID_REG_ACCESS_WHITELIST,
259  AMDSMI_FW_ID_IMU_DRAM,
260  AMDSMI_FW_ID_IMU_IRAM,
261  AMDSMI_FW_ID_SDMA_TH0,
262  AMDSMI_FW_ID_SDMA_TH1,
263  AMDSMI_FW_ID_CP_MES,
264  AMDSMI_FW_ID_MES_STACK,
266  AMDSMI_FW_ID_MES_THREAD1_STACK,
268  AMDSMI_FW_ID_RLX6_DRAM_BOOT,
269  AMDSMI_FW_ID_RS64_ME,
270  AMDSMI_FW_ID_RS64_ME_P0_DATA,
271  AMDSMI_FW_ID_RS64_ME_P1_DATA,
272  AMDSMI_FW_ID_RS64_PFP,
273  AMDSMI_FW_ID_RS64_PFP_P0_DATA,
274  AMDSMI_FW_ID_RS64_PFP_P1_DATA,
275  AMDSMI_FW_ID_RS64_MEC,
276  AMDSMI_FW_ID_RS64_MEC_P0_DATA,
277  AMDSMI_FW_ID_RS64_MEC_P1_DATA,
278  AMDSMI_FW_ID_RS64_MEC_P2_DATA,
279  AMDSMI_FW_ID_RS64_MEC_P3_DATA,
280  AMDSMI_FW_ID_PPTABLE,
281  AMDSMI_FW_ID_PSP_SOC,
282  AMDSMI_FW_ID_PSP_DBG,
283  AMDSMI_FW_ID_PSP_INTF,
284  AMDSMI_FW_ID_RLX6_CORE1,
285  AMDSMI_FW_ID_RLX6_DRAM_BOOT_CORE1,
286  AMDSMI_FW_ID_RLCV_LX7,
287  AMDSMI_FW_ID_RLC_SAVE_RESTORE_LIST,
288  AMDSMI_FW_ID_ASD,
289  AMDSMI_FW_ID_TA_RAS,
290  AMDSMI_FW_ID_XGMI,
291  AMDSMI_FW_ID_RLC_SRLG,
292  AMDSMI_FW_ID_RLC_SRLS,
293  AMDSMI_FW_ID_SMC,
294  AMDSMI_FW_ID_DMCU,
295  AMDSMI_FW_ID_PSP_RAS,
296  AMDSMI_FW_ID_P2S_TABLE,
297  AMDSMI_FW_ID__MAX
299 
303 typedef enum {
304  AMDSMI_MM_UVD,
305  AMDSMI_MM_VCE,
306  AMDSMI_MM_VCN,
307  AMDSMI_MM__MAX
309 
313 typedef enum {
315  AMDSMI_CLK_TYPE_FIRST = AMDSMI_CLK_TYPE_SYS,
316  AMDSMI_CLK_TYPE_GFX = AMDSMI_CLK_TYPE_SYS,
320  AMDSMI_CLK_TYPE_SOC,
321  AMDSMI_CLK_TYPE_MEM,
322  AMDSMI_CLK_TYPE_PCIE,
323  AMDSMI_CLK_TYPE_VCLK0,
324  AMDSMI_CLK_TYPE_VCLK1,
325  AMDSMI_CLK_TYPE_DCLK0,
326  AMDSMI_CLK_TYPE_DCLK1,
327  AMDSMI_CLK_TYPE__MAX = AMDSMI_CLK_TYPE_DCLK1
333 typedef enum {
334  AMDSMI_TEMPERATURE_TYPE_EDGE,
335  AMDSMI_TEMPERATURE_TYPE_FIRST = AMDSMI_TEMPERATURE_TYPE_EDGE,
336  AMDSMI_TEMPERATURE_TYPE_HOTSPOT,
337  AMDSMI_TEMPERATURE_TYPE_JUNCTION = AMDSMI_TEMPERATURE_TYPE_HOTSPOT,
338  AMDSMI_TEMPERATURE_TYPE_VRAM,
339  AMDSMI_TEMPERATURE_TYPE_HBM_0,
340  AMDSMI_TEMPERATURE_TYPE_HBM_1,
341  AMDSMI_TEMPERATURE_TYPE_HBM_2,
342  AMDSMI_TEMPERATURE_TYPE_HBM_3,
343  AMDSMI_TEMPERATURE_TYPE_PLX,
344  AMDSMI_TEMPERATURE_TYPE__MAX = AMDSMI_TEMPERATURE_TYPE_PLX
350 typedef enum {
352  AMDSMI_TEMP_FIRST = AMDSMI_TEMP_CURRENT,
384  AMDSMI_TEMP_LAST = AMDSMI_TEMP_SHUTDOWN
386 
387 
388 typedef enum {
389  AMDSMI_PROCESSOR_TYPE_UNKNOWN = 0,
390  AMDSMI_PROCESSOR_TYPE_AMD_GPU,
391  AMDSMI_PROCESSOR_TYPE_AMD_CPU,
392  AMDSMI_PROCESSOR_TYPE_NON_AMD_GPU,
393  AMDSMI_PROCESSOR_TYPE_NON_AMD_CPU,
394  AMDSMI_PROCESSOR_TYPE_AMD_CPU_CORE,
395  AMDSMI_PROCESSOR_TYPE_AMD_APU
396 } processor_type_t;
397 
398 typedef enum {
399  AMDSMI_EVENT_CATEGORY_NON_USED = 0,
400  AMDSMI_EVENT_CATEGORY_DRIVER = 1,
401  AMDSMI_EVENT_CATEGORY_RESET = 2,
402  AMDSMI_EVENT_CATEGORY_SCHED = 3,
403  AMDSMI_EVENT_CATEGORY_VBIOS = 4,
404  AMDSMI_EVENT_CATEGORY_ECC = 5,
405  AMDSMI_EVENT_CATEGORY_PP = 6,
406  AMDSMI_EVENT_CATEGORY_IOV = 7,
407  AMDSMI_EVENT_CATEGORY_VF = 8,
408  AMDSMI_EVENT_CATEGORY_FW = 9,
409  AMDSMI_EVENT_CATEGORY_GPU = 10,
410  AMDSMI_EVENT_CATEGORY_GUARD = 11,
411  AMDSMI_EVENT_CATEGORY_GPUMON = 12,
412  AMDSMI_EVENT_CATEGORY_MMSCH = 13,
413  AMDSMI_EVENT_CATEGORY_XGMI = 14,
414  AMDSMI_EVENT_CATEGORY__MAX
415 } amdsmi_event_category_t;
416 
420 typedef enum {
421  AMDSMI_EVENT_GPU_DEVICE_LOST = 0,
422  AMDSMI_EVENT_GPU_NOT_SUPPORTED,
423  AMDSMI_EVENT_GPU_RMA,
424  AMDSMI_EVENT_GPU_NOT_INITIALIZED,
425  AMDSMI_EVENT_GPU_MMSCH_ABNORMAL_STATE,
426  AMDSMI_EVENT_GPU_RLCV_ABNORMAL_STATE,
427  AMDSMI_EVENT_GPU_SDMA_ENGINE_BUSY,
428  AMDSMI_EVENT_GPU_RLC_ENGINE_BUSY,
429  AMDSMI_EVENT_GPU_GC_ENGINE_BUSY,
430  AMDSMI_EVENT_GPU__MAX
432 
433 typedef enum {
434  AMDSMI_EVENT_DRIVER_SPIN_LOCK_BUSY = 0,
435  AMDSMI_EVENT_DRIVER_ALLOC_SYSTEM_MEM_FAIL,
436  AMDSMI_EVENT_DRIVER_CREATE_GFX_WORKQUEUE_FAIL,
437  AMDSMI_EVENT_DRIVER_CREATE_MM_WORKQUEUE_FAIL,
438  AMDSMI_EVENT_DRIVER_BUFFER_OVERFLOW,
439 
440  AMDSMI_EVENT_DRIVER_DEV_INIT_FAIL,
441  AMDSMI_EVENT_DRIVER_CREATE_THREAD_FAIL,
442  AMDSMI_EVENT_DRIVER_NO_ACCESS_PCI_REGION,
443  AMDSMI_EVENT_DRIVER_MMIO_FAIL,
444  AMDSMI_EVENT_DRIVER_INTERRUPT_INIT_FAIL,
445 
446  AMDSMI_EVENT_DRIVER_INVALID_VALUE,
447  AMDSMI_EVENT_DRIVER_CREATE_MUTEX_FAIL,
448  AMDSMI_EVENT_DRIVER_CREATE_TIMER_FAIL,
449  AMDSMI_EVENT_DRIVER_CREATE_EVENT_FAIL,
450  AMDSMI_EVENT_DRIVER_CREATE_SPIN_LOCK_FAIL,
451 
452  AMDSMI_EVENT_DRIVER_ALLOC_FB_MEM_FAIL,
453  AMDSMI_EVENT_DRIVER_ALLOC_DMA_MEM_FAIL,
454  AMDSMI_EVENT_DRIVER_NO_FB_MANAGER,
455  AMDSMI_EVENT_DRIVER_HW_INIT_FAIL,
456  AMDSMI_EVENT_DRIVER_SW_INIT_FAIL,
457 
458  AMDSMI_EVENT_DRIVER_INIT_CONFIG_ERROR,
459  AMDSMI_EVENT_DRIVER_ERROR_LOGGING_FAILED,
460  AMDSMI_EVENT_DRIVER_CREATE_RWLOCK_FAIL,
461  AMDSMI_EVENT_DRIVER_CREATE_RWSEMA_FAIL,
462  AMDSMI_EVENT_DRIVER_GET_READ_LOCK_FAIL,
463 
464  AMDSMI_EVENT_DRIVER_GET_WRITE_LOCK_FAIL,
465  AMDSMI_EVENT_DRIVER_GET_READ_SEMA_FAIL,
466  AMDSMI_EVENT_DRIVER_GET_WRITE_SEMA_FAIL,
467 
468  AMDSMI_EVENT_DRIVER_DIAG_DATA_INIT_FAIL,
469  AMDSMI_EVENT_DRIVER_DIAG_DATA_MEM_REQ_FAIL,
470  AMDSMI_EVENT_DRIVER_DIAG_DATA_VADDR_REQ_FAIL,
471  AMDSMI_EVENT_DRIVER_DIAG_DATA_BUS_ADDR_REQ_FAIL,
472 
473  AMDSMI_EVENT_DRIVER_HRTIMER_START_FAIL,
474  AMDSMI_EVENT_DRIVER_CREATE_DRIVER_FILE_FAIL,
475  AMDSMI_EVENT_DRIVER_CREATE_DEVICE_FILE_FAIL,
476  AMDSMI_EVENT_DRIVER_CREATE_DEBUGFS_FILE_FAIL,
477  AMDSMI_EVENT_DRIVER_CREATE_DEBUGFS_DIR_FAIL,
478 
479  AMDSMI_EVENT_DRIVER_PCI_ENABLE_DEVICE_FAIL,
480  AMDSMI_EVENT_DRIVER_FB_MAP_FAIL,
481  AMDSMI_EVENT_DRIVER_DOORBELL_MAP_FAIL,
482  AMDSMI_EVENT_DRIVER_PCI_REGISTER_DRIVER_FAIL,
483 
484  AMDSMI_EVENT_DRIVER_ALLOC_IOVA_ALIGN_FAIL,
485 
486  AMDSMI_EVENT_DRIVER_ROM_MAP_FAIL,
487  AMDSMI_EVENT_DRIVER_FULL_ACCESS_TIMEOUT,
488 
489  AMDSMI_EVENT_DRIVER__MAX
490 } amdsmi_event_driver_t;
491 
492 typedef enum {
493  AMDSMI_EVENT_FW_CMD_ALLOC_BUF_FAIL = 0,
494  AMDSMI_EVENT_FW_CMD_BUF_PREP_FAIL,
495  AMDSMI_EVENT_FW_RING_INIT_FAIL,
496  AMDSMI_EVENT_FW_FW_APPLY_SECURITY_POLICY_FAIL,
497  AMDSMI_EVENT_FW_START_RING_FAIL,
498 
499  AMDSMI_EVENT_FW_FW_LOAD_FAIL,
500  AMDSMI_EVENT_FW_EXIT_FAIL,
501  AMDSMI_EVENT_FW_INIT_FAIL,
502  AMDSMI_EVENT_FW_CMD_SUBMIT_FAIL,
503  AMDSMI_EVENT_FW_CMD_FENCE_WAIT_FAIL,
504 
505  AMDSMI_EVENT_FW_TMR_LOAD_FAIL,
506  AMDSMI_EVENT_FW_TOC_LOAD_FAIL,
507  AMDSMI_EVENT_FW_RAS_LOAD_FAIL,
508  AMDSMI_EVENT_FW_RAS_UNLOAD_FAIL,
509  AMDSMI_EVENT_FW_RAS_TA_INVOKE_FAIL,
510  AMDSMI_EVENT_FW_RAS_TA_ERR_INJECT_FAIL,
511 
512  AMDSMI_EVENT_FW_ASD_LOAD_FAIL,
513  AMDSMI_EVENT_FW_ASD_UNLOAD_FAIL,
514  AMDSMI_EVENT_FW_AUTOLOAD_FAIL,
515  AMDSMI_EVENT_FW_VFGATE_FAIL,
516 
517  AMDSMI_EVENT_FW_XGMI_LOAD_FAIL,
518  AMDSMI_EVENT_FW_XGMI_UNLOAD_FAIL,
519  AMDSMI_EVENT_FW_XGMI_TA_INVOKE_FAIL,
520 
521  AMDSMI_EVENT_FW_TMR_INIT_FAIL,
522  AMDSMI_EVENT_FW_NOT_SUPPORTED_FEATURE,
523  AMDSMI_EVENT_FW_GET_PSP_TRACELOG_FAIL,
524 
525  AMDSMI_EVENT_FW_SET_SNAPSHOT_ADDR_FAIL,
526  AMDSMI_EVENT_FW_SNAPSHOT_TRIGGER_FAIL,
527 
528  AMDSMI_EVENT_FW_MIGRATION_GET_PSP_INFO_FAIL,
529  AMDSMI_EVENT_FW_MIGRATION_EXPORT_FAIL,
530  AMDSMI_EVENT_FW_MIGRATION_IMPORT_FAIL,
531 
532  AMDSMI_EVENT_FW_BL_FAIL,
533  AMDSMI_EVENT_FW_RAS_BOOT_FAIL,
534  AMDSMI_EVENT_FW_MAILBOX_ERROR,
535 
536  AMDSMI_EVENT_FW__MAX
537 } amdsmi_event_fw_t;
538 
539 #define AMDSMI_EVENT_FW_FW_INIT_FAIL AMDSMI_EVENT_FW_RING_INIT_FAIL
540 
541 typedef enum {
542  AMDSMI_EVENT_RESET_GPU = 0,
543  AMDSMI_EVENT_RESET_GPU_FAILED,
544  AMDSMI_EVENT_RESET_FLR,
545  AMDSMI_EVENT_RESET_FLR_FAILED,
546  AMDSMI_EVENT_RESET__MAX
547 } amdsmi_event_reset_t;
548 
549 typedef enum {
550  AMDSMI_EVENT_IOV_NO_GPU_IOV_CAP = 0,
551  AMDSMI_EVENT_IOV_ASIC_NO_SRIOV_SUPPORT,
552  AMDSMI_EVENT_IOV_ENABLE_SRIOV_FAIL,
553  AMDSMI_EVENT_IOV_CMD_TIMEOUT,
554  AMDSMI_EVENT_IOV_CMD_ERROR,
555 
556  AMDSMI_EVENT_IOV_INIT_IV_RING_FAIL,
557  AMDSMI_EVENT_IOV_SRIOV_STRIDE_ERROR,
558  AMDSMI_EVENT_IOV_WS_SAVE_TIMEOUT,
559  AMDSMI_EVENT_IOV_WS_IDLE_TIMEOUT,
560  AMDSMI_EVENT_IOV_WS_RUN_TIMEOUT,
561  AMDSMI_EVENT_IOV_WS_LOAD_TIMEOUT,
562  AMDSMI_EVENT_IOV_WS_SHUTDOWN_TIMEOUT,
563  AMDSMI_EVENT_IOV_WS_ALREADY_SHUTDOWN,
564  AMDSMI_EVENT_IOV_WS_INFINITE_LOOP,
565  AMDSMI_EVENT_IOV_WS_REENTRANT_ERROR,
566  AMDSMI_EVENT_IOV__MAX
567 } amdsmi_event_iov_t;
568 
569 typedef enum {
570  AMDSMI_EVENT_ECC_UCE = 0,
571  AMDSMI_EVENT_ECC_CE,
572  AMDSMI_EVENT_ECC_IN_PF_FB,
573  AMDSMI_EVENT_ECC_IN_CRI_REG,
574  AMDSMI_EVENT_ECC_IN_VF_CRI,
575  AMDSMI_EVENT_ECC_REACH_THD,
576  AMDSMI_EVENT_ECC_VF_CE,
577  AMDSMI_EVENT_ECC_VF_UE,
578  AMDSMI_EVENT_ECC_IN_SAME_ROW,
579  AMDSMI_EVENT_ECC_UMC_UE,
580  AMDSMI_EVENT_ECC_GFX_CE,
581  AMDSMI_EVENT_ECC_GFX_UE,
582  AMDSMI_EVENT_ECC_SDMA_CE,
583  AMDSMI_EVENT_ECC_SDMA_UE,
584  AMDSMI_EVENT_ECC_GFX_CE_TOTAL,
585  AMDSMI_EVENT_ECC_GFX_UE_TOTAL,
586  AMDSMI_EVENT_ECC_SDMA_CE_TOTAL,
587  AMDSMI_EVENT_ECC_SDMA_UE_TOTAL,
588  AMDSMI_EVENT_ECC_UMC_CE_TOTAL,
589  AMDSMI_EVENT_ECC_UMC_UE_TOTAL,
590  AMDSMI_EVENT_ECC_MMHUB_CE,
591  AMDSMI_EVENT_ECC_MMHUB_UE,
592  AMDSMI_EVENT_ECC_MMHUB_CE_TOTAL,
593  AMDSMI_EVENT_ECC_MMHUB_UE_TOTAL,
594  AMDSMI_EVENT_ECC_XGMI_WAFL_CE,
595  AMDSMI_EVENT_ECC_XGMI_WAFL_UE,
596  AMDSMI_EVENT_ECC_XGMI_WAFL_CE_TOTAL,
597  AMDSMI_EVENT_ECC_XGMI_WAFL_UE_TOTAL,
598  AMDSMI_EVENT_ECC_FATAL_ERROR,
599  AMDSMI_EVENT_ECC_POISON_CONSUMPTION,
600  AMDSMI_EVENT_ECC_ACA_DUMP,
601  AMDSMI_EVENT_ECC_WRONG_SOCKET_ID,
602  AMDSMI_EVENT_ECC_ACA_UNKNOWN_BLOCK_INSTANCE,
603  AMDSMI_EVENT_ECC_UNKNOWN_CHIPLET_CE,
604  AMDSMI_EVENT_ECC_UNKNOWN_CHIPLET_UE,
605  AMDSMI_EVENT_ECC_UMC_CHIPLET_CE,
606  AMDSMI_EVENT_ECC_UMC_CHIPLET_UE,
607  AMDSMI_EVENT_ECC_GFX_CHIPLET_CE,
608  AMDSMI_EVENT_ECC_GFX_CHIPLET_UE,
609  AMDSMI_EVENT_ECC_SDMA_CHIPLET_CE,
610  AMDSMI_EVENT_ECC_SDMA_CHIPLET_UE,
611  AMDSMI_EVENT_ECC_MMHUB_CHIPLET_CE,
612  AMDSMI_EVENT_ECC_MMHUB_CHIPLET_UE,
613  AMDSMI_EVENT_ECC_XGMI_WAFL_CHIPLET_CE,
614  AMDSMI_EVENT_ECC_XGMI_WAFL_CHIPLET_UE,
615  AMDSMI_EVENT_ECC_EEPROM_ENTRIES_FOUND,
616  AMDSMI_EVENT_ECC_UMC_DE,
617  AMDSMI_EVENT_ECC_UMC_DE_TOTAL,
618  AMDSMI_EVENT_ECC_UNKNOWN,
619  AMDSMI_EVENT_ECC_EEPROM_REACH_THD,
620  AMDSMI_EVENT_ECC_UMC_CHIPLET_DE,
621  AMDSMI_EVENT_ECC_UNKNOWN_CHIPLET_DE,
622  AMDSMI_EVENT_ECC_EEPROM_CHK_MISMATCH,
623  AMDSMI_EVENT_ECC_EEPROM_RESET,
624  AMDSMI_EVENT_ECC_EEPROM_RESET_FAILED,
625  AMDSMI_EVENT_ECC_EEPROM_APPEND,
626  AMDSMI_EVENT_ECC_THD_CHANGED,
627  AMDSMI_EVENT_ECC_DUP_ENTRIES,
628  AMDSMI_EVENT_ECC_EEPROM_WRONG_HDR,
629  AMDSMI_EVENT_ECC_EEPROM_WRONG_VER,
630 
631  AMDSMI_EVENT_ECC__MAX
632 } amdsmi_event_ecc_t;
633 
634 typedef enum {
635  AMDSMI_EVENT_PP_SET_DPM_POLICY_FAIL = 0,
636  AMDSMI_EVENT_PP_ACTIVATE_DPM_POLICY_FAIL,
637  AMDSMI_EVENT_PP_I2C_SLAVE_NOT_PRESENT,
638  AMDSMI_EVENT_PP_THROTTLER_EVENT,
639  AMDSMI_EVENT_PP__MAX
640 } amdsmi_event_pp_t;
641 
642 typedef enum {
643  AMDSMI_EVENT_SCHED_WORLD_SWITCH_FAIL = 0,
644  AMDSMI_EVENT_SCHED_DISABLE_AUTO_HW_SWITCH_FAIL,
645  AMDSMI_EVENT_SCHED_ENABLE_AUTO_HW_SWITCH_FAIL,
646  AMDSMI_EVENT_SCHED_GFX_SAVE_REG_FAIL,
647  AMDSMI_EVENT_SCHED_GFX_IDLE_REG_FAIL,
648 
649  AMDSMI_EVENT_SCHED_GFX_RUN_REG_FAIL,
650  AMDSMI_EVENT_SCHED_GFX_LOAD_REG_FAIL,
651  AMDSMI_EVENT_SCHED_GFX_INIT_REG_FAIL,
652  AMDSMI_EVENT_SCHED_MM_SAVE_REG_FAIL,
653  AMDSMI_EVENT_SCHED_MM_IDLE_REG_FAIL,
654 
655  AMDSMI_EVENT_SCHED_MM_RUN_REG_FAIL,
656  AMDSMI_EVENT_SCHED_MM_LOAD_REG_FAIL,
657  AMDSMI_EVENT_SCHED_MM_INIT_REG_FAIL,
658  AMDSMI_EVENT_SCHED_INIT_GPU_FAIL,
659  AMDSMI_EVENT_SCHED_RUN_GPU_FAIL,
660 
661  AMDSMI_EVENT_SCHED_SAVE_GPU_STATE_FAIL,
662  AMDSMI_EVENT_SCHED_LOAD_GPU_STATE_FAIL,
663  AMDSMI_EVENT_SCHED_IDLE_GPU_FAIL,
664  AMDSMI_EVENT_SCHED_FINI_GPU_FAIL,
665  AMDSMI_EVENT_SCHED_DEAD_VF,
666 
667  AMDSMI_EVENT_SCHED_EVENT_QUEUE_FULL,
668  AMDSMI_EVENT_SCHED_SHUTDOWN_VF_FAIL,
669  AMDSMI_EVENT_SCHED_RESET_VF_NUM_FAIL,
670  AMDSMI_EVENT_SCHED_IGNORE_EVENT,
671  AMDSMI_EVENT_SCHED_PF_SWITCH_FAIL,
672  AMDSMI_EVENT_SCHED__MAX
673 } amdsmi_event_sched_t;
674 
675 typedef enum {
676  AMDSMI_EVENT_VF_ATOMBIOS_INIT_FAIL = 0,
677  AMDSMI_EVENT_VF_NO_VBIOS,
678  AMDSMI_EVENT_VF_GPU_POST_ERROR,
679  AMDSMI_EVENT_VF_ATOMBIOS_GET_CLOCK_FAIL,
680  AMDSMI_EVENT_VF_FENCE_INIT_FAIL,
681  AMDSMI_EVENT_VF_AMDGPU_INIT_FAIL,
682  AMDSMI_EVENT_VF_IB_INIT_FAIL,
683  AMDSMI_EVENT_VF_AMDGPU_LATE_INIT_FAIL,
684  AMDSMI_EVENT_VF_ASIC_RESUME_FAIL,
685  AMDSMI_EVENT_VF_GPU_RESET_FAIL,
686  AMDSMI_EVENT_VF__MAX
687 } amdsmi_event_vf_max_t;
688 
689 typedef enum {
690  AMDSMI_EVENT_VBIOS_INVALID = 0,
691  AMDSMI_EVENT_VBIOS_IMAGE_MISSING,
692  AMDSMI_EVENT_VBIOS_CHECKSUM_ERR,
693  AMDSMI_EVENT_VBIOS_POST_FAIL,
694  AMDSMI_EVENT_VBIOS_READ_FAIL,
695 
696  AMDSMI_EVENT_VBIOS_READ_IMG_HEADER_FAIL,
697  AMDSMI_EVENT_VBIOS_READ_IMG_SIZE_FAIL,
698  AMDSMI_EVENT_VBIOS_GET_FW_INFO_FAIL,
699  AMDSMI_EVENT_VBIOS_GET_TBL_REVISION_FAIL,
700  AMDSMI_EVENT_VBIOS_PARSER_TBL_FAIL,
701 
702  AMDSMI_EVENT_VBIOS_IP_DISCOVERY_FAIL,
703  AMDSMI_EVENT_VBIOS_TIMEOUT,
704  AMDSMI_EVENT_VBIOS_HASH_INVALID,
705  AMDSMI_EVENT_VBIOS_HASH_UPDATED,
706  AMDSMI_EVENT_VBIOS_IP_DISCOVERY_BINARY_CHECKSUM_FAIL,
707  AMDSMI_EVENT_VBIOS_IP_DISCOVERY_TABLE_CHECKSUM_FAIL,
708  AMDSMI_EVENT_VBIOS__MAX
709 } amdsmi_event_vbios_t;
710 
711 typedef enum {
712  AMDSMI_EVENT_GUARD_RESET_FAIL = 0,
713  AMDSMI_EVENT_GUARD_EVENT_OVERFLOW,
714  AMDSMI_EVENT_GUARD__MAX
715 } amdsmi_event_guard_t;
716 
717 typedef enum {
718  AMDSMI_EVENT_GPUMON_INVALID_OPTION = 0,
719  AMDSMI_EVENT_GPUMON_INVALID_VF_INDEX,
720  AMDSMI_EVENT_GPUMON_INVALID_FB_SIZE,
721  AMDSMI_EVENT_GPUMON_NO_SUITABLE_SPACE,
722  AMDSMI_EVENT_GPUMON_NO_AVAILABLE_SLOT,
723 
724  AMDSMI_EVENT_GPUMON_OVERSIZE_ALLOCATION,
725  AMDSMI_EVENT_GPUMON_OVERLAPPING_FB,
726  AMDSMI_EVENT_GPUMON_INVALID_GFX_TIMESLICE,
727  AMDSMI_EVENT_GPUMON_INVALID_MM_TIMESLICE,
728  AMDSMI_EVENT_GPUMON_INVALID_GFX_PART,
729 
730  AMDSMI_EVENT_GPUMON_VF_BUSY,
731  AMDSMI_EVENT_GPUMON_INVALID_VF_NUM,
732  AMDSMI_EVENT_GPUMON_NOT_SUPPORTED,
733  AMDSMI_EVENT_GPUMON__MAX
734 } amdsmi_event_gpumon_t;
735 
736 typedef enum {
737  AMDSMI_EVENT_MMSCH_IGNORED_JOB = 0,
738  AMDSMI_EVENT_MMSCH_UNSUPPORTED_VCN_FW,
739  AMDSMI_EVENT_MMSCH__MAX
740 } amdsmi_event_mmsch_t;
741 
742 typedef enum {
743  AMDSMI_EVENT_XGMI_TOPOLOGY_UPDATE_FAILED = 0,
744  AMDSMI_EVENT_XGMI_TOPOLOGY_HW_INIT_UPDATE,
745  AMDSMI_EVENT_XGMI_TOPOLOGY_UPDATE_DONE,
746  AMDSMI_EVENT_XGMI_FB_SHARING_SETTING_ERROR,
747  AMDSMI_EVENT_XGMI_FB_SHARING_SETTING_RESET,
748  AMDSMI_EVENT_XGMI__MAX
749 } amdsmi_event_xgmi_t;
750 
754 typedef enum {
755  AMDSMI_RAS_ECC_SUPPORT_PARITY = (1 << 0),
756  AMDSMI_RAS_ECC_SUPPORT_CORRECTABLE = (1 << 1),
757  AMDSMI_RAS_ECC_SUPPORT_UNCORRECTABLE = (1 << 2),
758  AMDSMI_RAS_ECC_SUPPORT_POISON = (1 << 3)
760 
765 typedef enum {
766  AMDSMI_GUEST_FW_ID_VCE = 0,
767  AMDSMI_GUEST_FW_ID_UVD,
768  AMDSMI_GUEST_FW_ID_MC,
769  AMDSMI_GUEST_FW_ID_ME,
770  AMDSMI_GUEST_FW_ID_PFP,
771  AMDSMI_GUEST_FW_ID_CE,
772  AMDSMI_GUEST_FW_ID_RLC,
773  AMDSMI_GUEST_FW_ID_RLC_SRLC,
774  AMDSMI_GUEST_FW_ID_RLC_SRLG,
775  AMDSMI_GUEST_FW_ID_RLC_SRLS,
776  AMDSMI_GUEST_FW_ID_MEC,
777  AMDSMI_GUEST_FW_ID_MEC2,
778  AMDSMI_GUEST_FW_ID_SOS,
779  AMDSMI_GUEST_FW_ID_ASD,
780  AMDSMI_GUEST_FW_ID_TA_RAS,
781  AMDSMI_GUEST_FW_ID_TA_XGMI,
782  AMDSMI_GUEST_FW_ID_SMC,
783  AMDSMI_GUEST_FW_ID_SDMA,
784  AMDSMI_GUEST_FW_ID_SDMA2,
785  AMDSMI_GUEST_FW_ID_VCN,
786  AMDSMI_GUEST_FW_ID_DMCU,
787  AMDSMI_GUEST_FW_ID__MAX
789 
790 typedef enum {
791  AMDSMI_VF_CONFIG_FB_SIZE_SET = 0,
792  AMDSMI_VF_CONFIG_FB_OFFSET_SET,
793  AMDSMI_VF_CONFIG_GFX_TIMESLICE_US_SET,
794  AMDSMI_VF_CONFIG_ENG_COMPUTE_BW_SET,
795  AMDSMI_VF_CONFIG_GUARD_THRESHOLD_FLR_SET,
796  AMDSMI_VF_CONFIG_GUARD_THRESHOLD_EXCL_MOD_SET,
797  AMDSMI_VF_CONFIG_GUARD_THRESHOLD_EXCL_TIMEOUT_SET,
798  AMDSMI_VF_CONFIG_GUARD_THRESHOLD_ALL_INT_SET,
799  AMDSMI_VF_CONFIG_ENG_ENCODE_BW_UVD_SET,
800  AMDSMI_VF_CONFIG_ENG_ENCODE_BW_VCE_SET,
801  AMDSMI_VF_CONFIG_ENG_ENCODE_BW_UVD1_SET,
802  AMDSMI_VF_CONFIG_ENG_ENCODE_BW_VCN_SET,
803  AMDSMI_VF_CONFIG_ENG_ENCODE_BW_VCN1_SET,
804  AMDSMI_VF_CONFIG__MAX
805 } amdsmi_vf_config_flags_t;
806 
807 typedef enum {
808  AMDSMI_VF_STATE_UNAVAILABLE,
809  AMDSMI_VF_STATE_AVAILABLE,
810  AMDSMI_VF_STATE_ACTIVE,
811  AMDSMI_VF_STATE_SUSPENDED,
812  AMDSMI_VF_STATE_FULLACCESS,
813  AMDSMI_VF_STATE_DEFAULT_AVAILABLE
814 } amdsmi_vf_sched_state_t;
815 
816 typedef enum {
817  AMDSMI_GUARD_EVENT_FLR,
818  AMDSMI_GUARD_EVENT_EXCLUSIVE_MOD,
819  AMDSMI_GUARD_EVENT_EXCLUSIVE_TIMEOUT,
820  AMDSMI_GUARD_EVENT_ALL_INT,
821  AMDSMI_GUARD_EVENT__MAX
822 } amdsmi_guard_type_t;
823 
824 typedef enum {
825  AMDSMI_DRIVER_LIBGV,
826  AMDSMI_DRIVER_KMD,
827  AMDSMI_DRIVER_AMDGPUV,
828  AMDSMI_DRIVER_AMDGPU,
829  AMDSMI_DRIVER_VMWGPUV,
830  AMDSMI_DRIVER__MAX
831 } amdsmi_driver_t;
832 
833 typedef enum {
834  AMDSMI_GUARD_STATE_NORMAL = 0,
835  AMDSMI_GUARD_STATE_FULL = 1,
836  AMDSMI_GUARD_STATE_OVERFLOW = 2,
837 } amdsmi_guard_state_t;
838 
839 typedef enum {
840  AMDSMI_SCHED_BLOCK_GFX = 0x0,
841  AMDSMI_SCHED_BLOCK_UVD = 0x1,
842  AMDSMI_SCHED_BLOCK_VCE = 0x2,
843  AMDSMI_SCHED_BLOCK_UVD1 = 0x3,
844  AMDSMI_SCHED_BLOCK_VCN = 0x4,
845  AMDSMI_SCHED_BLOCK_VCN1 = 0x5,
846 } amdsmi_sched_block_t;
847 
848 typedef enum {
849  GUEST_FW_LOAD_STATUS_OK = 0,
850  GUEST_FW_LOAD_STATUS_OBSOLETE_FW = 1,
851  GUEST_FW_LOAD_STATUS_BAD_SIG = 2,
852  GUEST_FW_LOAD_STATUS_FW_LOAD_FAIL = 3,
853  GUEST_FW_LOAD_STATUS_ERR_GENERIC = 4
854 } amdsmi_guest_fw_load_status_t;
855 
856 
857 typedef enum {
858  AMDSMI_LINK_STATUS_ENABLED = 0,
859  AMDSMI_LINK_STATUS_DISABLED = 1,
860  AMDSMI_LINK_STATUS_ERROR = 2
861 } amdsmi_link_status_t;
862 
863 typedef enum {
864  AMDSMI_LINK_TYPE_INTERNAL,
865  AMDSMI_LINK_TYPE_XGMI,
866  AMDSMI_LINK_TYPE_PCIE,
867  AMDSMI_LINK_TYPE_NOT_APPLICABLE,
868  AMDSMI_LINK_TYPE_UNKNOWN
869 } amdsmi_link_type_t;
870 
871 typedef enum {
872  AMDSMI_XGMI_FB_SHARING_MODE_CUSTOM = 0,
873  AMDSMI_XGMI_FB_SHARING_MODE_1 = 1,
874  AMDSMI_XGMI_FB_SHARING_MODE_2 = 2,
875  AMDSMI_XGMI_FB_SHARING_MODE_4 = 4,
876  AMDSMI_XGMI_FB_SHARING_MODE_8 = 8,
877  AMDSMI_XGMI_FB_SHARING_MODE_UNKNOWN = 0xFFFFFFFF
878 } amdsmi_xgmi_fb_sharing_mode_t;
879 
880 typedef enum {
885  AMDSMI_PROFILE_CAPABILITY__MAX,
887 
888 typedef enum {
889  AMDSMI_VRAM_TYPE_UNKNOWN = 0,
890  // HBM
891  AMDSMI_VRAM_TYPE_HBM = 1,
892  AMDSMI_VRAM_TYPE_HBM2 = 2,
893  AMDSMI_VRAM_TYPE_HBM2E = 3,
894  AMDSMI_VRAM_TYPE_HBM3 = 4,
895  // DDR
896  AMDSMI_VRAM_TYPE_DDR2 = 10,
897  AMDSMI_VRAM_TYPE_DDR3 = 11,
898  AMDSMI_VRAM_TYPE_DDR4 = 12,
899  // GDDR
900  AMDSMI_VRAM_TYPE_GDDR1 = 17,
901  AMDSMI_VRAM_TYPE_GDDR2 = 18,
902  AMDSMI_VRAM_TYPE_GDDR3 = 19,
903  AMDSMI_VRAM_TYPE_GDDR4 = 20,
904  AMDSMI_VRAM_TYPE_GDDR5 = 21,
905  AMDSMI_VRAM_TYPE_GDDR6 = 22,
906  AMDSMI_VRAM_TYPE_GDDR7 = 23,
907 } amdsmi_vram_type_t;
908 
909 typedef enum {
910  AMDSMI_VRAM_VENDOR_SAMSUNG,
911  AMDSMI_VRAM_VENDOR_INFINEON,
912  AMDSMI_VRAM_VENDOR_ELPIDA,
913  AMDSMI_VRAM_VENDOR_ETRON,
914  AMDSMI_VRAM_VENDOR_NANYA,
915  AMDSMI_VRAM_VENDOR_HYNIX,
916  AMDSMI_VRAM_VENDOR_MOSEL,
917  AMDSMI_VRAM_VENDOR_WINBOND,
918  AMDSMI_VRAM_VENDOR_ESMT,
919  AMDSMI_VRAM_VENDOR_MICRON,
920  AMDSMI_VRAM_VENDOR_UNKNOWN
921 } amdsmi_vram_vendor_t;
922 
923 typedef enum {
926  AMDSMI_GPU_BLOCK_FIRST = (1 << 0),
927 
928  AMDSMI_GPU_BLOCK_UMC = AMDSMI_GPU_BLOCK_FIRST,
930  AMDSMI_GPU_BLOCK_GFX = (1 << 2),
934  AMDSMI_GPU_BLOCK_HDP = (1 << 6),
936  AMDSMI_GPU_BLOCK_DF = (1 << 8),
937  AMDSMI_GPU_BLOCK_SMN = (1 << 9),
938  AMDSMI_GPU_BLOCK_SEM = (1 << 10),
939  AMDSMI_GPU_BLOCK_MP0 = (1 << 11),
940  AMDSMI_GPU_BLOCK_MP1 = (1 << 12),
941  AMDSMI_GPU_BLOCK_FUSE = (1 << 13),
942  AMDSMI_GPU_BLOCK_MCA = (1 << 14),
943  AMDSMI_GPU_BLOCK_VCN = (1 << 15),
944  AMDSMI_GPU_BLOCK_JPEG = (1 << 16),
945  AMDSMI_GPU_BLOCK_IH = (1 << 17),
946  AMDSMI_GPU_BLOCK_MPIO = (1 << 18),
947  AMDSMI_GPU_BLOCK_LAST = AMDSMI_GPU_BLOCK_MPIO,
949 
950 typedef enum {
951  AMDSMI_CARD_FORM_FACTOR_PCIE,
952  AMDSMI_CARD_FORM_FACTOR_OAM,
953  AMDSMI_CARD_FORM_FACTOR_CEM,
954  AMDSMI_CARD_FORM_FACTOR_UNKNOWN
955 } amdsmi_card_form_factor_t;
956 
957 
958 typedef enum {
959  AMDSMI_METRIC_CATEGORY_ACC_COUNTER,
960  AMDSMI_METRIC_CATEGORY_FREQUENCY,
961  AMDSMI_METRIC_CATEGORY_ACTIVITY,
962  AMDSMI_METRIC_CATEGORY_TEMPERATURE,
963  AMDSMI_METRIC_CATEGORY_POWER,
964  AMDSMI_METRIC_CATEGORY_ENERGY,
965  AMDSMI_METRIC_CATEGORY_THROTTLE,
966  AMDSMI_METRIC_CATEGORY_PCIE,
967  AMDSMI_METRIC_CATEGORY_UNKNOWN
968 } amdsmi_metric_category_t;
969 
970 typedef enum {
971  AMDSMI_METRIC_NAME_METRIC_ACC_COUNTER,
972  AMDSMI_METRIC_NAME_FW_TIMESTAMP,
973  AMDSMI_METRIC_NAME_CLK_GFX,
974  AMDSMI_METRIC_NAME_CLK_SOC,
975  AMDSMI_METRIC_NAME_CLK_MEM,
976  AMDSMI_METRIC_NAME_CLK_VCLK,
977  AMDSMI_METRIC_NAME_CLK_DCLK,
978 
979  AMDSMI_METRIC_NAME_USAGE_GFX,
980  AMDSMI_METRIC_NAME_USAGE_MEM,
981  AMDSMI_METRIC_NAME_USAGE_MM,
982  AMDSMI_METRIC_NAME_USAGE_VCN,
983  AMDSMI_METRIC_NAME_USAGE_JPEG,
984 
985  AMDSMI_METRIC_NAME_VOLT_GFX,
986  AMDSMI_METRIC_NAME_VOLT_SOC,
987  AMDSMI_METRIC_NAME_VOLT_MEM,
988 
989  AMDSMI_METRIC_NAME_TEMP_HOTSPOT_CURR,
990  AMDSMI_METRIC_NAME_TEMP_HOTSPOT_LIMIT,
991  AMDSMI_METRIC_NAME_TEMP_MEM_CURR,
992  AMDSMI_METRIC_NAME_TEMP_MEM_LIMIT,
993  AMDSMI_METRIC_NAME_TEMP_VR_CURR,
994  AMDSMI_METRIC_NAME_TEMP_SHUTDOWN,
995 
996  AMDSMI_METRIC_NAME_POWER_CURR,
997  AMDSMI_METRIC_NAME_POWER_LIMIT,
998 
999  AMDSMI_METRIC_NAME_ENERGY_SOCKET,
1000  AMDSMI_METRIC_NAME_ENERGY_CCD,
1001  AMDSMI_METRIC_NAME_ENERGY_XCD,
1002  AMDSMI_METRIC_NAME_ENERGY_AID,
1003  AMDSMI_METRIC_NAME_ENERGY_MEM,
1004 
1005  AMDSMI_METRIC_NAME_THROTTLE_SOCKET_ACTIVE,
1006  AMDSMI_METRIC_NAME_THROTTLE_VR_ACTIVE,
1007  AMDSMI_METRIC_NAME_THROTTLE_MEM_ACTIVE,
1008 
1009  AMDSMI_METRIC_NAME_PCIE_BANDWIDTH,
1010  AMDSMI_METRIC_NAME_PCIE_L0_TO_RECOVERY_COUNT,
1011  AMDSMI_METRIC_NAME_PCIE_REPLAY_COUNT,
1012  AMDSMI_METRIC_NAME_PCIE_REPLAY_ROLLOVER_COUNT,
1013  AMDSMI_METRIC_NAME_PCIE_NAK_SENT_COUNT,
1014  AMDSMI_METRIC_NAME_PCIE_NAK_RECEIVED_COUNT,
1015 
1016  AMDSMI_METRIC_NAME_CLK_GFX_MAX_LIMIT,
1017  AMDSMI_METRIC_NAME_CLK_SOC_MAX_LIMIT,
1018  AMDSMI_METRIC_NAME_CLK_MEM_MAX_LIMIT,
1019  AMDSMI_METRIC_NAME_CLK_VCLK_MAX_LIMIT,
1020  AMDSMI_METRIC_NAME_CLK_DCLK_MAX_LIMIT,
1021 
1022  AMDSMI_METRIC_NAME_CLK_GFX_MIN_LIMIT,
1023  AMDSMI_METRIC_NAME_CLK_SOC_MIN_LIMIT,
1024  AMDSMI_METRIC_NAME_CLK_MEM_MIN_LIMIT,
1025  AMDSMI_METRIC_NAME_CLK_VCLK_MIN_LIMIT,
1026  AMDSMI_METRIC_NAME_CLK_DCLK_MIN_LIMIT,
1027 
1028  AMDSMI_METRIC_NAME_CLK_GFX_LOCKED,
1029 
1030  AMDSMI_METRIC_NAME_CLK_GFX_DS_DISABLED,
1031  AMDSMI_METRIC_NAME_CLK_MEM_DS_DISABLED,
1032  AMDSMI_METRIC_NAME_CLK_SOC_DS_DISABLED,
1033  AMDSMI_METRIC_NAME_CLK_VCLK_DS_DISABLED,
1034  AMDSMI_METRIC_NAME_CLK_DCLK_DS_DISABLED,
1035 
1036  AMDSMI_METRIC_NAME_PCIE_LINK_SPEED,
1037  AMDSMI_METRIC_NAME_PCIE_LINK_WIDTH,
1038 
1039  AMDSMI_METRIC_NAME_UNKNOWN
1040 } amdsmi_metric_name_t;
1041 
1042 typedef enum {
1043  AMDSMI_METRIC_UNIT_COUNTER,
1044  AMDSMI_METRIC_UNIT_UINT,
1045  AMDSMI_METRIC_UNIT_BOOL,
1046  AMDSMI_METRIC_UNIT_MHZ,
1047  AMDSMI_METRIC_UNIT_PERCENT,
1048  AMDSMI_METRIC_UNIT_MILLIVOLT,
1049  AMDSMI_METRIC_UNIT_CELSIUS,
1050  AMDSMI_METRIC_UNIT_WATT,
1051  AMDSMI_METRIC_UNIT_JOULE,
1052  AMDSMI_METRIC_UNIT_GBPS,
1053  AMDSMI_METRIC_UNIT_MBITPS,
1054  AMDSMI_METRIC_UNIT_PCIE_GEN,
1055  AMDSMI_METRIC_UNIT_PCIE_LANES,
1056  AMDSMI_METRIC_UNIT_UNKNOWN
1057 } amdsmi_metric_unit_t;
1058 
1059 typedef enum {
1063  AMDSMI_METRIC_TYPE_ACC = (1 << 3)
1065 
1070 typedef enum {
1071  AMDSMI_MEMORY_PARTITION_UNKNOWN = 0,
1086 
1087 typedef enum {
1088  AMDSMI_ACCELERATOR_PARTITION_INVALID = 0,
1099  AMDSMI_ACCELERATOR_PARTITION_MAX
1101 
1102 typedef enum {
1103  AMDSMI_ACCELERATOR_XCC,
1104  AMDSMI_ACCELERATOR_ENCODER,
1105  AMDSMI_ACCELERATOR_DECODER,
1106  AMDSMI_ACCELERATOR_DMA,
1107  AMDSMI_ACCELERATOR_JPEG,
1108  AMDSMI_ACCELERATOR_MAX
1109 } amdsmi_accelerator_partition_resource_type_t;
1110 
1111 typedef enum {
1112  AMDSMI_DRIVER_MODEL_TYPE_WDDM = 0,
1113  AMDSMI_DRIVER_MODEL_TYPE_WDM = 1,
1114  AMDSMI_DRIVER_MODEL_TYPE_MCDM = 2,
1115  AMDSMI_DRIVER_MODEL_TYPE__MAX = 3,
1116 } amdsmi_driver_model_type_t;
1117 
1122 typedef union {
1123  struct bdf_ {
1124  uint64_t function_number : 3;
1125  uint64_t device_number : 5;
1126  uint64_t bus_number : 8;
1127  uint64_t domain_number : 48;
1128  } bdf;
1129  uint64_t as_uint;
1130 } amdsmi_bdf_t;
1131 
1132 typedef struct {
1133  struct pcie_static_ {
1134  uint16_t max_pcie_width;
1135  uint32_t max_pcie_speed;
1137  amdsmi_card_form_factor_t slot_type;
1139  uint64_t reserved[9];
1140  } pcie_static;
1141  struct pcie_metric_ {
1142  uint16_t pcie_width;
1143  uint32_t pcie_speed;
1144  uint32_t pcie_bandwidth;
1151  uint64_t reserved[12];
1152  } pcie_metric;
1153  uint64_t reserved[32];
1155 
1156 
1157 typedef struct {
1158  uint64_t power_cap;
1159  uint64_t default_power_cap;
1160  uint64_t dpm_cap;
1161  uint64_t min_power_cap;
1162  uint64_t max_power_cap;
1163  uint64_t reserved[3];
1165 
1166 typedef struct {
1167  char name[AMDSMI_MAX_STRING_LENGTH];
1168  char build_date[AMDSMI_MAX_DATE_LENGTH];
1169  char part_number[AMDSMI_MAX_STRING_LENGTH];
1170  char version[AMDSMI_MAX_STRING_LENGTH];
1171  uint64_t reserved[68];
1173 
1174 typedef struct {
1175  uint32_t num_cache_types;
1176  struct cache_ {
1177  uint32_t cache_properties;
1178  uint32_t cache_size; /* In KB */
1179  uint32_t cache_level;
1180  uint32_t max_num_cu_shared; /* Indicates how many Compute Units share this cache instance */
1181  uint32_t num_cache_instance; /* total number of instance of this cache type */
1182  uint32_t reserved[3];
1183  } cache[AMDSMI_MAX_CACHE_TYPES];
1184  uint32_t reserved[15];
1186 
1187 typedef struct {
1188  uint8_t num_fw_info;
1189  struct {
1190  amdsmi_fw_block_t fw_id;
1191  uint64_t fw_version;
1192  uint64_t reserved[2];
1193  } fw_info_list[AMDSMI_FW_ID__MAX];
1194  uint64_t reserved[7];
1196 
1197 typedef struct {
1198  char market_name[AMDSMI_MAX_STRING_LENGTH];
1199  char vendor_name[AMDSMI_MAX_STRING_LENGTH];
1200  char asic_serial[AMDSMI_MAX_STRING_LENGTH];
1201  uint64_t reserved[64];
1202  uint32_t vendor_id;
1203  uint32_t subvendor_id;
1204  uint64_t device_id;
1205  uint32_t rev_id;
1206  uint32_t oam_id;
1207  uint32_t num_of_compute_units; //< 0xFFFFFFFF if not supported
1208  uint64_t target_graphics_version; //< 0xFFFFFFFFFFFFFFFF if not supported
1209  uint32_t subsystem_id;
1210  uint64_t reserved_2[10];
1212 
1213 typedef struct {
1214  char driver_version[AMDSMI_MAX_STRING_LENGTH];
1215  char driver_date[AMDSMI_MAX_DATE_LENGTH];
1216  char driver_name[AMDSMI_MAX_STRING_LENGTH];
1217  uint64_t reserved[68];
1219 
1220 typedef struct {
1221  uint64_t socket_power;
1222  uint64_t gfx_voltage;
1223  uint64_t soc_voltage;
1224  uint64_t mem_voltage;
1225  uint64_t reserved[4];
1227 
1228 typedef struct {
1229  uint32_t gfx_activity;
1230  uint32_t umc_activity;
1231  uint32_t mm_activity;
1232  uint64_t reserved[6];
1234 
1235 typedef struct {
1236  uint32_t clk;
1237  uint32_t min_clk;
1238  uint32_t max_clk;
1239  uint8_t clk_locked;
1240  uint8_t clk_deep_sleep;
1241  uint64_t reserved[2];
1243 
1244 typedef struct {
1247  uint64_t deferred_count;
1248  uint64_t reserved[5];
1250 
1251 typedef struct {
1252  uint32_t ras_eeprom_version;
1254  uint64_t reserved[3];
1256 
1257 typedef struct {
1258  uint64_t handle;
1260 
1261 typedef struct {
1262  amdsmi_vf_handle_t fcn_id;
1263  uint64_t dev_id;
1264  uint64_t timestamp;
1265  uint64_t data;
1266  uint32_t category;
1267  uint32_t subcode;
1268  uint32_t level;
1270  char message[AMDSMI_EVENT_MSG_SIZE];
1271  uint64_t reserved[6];
1273 
1274 typedef struct {
1275  char model_number[AMDSMI_MAX_STRING_LENGTH];
1276  char product_serial[AMDSMI_MAX_STRING_LENGTH];
1277  char fru_id[AMDSMI_MAX_STRING_LENGTH];
1278  char product_name[AMDSMI_MAX_STRING_LENGTH];
1279  char manufacturer_name[AMDSMI_MAX_STRING_LENGTH];
1280  uint64_t reserved[64];
1282 
1283 typedef struct {
1284  uint32_t total_fb_size;
1285  uint32_t pf_fb_reserved;
1286  uint32_t pf_fb_offset;
1287  uint32_t fb_alignment;
1288  uint32_t max_vf_fb_usable;
1289  uint32_t min_vf_fb_usable;
1290  uint64_t reserved[5];
1292 
1293 typedef struct {
1294  uint32_t fb_offset;
1295  uint32_t fb_size;
1296  uint64_t reserved[3];
1298 
1299 typedef struct {
1300  amdsmi_vf_handle_t id;
1302  uint64_t reserved[3];
1304 
1305 typedef struct {
1306  uint8_t enabled;
1307  struct {
1308  amdsmi_guard_state_t state;
1309  /* amount of monitor event after enabled */
1310  uint32_t amount;
1311  /* threshold of events in the interval(seconds) */
1312  uint64_t interval;
1313  uint32_t threshold;
1314  /* current number of events in the interval*/
1315  uint32_t active;
1316  uint32_t reserved[4];
1317  } guard[AMDSMI_GUARD_EVENT__MAX];
1318  uint32_t reserved[6];
1320 
1321 typedef struct {
1323  uint32_t gfx_timeslice;
1324  uint64_t reserved[27];
1326 
1327 typedef struct {
1328  uint64_t flr_count;
1329  uint64_t boot_up_time;
1330  uint64_t shutdown_time;
1331  uint64_t reset_time;
1332  amdsmi_vf_sched_state_t state;
1333  char last_boot_start[AMDSMI_MAX_DATE_LENGTH];
1334  char last_boot_end[AMDSMI_MAX_DATE_LENGTH];
1335  char last_shutdown_start[AMDSMI_MAX_DATE_LENGTH];
1336  char last_shutdown_end[AMDSMI_MAX_DATE_LENGTH];
1337  char last_reset_start[AMDSMI_MAX_DATE_LENGTH];
1338  char last_reset_end[AMDSMI_MAX_DATE_LENGTH];
1339  char current_active_time[AMDSMI_MAX_DATE_LENGTH];
1340  char current_running_time[AMDSMI_MAX_DATE_LENGTH];
1341  char total_active_time[AMDSMI_MAX_DATE_LENGTH];
1342  char total_running_time[AMDSMI_MAX_DATE_LENGTH];
1343  uint64_t reserved[11];
1345 
1346 typedef struct {
1347  amdsmi_sched_info_t sched;
1348  amdsmi_guard_info_t guard;
1349  uint64_t reserved[8];
1351 
1352 typedef struct {
1353  uint64_t total;
1354  uint64_t available;
1355  uint64_t optimal;
1356  uint64_t min_value;
1357  uint64_t max_value;
1358  uint64_t reserved[2];
1360 
1361 typedef struct {
1362  uint8_t profile_count;
1363  uint8_t current_profile_index;
1364  struct {
1365  uint32_t vf_count;
1366  amdsmi_profile_caps_info_t profile_caps[AMDSMI_PROFILE_CAPABILITY__MAX];
1367  } profiles[AMDSMI_MAX_PROFILE_COUNT];
1368  uint32_t reserved[6];
1370 
1371 typedef struct {
1372  char driver_version[AMDSMI_MAX_DRIVER_INFO_RSVD];
1373  uint32_t fb_usage;
1374  uint64_t reserved[23];
1376 
1377 typedef struct {
1378  uint32_t dfc_fw_version;
1379  uint32_t dfc_fw_total_entries;
1380  uint32_t dfc_gart_wr_guest_min;
1381  uint32_t dfc_gart_wr_guest_max;
1382  uint32_t reserved[12];
1384 
1385 typedef struct {
1386  uint32_t oldest;
1387  uint32_t latest;
1389 
1390 typedef struct {
1391  uint8_t ta_uuid[AMDSMI_MAX_UUID_ELEMENTS];
1393 
1394 typedef struct {
1395  uint32_t dfc_fw_type;
1396  uint32_t verification_enabled;
1397  uint32_t customer_ordinal;
1398  uint32_t reserved[13];
1399  union {
1400  amdsmi_dfc_fw_white_list_t white_list[AMDSMI_MAX_WHITE_LIST_ELEMENTS];
1401  amdsmi_dfc_fw_ta_uuid_t ta_white_list[AMDSMI_MAX_TA_WHITE_LIST_ELEMENTS];
1402  };
1403  uint32_t black_list[AMDSMI_MAX_BLACK_LIST_ELEMENTS];
1405 
1406 typedef struct {
1407  amdsmi_dfc_fw_header_t header;
1408  amdsmi_dfc_fw_data_t data[AMDSMI_DFC_FW_NUMBER_OF_ENTRIES];
1409 } amdsmi_dfc_fw_t;
1410 
1411 typedef struct {
1412  uint64_t retired_page;
1413  uint64_t ts;
1414  unsigned char err_type;
1415  union {
1416  unsigned char bank;
1417  unsigned char cu;
1418  };
1419  unsigned char mem_channel;
1420  unsigned char mcumc_id;
1421  uint32_t reserved[3];
1423 
1424 typedef struct {
1425  uint64_t timestamp;
1426  uint32_t vf_idx;
1427  uint32_t fw_id;
1428  uint16_t status;
1429  uint32_t reserved[3];
1431 
1432 typedef struct {
1433  uint8_t num_err_records;
1434  amdsmi_fw_load_error_record_t err_records[AMDSMI_MAX_ERR_RECORDS];
1435  uint64_t reserved[7];
1437 
1438 typedef struct {
1439  uint32_t num_links;
1440  struct links_ {
1441  amdsmi_bdf_t bdf;
1442  uint32_t bit_rate;
1443  uint32_t max_bandwidth;
1444  amdsmi_link_type_t link_type;
1445  uint64_t read;
1446  uint64_t write;
1447  uint64_t reserved[2];
1448  } links[AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK];
1449  uint64_t reserved[7];
1451 
1452 typedef struct {
1453  uint64_t weight;
1454  amdsmi_link_status_t link_status;
1455  amdsmi_link_type_t link_type;
1456  uint8_t num_hops;
1457  uint8_t fb_sharing;
1458  uint32_t reserved[10];
1460 
1461 typedef union {
1462  struct cap_ {
1463  uint32_t mode_custom_cap :1;
1464  uint32_t mode_1_cap :1;
1465  uint32_t mode_2_cap :1;
1466  uint32_t mode_4_cap :1;
1467  uint32_t mode_8_cap :1;
1468  uint32_t reserved :27;
1469  } cap;
1470  uint32_t xgmi_fb_sharing_cap_mask;
1472 
1473 typedef struct {
1474  amdsmi_vram_type_t vram_type;
1475  amdsmi_vram_vendor_t vram_vendor;
1476  uint32_t vram_size;
1477  uint32_t vram_bit_width;
1478  uint64_t reserved[6];
1480 
1481 typedef struct {
1482  amdsmi_metric_unit_t unit;
1483  amdsmi_metric_name_t name;
1484  amdsmi_metric_category_t category;
1485  uint32_t flags;
1486  uint32_t vf_mask;
1487  uint64_t val;
1488  uint32_t reserved[8];
1489 } amdsmi_metric_t;
1490 
1494 typedef struct {
1495  uint32_t major;
1496  uint32_t minor;
1497  uint32_t release;
1499 
1503 typedef union {
1504  struct nps_flags_{
1505  uint32_t nps1_cap :1; // bool 1 = true; 0 = false;
1506  uint32_t nps2_cap :1; // bool 1 = true; 0 = false;
1507  uint32_t nps4_cap :1; // bool 1 = true; 0 = false;
1508  uint32_t nps8_cap :1; // bool 1 = true; 0 = false;
1509  uint32_t reserved :28; // bool 1 = true; 0 = false;
1510  } nps_flags;
1511  uint32_t nps_cap_mask;
1513 
1514 typedef struct {
1515  amdsmi_nps_caps_t partition_caps;
1517  uint32_t num_numa_ranges;
1518  struct numa_range_ {
1519  amdsmi_vram_type_t memory_type;
1520  uint64_t start;
1521  uint64_t end;
1522  } numa_range[AMDSMI_MAX_NUM_NUMA_NODES];
1523  uint64_t reserved[11];
1525 
1526 typedef struct {
1528  uint32_t num_partitions;
1530  uint32_t profile_index;
1531  uint32_t num_resources;
1532  uint32_t resources[AMDSMI_MAX_ACCELERATOR_PARTITIONS][AMDSMI_MAX_CP_PROFILE_RESOURCES];
1533  uint64_t reserved[13];
1535 
1536 typedef struct {
1537  uint32_t profile_index;
1538  amdsmi_accelerator_partition_resource_type_t resource_type;
1541  uint64_t reserved[6];
1543 
1544 typedef struct {
1545  uint32_t num_profiles;
1546  uint32_t num_resource_profiles;
1547  amdsmi_accelerator_partition_resource_profile_t resource_profiles[AMDSMI_MAX_CP_PROFILE_RESOURCES];
1549  amdsmi_accelerator_partition_profile_t profiles[AMDSMI_MAX_ACCELERATOR_PROFILE];
1550  uint64_t reserved[30];
1552 
1553 typedef struct {
1554  uint32_t policy_id;
1555  char policy_description[AMDSMI_MAX_NAME];
1556  uint64_t reserved[3];
1558 
1559 typedef struct {
1563  uint32_t num_supported;
1564 
1568  uint32_t cur;
1569 
1574  amdsmi_dpm_policy_entry_t policies[AMDSMI_MAX_NUM_PM_POLICIES];
1575  uint64_t reserved[7];
1577 
1578 #pragma pack(push, 1)
1579 
1580 typedef struct {
1581  unsigned char b[16];
1583 
1584 typedef enum {
1585  AMDSMI_CPER_SEV_NON_FATAL_UNCORRECTED = 0,
1586  AMDSMI_CPER_SEV_FATAL = 1,
1587  AMDSMI_CPER_SEV_NON_FATAL_CORRECTED = 2,
1588  AMDSMI_CPER_SEV_NUM = 3,
1589 
1590  AMDSMI_CPER_SEV_UNUSED = 10,
1591 } amdsmi_cper_sev_t;
1592 
1593 typedef struct {
1594  uint8_t seconds;
1595  uint8_t minutes;
1596  uint8_t hours;
1597  uint8_t flag;
1598  uint8_t day;
1599  uint8_t month;
1600  uint8_t year;
1601  uint8_t century;
1603 
1604 typedef struct {
1605  char signature[4]; /* "CPER" */
1606  uint16_t revision;
1607  uint32_t signature_end; /* 0xFFFFFFFF */
1608  uint16_t sec_cnt;
1609  amdsmi_cper_sev_t error_severity;
1610  union {
1611  struct {
1612  uint32_t platform_id : 1;
1613  uint32_t timestamp : 1;
1614  uint32_t partition_id : 1;
1615  uint32_t reserved : 29;
1616  } valid_bits;
1617  uint32_t valid_mask;
1618  };
1619  uint32_t record_length; /* Total size of CPER Entry */
1620  amdsmi_cper_timestamp_t timestamp;
1621  char platform_id[16];
1622  amdsmi_cper_guid_t partition_id; /* Reserved */
1623  char creator_id[16];
1624  amdsmi_cper_guid_t notify_type; /* CMC, MCE */
1625  char record_id[8]; /* Unique CPER Entry ID */
1626  uint32_t flags; /* Reserved */
1627  uint64_t persistence_info; /* Reserved */
1628  uint8_t reserved[12]; /* Reserved */
1629 } amdsmi_cper_hdr;
1630 
1631 #pragma pack(pop)
1632 
1633 /*****************************************************************************/
1656 amdsmi_status_t amdsmi_init(uint64_t init_flags);
1657 
1665  // end of init
1667 
1668 /*****************************************************************************/
1692 amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t *processor_count, amdsmi_processor_handle *processor_handles);
1693 
1709 amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_handle,
1710  processor_type_t *processor_type);
1711 
1725 amdsmi_status_t amdsmi_get_socket_handles(uint32_t *socket_count, amdsmi_socket_handle *socket_handles);
1726 
1740 amdsmi_status_t amdsmi_get_socket_info(amdsmi_socket_handle socket_handle, size_t len, char *name);
1741 
1752 amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle *processor_handle);
1753 
1764 amdsmi_status_t amdsmi_get_index_from_processor_handle(amdsmi_processor_handle processor_handle, uint32_t *processor_index);
1765 
1777 
1787 amdsmi_status_t amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf);
1788 
1799 amdsmi_status_t amdsmi_get_processor_handle_from_index(uint32_t processor_index, amdsmi_processor_handle *processor_handle);
1800 
1811 
1823 amdsmi_status_t amdsmi_get_vf_handle_from_vf_index(amdsmi_processor_handle processor_handle, uint32_t fcn_idx, amdsmi_vf_handle_t *vf_handle);
1824 
1836 
1847 amdsmi_status_t amdsmi_get_processor_handle_from_uuid(const char *uuid, amdsmi_processor_handle *processor_handle);
1848 
1863 amdsmi_status_t amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid);
1864 
1879 amdsmi_status_t amdsmi_get_vf_uuid(amdsmi_vf_handle_t processor_handle, unsigned int *uuid_length, char *uuid); // end of discovery
1881 
1882 /*****************************************************************************/
1897 amdsmi_status_t amdsmi_get_gpu_driver_info(amdsmi_processor_handle processor_handle, amdsmi_driver_info_t *info);
1898 
1908 amdsmi_status_t amdsmi_get_gpu_driver_model(amdsmi_processor_handle processor_handle, amdsmi_driver_model_type_t *model);
1909 
1925 
1926 /*****************************************************************************/
1941 amdsmi_status_t amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info);
1942 
1953 amdsmi_status_t amdsmi_get_gpu_vram_info(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info);
1954 
1970 amdsmi_status_t amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info);
1971 
1982 amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info);
1983 
1994 amdsmi_status_t amdsmi_get_fb_layout(amdsmi_processor_handle processor_handle, amdsmi_pf_fb_info_t *info);
1995  // end of asicinfo
1997 
1998 /*****************************************************************************/
2013 amdsmi_status_t amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info);
2014 
2025 amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *info);
2026 
2036 amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info);
2037 
2048 amdsmi_status_t amdsmi_get_fw_error_records(amdsmi_processor_handle processor_handle, amdsmi_fw_error_record_t *records);
2049 
2059 amdsmi_status_t amdsmi_get_dfc_fw_table(amdsmi_processor_handle processor_handle, amdsmi_dfc_fw_t *info);
2060  // end of fwinfo
2062 
2063 /*****************************************************************************/
2078 amdsmi_status_t amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_usage_t *info);
2079 
2095 amdsmi_status_t amdsmi_get_power_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_info_t *info);
2096 
2116 amdsmi_status_t amdsmi_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap);
2117 
2127 amdsmi_status_t amdsmi_is_gpu_power_management_enabled(amdsmi_processor_handle processor_handle, bool *enabled);
2128 
2146 amdsmi_status_t amdsmi_get_clock_info(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_info_t *info);
2147 
2165 amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type,
2166  amdsmi_temperature_metric_t metric, int64_t *temperature);
2167 
2178 amdsmi_status_t amdsmi_get_gpu_cache_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_cache_info_t *info);
2179 
2194 amdsmi_status_t amdsmi_get_gpu_metrics(amdsmi_processor_handle processor_handle, uint32_t *metrics_size,
2195  amdsmi_metric_t *metrics);
2196 
2214 amdsmi_status_t amdsmi_get_soc_pstate(amdsmi_processor_handle processor_handle,
2215  amdsmi_dpm_policy_t *policy);
2216 
2234 amdsmi_status_t amdsmi_set_soc_pstate(amdsmi_processor_handle processor_handle,
2235  uint32_t policy_id);
2236  // end of gpumon
2238 
2239 /*****************************************************************************/
2255 amdsmi_status_t amdsmi_get_gpu_total_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec);
2256 
2270 amdsmi_status_t amdsmi_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec);
2271 
2281 amdsmi_status_t amdsmi_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks);
2282 
2297 amdsmi_status_t amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *bad_page_size,
2298  amdsmi_eeprom_table_record_t *bad_pages);
2299 
2310 amdsmi_status_t amdsmi_get_gpu_ras_feature_info(amdsmi_processor_handle processor_handle, amdsmi_ras_feature_t *ras_feature);
2311 
2312  // end of eccinfo
2314 
2315 /*****************************************************************************/
2334 amdsmi_get_num_vf(amdsmi_processor_handle processor_handle, uint32_t *num_vf_enabled, uint32_t *num_vf_supported);
2335 
2336 
2346 amdsmi_status_t amdsmi_set_num_vf(amdsmi_processor_handle processor_handle, uint32_t num_vf);
2347 
2363 amdsmi_get_vf_partition_info(amdsmi_processor_handle processor_handle, unsigned int vf_buffer_num,
2364  amdsmi_partition_info_t *info);
2365  // end of fbpart
2367 
2368 /*****************************************************************************/
2385 
2398  // end of vfconf
2400 
2401 /*****************************************************************************/
2438 amdsmi_event_create(amdsmi_processor_handle *processor_list, uint32_t num_devices,
2439  uint64_t event_types, amdsmi_event_set *set);
2440 
2469 amdsmi_event_read(amdsmi_event_set set, int64_t timeout_usec, amdsmi_event_entry_t *event);
2470 
2479 amdsmi_event_destroy(amdsmi_event_set set);
2480  // end of eventmon
2482 
2483 /*****************************************************************************/
2503 
2517 
2529 amdsmi_get_partition_profile_info(amdsmi_processor_handle processor_handle,
2530  amdsmi_profile_info_t *profile_info);
2531  // end of hostguest
2533 
2534 /*****************************************************************************/
2549 amdsmi_status_t amdsmi_get_link_metrics(amdsmi_processor_handle processor_handle,
2550  amdsmi_link_metrics_t *link_metrics);
2551 
2564 amdsmi_status_t amdsmi_get_link_topology(amdsmi_processor_handle processor_handle_src,
2565  amdsmi_processor_handle processor_handle_dst,
2566  amdsmi_link_topology_t *topology_info);
2567 
2578 amdsmi_status_t amdsmi_get_xgmi_fb_sharing_caps(amdsmi_processor_handle processor_handle,
2580 
2595 amdsmi_status_t amdsmi_get_xgmi_fb_sharing_mode_info(amdsmi_processor_handle processor_handle_src,
2596  amdsmi_processor_handle processor_handle_dst,
2597  amdsmi_xgmi_fb_sharing_mode_t mode,
2598  uint8_t *fb_sharing);
2599 
2611 amdsmi_status_t amdsmi_set_xgmi_fb_sharing_mode(amdsmi_processor_handle processor_handle,
2612  amdsmi_xgmi_fb_sharing_mode_t mode);
2613 
2636 amdsmi_status_t amdsmi_set_xgmi_fb_sharing_mode_v2(amdsmi_processor_handle *processor_list, uint32_t num_processors,
2637  amdsmi_xgmi_fb_sharing_mode_t mode);
2638  // end of xgmi
2640 
2641 /*****************************************************************************/
2654 amdsmi_status_t amdsmi_clear_vf_fb(amdsmi_vf_handle_t vf_handle); // end of vfmanagement
2656 
2673 
2674 /*****************************************************************************/
2690  amdsmi_get_gpu_memory_partition_config(amdsmi_processor_handle processor_handle,
2692 
2703 amdsmi_set_gpu_memory_partition_mode(amdsmi_processor_handle processor_handle, amdsmi_memory_partition_type_t mode);
2704 
2716 amdsmi_get_gpu_accelerator_partition_profile_config(amdsmi_processor_handle processor_handle,
2718 
2733 amdsmi_get_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_handle,
2734  amdsmi_accelerator_partition_profile_t *profile, uint32_t *partition_id);
2735 
2746 amdsmi_set_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_handle, uint32_t profile_index);
2747  // end of partitioning
2749 
2750 
2784 amdsmi_gpu_get_cper_entries(amdsmi_processor_handle processor_handle, uint32_t severity_mask, char *cper_data,
2785  uint64_t *buf_size, amdsmi_cper_hdr** cper_hdrs, uint64_t *entry_count, uint64_t *cursor);
2786 
2787 #endif // __AMDSMI_H__
#define AMDSMI_MAX_DATE_LENGTH
YYYY-MM-DD:HH:MM:SS.MSC.
Definition: amdsmi.h:69
amdsmi_accelerator_partition_type_t
Definition: amdsmi.h:1087
@ AMDSMI_ACCELERATOR_PARTITION_DPX
together with shared memory
Definition: amdsmi.h:1091
@ AMDSMI_ACCELERATOR_PARTITION_QPX
work together with shared memory
Definition: amdsmi.h:1095
@ AMDSMI_ACCELERATOR_PARTITION_SPX
together with shared memory
Definition: amdsmi.h:1089
@ AMDSMI_ACCELERATOR_PARTITION_TPX
work together with shared memory
Definition: amdsmi.h:1093
@ AMDSMI_ACCELERATOR_PARTITION_CPX
shared memory
Definition: amdsmi.h:1097
amdsmi_clk_type_t
Clock types.
Definition: amdsmi.h:313
@ AMDSMI_CLK_TYPE_SYS
System clock.
Definition: amdsmi.h:314
@ AMDSMI_CLK_TYPE_DCEF
Display Controller Engine clock.
Definition: amdsmi.h:319
@ AMDSMI_CLK_TYPE_DF
running on a separate clock)
Definition: amdsmi.h:317
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_profile_capability_type_t
Definition: amdsmi.h:880
@ AMDSMI_PROFILE_CAPABILITY_DECODE
decode engine
Definition: amdsmi.h:883
@ AMDSMI_PROFILE_CAPABILITY_MEMORY
memory
Definition: amdsmi.h:881
@ AMDSMI_PROFILE_CAPABILITY_ENCODE
encode engine
Definition: amdsmi.h:882
@ AMDSMI_PROFILE_CAPABILITY_COMPUTE
compute engine
Definition: amdsmi.h:884
amdsmi_init_flags_t
Initialization flags.
Definition: amdsmi.h:43
@ AMDSMI_INIT_ALL_PROCESSORS
Initialize all processors.
Definition: amdsmi.h:44
amdsmi_metric_type_t
Definition: amdsmi.h:1059
@ AMDSMI_METRIC_TYPE_COUNTER
counter metric
Definition: amdsmi.h:1060
@ AMDSMI_METRIC_TYPE_CHIPLET
chiplet metric
Definition: amdsmi.h:1061
@ AMDSMI_METRIC_TYPE_ACC
accumulated metric
Definition: amdsmi.h:1063
@ AMDSMI_METRIC_TYPE_INST
instantaneous metric
Definition: amdsmi.h:1062
amdsmi_fw_block_t
Definition: amdsmi.h:216
@ AMDSMI_FW_ID_RLX6
FW_ID_MES_THREAD1_STACK = MES_KIQ_STACK.
Definition: amdsmi.h:267
@ AMDSMI_FW_ID_DMCU_ISR
ISR.
Definition: amdsmi.h:240
@ AMDSMI_FW_ID_MES_THREAD1
FW_ID_MES_THREAD1 = CP_MES_KIQ.
Definition: amdsmi.h:265
@ AMDSMI_FW_ID_DMCU_ERAM
eRAM
Definition: amdsmi.h:239
amdsmi_mm_ip_t
GPU Capability info.
Definition: amdsmi.h:303
amdsmi_guest_fw_engine_id_t
The values of this enum are used to identify the various firmware blocks.
Definition: amdsmi.h:765
amdsmi_ecc_correction_schema_support_t
The values of this enum are used to identify supported ecc correction schema.
Definition: amdsmi.h:754
amdsmi_memory_partition_type_t
Memory Partitions. This enum is used to identify various memory partition types.
Definition: amdsmi.h:1070
@ AMDSMI_MEMORY_PARTITION_NPS8
Definition: amdsmi.h:1080
@ AMDSMI_MEMORY_PARTITION_NPS1
across all 8 HBM stacks (all stacks/1).
Definition: amdsmi.h:1072
@ AMDSMI_MEMORY_PARTITION_NPS2
Definition: amdsmi.h:1074
@ AMDSMI_MEMORY_PARTITION_NPS4
Definition: amdsmi.h:1077
amdsmi_event_gpu_t
Below are the error subcodes of each category.
Definition: amdsmi.h:420
amdsmi_cache_property_type_t
cache properties
Definition: amdsmi.h:208
#define AMDSMI_EVENT_MSG_SIZE
256 BYTES
Definition: amdsmi.h:83
amdsmi_status_t
ENUMERATORS.
Definition: amdsmi.h:152
@ AMDSMI_STATUS_NOT_INIT
Processor not initialized.
Definition: amdsmi.h:178
@ AMDSMI_STATUS_NON_AMD_CPU
System has different cpu than AMD.
Definition: amdsmi.h:187
@ AMDSMI_STATUS_INVAL
Invalid parameters.
Definition: amdsmi.h:155
@ AMDSMI_STATUS_BUSY
Processor busy.
Definition: amdsmi.h:176
@ AMDSMI_STATUS_UNKNOWN_ERROR
An unknown error occurred.
Definition: amdsmi.h:202
@ AMDSMI_STATUS_DRIVER_NOT_LOADED
Processor driver not loaded.
Definition: amdsmi.h:180
@ AMDSMI_STATUS_FILE_ERROR
Problem accessing a file.
Definition: amdsmi.h:168
@ AMDSMI_STATUS_DRM_ERROR
Error when call libdrm.
Definition: amdsmi.h:160
@ AMDSMI_STATUS_ARG_PTR_NULL
Parsed argument is invalid.
Definition: amdsmi.h:196
@ AMDSMI_STATUS_IO
I/O Error.
Definition: amdsmi.h:166
@ AMDSMI_STATUS_NO_HSMP_DRV
HSMP driver not found.
Definition: amdsmi.h:190
@ AMDSMI_STATUS_HSMP_TIMEOUT
HSMP message is timedout.
Definition: amdsmi.h:193
@ AMDSMI_STATUS_NO_DATA
No data was found for a given input.
Definition: amdsmi.h:182
@ AMDSMI_STATUS_RETRY
Retry operation.
Definition: amdsmi.h:163
@ AMDSMI_STATUS_UNEXPECTED_SIZE
An unexpected amount of data was read.
Definition: amdsmi.h:184
@ AMDSMI_STATUS_SETTING_UNAVAILABLE
Setting is not available.
Definition: amdsmi.h:198
@ AMDSMI_STATUS_FILE_NOT_FOUND
file or directory not found
Definition: amdsmi.h:195
@ AMDSMI_STATUS_INTERNAL_EXCEPTION
An internal exception was caught.
Definition: amdsmi.h:170
@ AMDSMI_STATUS_NO_HSMP_SUP
HSMP not supported.
Definition: amdsmi.h:191
@ AMDSMI_STATUS_MAP_ERROR
The internal library error did not map to a status code.
Definition: amdsmi.h:201
@ AMDSMI_STATUS_FAIL_LOAD_SYMBOL
Fail to load symbol.
Definition: amdsmi.h:159
@ AMDSMI_STATUS_INSUFFICIENT_SIZE
Not enough resources were available for the operation.
Definition: amdsmi.h:183
@ AMDSMI_STATUS_INIT_ERROR
An error occurred when initializing internal data structures.
Definition: amdsmi.h:172
@ AMDSMI_STATUS_OUT_OF_RESOURCES
Not enough memory.
Definition: amdsmi.h:169
@ AMDSMI_STATUS_NO_SLOT
No more free slot.
Definition: amdsmi.h:179
@ AMDSMI_STATUS_NO_MSR_DRV
MSR driver not found.
Definition: amdsmi.h:189
@ AMDSMI_STATUS_INTERRUPT
An interrupt occurred during execution of function.
Definition: amdsmi.h:165
@ AMDSMI_STATUS_SUCCESS
Call succeeded.
Definition: amdsmi.h:153
@ AMDSMI_STATUS_NO_ENERGY_DRV
Energy driver not found.
Definition: amdsmi.h:188
@ AMDSMI_STATUS_ADDRESS_FAULT
Bad address.
Definition: amdsmi.h:167
@ AMDSMI_STATUS_NOT_YET_IMPLEMENTED
Not implemented yet.
Definition: amdsmi.h:157
@ AMDSMI_STATUS_NO_DRV
No Energy and HSMP driver present.
Definition: amdsmi.h:194
@ AMDSMI_STATUS_NO_PERM
Permission Denied.
Definition: amdsmi.h:164
@ AMDSMI_STATUS_NOT_FOUND
Processor not found.
Definition: amdsmi.h:177
@ AMDSMI_STATUS_FAIL_LOAD_MODULE
Fail to load lib.
Definition: amdsmi.h:158
@ AMDSMI_STATUS_AMDGPU_RESTART_ERR
AMDGPU restart failed.
Definition: amdsmi.h:197
@ AMDSMI_STATUS_NOT_SUPPORTED
Command not supported.
Definition: amdsmi.h:156
@ AMDSMI_STATUS_UNEXPECTED_DATA
The data read or provided to function is not what was expected.
Definition: amdsmi.h:185
@ AMDSMI_STATUS_API_FAILED
API call failed.
Definition: amdsmi.h:161
@ AMDSMI_STATUS_TIMEOUT
Timeout in API call.
Definition: amdsmi.h:162
@ AMDSMI_STATUS_NO_HSMP_MSG_SUP
HSMP message/feature not supported.
Definition: amdsmi.h:192
@ AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS
The provided input is out of allowable or safe range.
Definition: amdsmi.h:171
@ AMDSMI_STATUS_REFCOUNT_OVERFLOW
An internal reference counter exceeded INT32_MAX.
Definition: amdsmi.h:173
amdsmi_temperature_metric_t
Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values ...
Definition: amdsmi.h:350
@ AMDSMI_TEMP_CRITICAL_HYST
Definition: amdsmi.h:363
@ AMDSMI_TEMP_CRITICAL
greater than corresponding temp_max values.
Definition: amdsmi.h:361
@ AMDSMI_TEMP_OFFSET
Definition: amdsmi.h:379
@ AMDSMI_TEMP_EMERGENCY
Definition: amdsmi.h:366
@ AMDSMI_TEMP_LOWEST
temperature reading by the chip.
Definition: amdsmi.h:381
@ AMDSMI_TEMP_CRIT_MIN
Definition: amdsmi.h:373
@ AMDSMI_TEMP_SHUTDOWN
Shutdown temperature.
Definition: amdsmi.h:383
@ AMDSMI_TEMP_EMERGENCY_HYST
Definition: amdsmi.h:370
@ AMDSMI_TEMP_CURRENT
Temperature current value.
Definition: amdsmi.h:351
@ AMDSMI_TEMP_MIN
Temperature min value.
Definition: amdsmi.h:354
@ AMDSMI_TEMP_HIGHEST
Historical maximum temperature.
Definition: amdsmi.h:382
@ AMDSMI_TEMP_CRIT_MIN_HYST
Definition: amdsmi.h:376
@ AMDSMI_TEMP_MIN_HYST
Definition: amdsmi.h:358
@ AMDSMI_TEMP_MAX_HYST
Definition: amdsmi.h:355
@ AMDSMI_TEMP_MAX
Temperature max value.
Definition: amdsmi.h:353
amdsmi_gpu_block_t
Definition: amdsmi.h:923
@ AMDSMI_GPU_BLOCK_XGMI_WAFL
XGMI block.
Definition: amdsmi.h:935
@ AMDSMI_GPU_BLOCK_GFX
GFX block.
Definition: amdsmi.h:930
@ AMDSMI_GPU_BLOCK_IH
IH block.
Definition: amdsmi.h:945
@ AMDSMI_GPU_BLOCK_VCN
VCN block.
Definition: amdsmi.h:943
@ AMDSMI_GPU_BLOCK_INVALID
invalid block
Definition: amdsmi.h:924
@ AMDSMI_GPU_BLOCK_MP0
MP0 block.
Definition: amdsmi.h:939
@ AMDSMI_GPU_BLOCK_HDP
HDP block.
Definition: amdsmi.h:934
@ AMDSMI_GPU_BLOCK_MPIO
MPIO block.
Definition: amdsmi.h:946
@ AMDSMI_GPU_BLOCK_ATHUB
ATHUB block.
Definition: amdsmi.h:932
@ AMDSMI_GPU_BLOCK_MP1
MP1 block.
Definition: amdsmi.h:940
@ AMDSMI_GPU_BLOCK_PCIE_BIF
PCIE_BIF block.
Definition: amdsmi.h:933
@ AMDSMI_GPU_BLOCK_SDMA
SDMA block.
Definition: amdsmi.h:929
@ AMDSMI_GPU_BLOCK_JPEG
JPEG block.
Definition: amdsmi.h:944
@ AMDSMI_GPU_BLOCK_UMC
UMC block.
Definition: amdsmi.h:928
@ AMDSMI_GPU_BLOCK_FUSE
Fuse block.
Definition: amdsmi.h:941
@ AMDSMI_GPU_BLOCK_DF
DF block.
Definition: amdsmi.h:936
@ AMDSMI_GPU_BLOCK_MMHUB
MMHUB block.
Definition: amdsmi.h:931
@ AMDSMI_GPU_BLOCK_SMN
SMN block.
Definition: amdsmi.h:937
@ AMDSMI_GPU_BLOCK_SEM
SEM block.
Definition: amdsmi.h:938
@ AMDSMI_GPU_BLOCK_MCA
MCA block.
Definition: amdsmi.h:942
amdsmi_temperature_type_t
This enumeration is used to indicate from which part of the processor a temperature reading should be...
Definition: amdsmi.h:333
void * amdsmi_socket_handle
opaque handler point to underlying implementation
Definition: amdsmi.h:145
amdsmi_status_t amdsmi_gpu_get_cper_entries(amdsmi_processor_handle processor_handle, uint32_t severity_mask, char *cper_data, uint64_t *buf_size, amdsmi_cper_hdr **cper_hdrs, uint64_t *entry_count, uint64_t *cursor)
Retrieve CPER entries cached in the driver.
amdsmi_status_t amdsmi_set_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_handle, uint32_t profile_index)
Sets accelerator partition setting based on profile_index from amdsmi_get_gpu_accelerator_partition_p...
amdsmi_status_t amdsmi_get_gpu_memory_partition_config(amdsmi_processor_handle processor_handle, amdsmi_memory_partition_config_t *config)
Returns current gpu memory partition config and mode capabilities.
amdsmi_status_t amdsmi_get_gpu_accelerator_partition_profile_config(amdsmi_processor_handle processor_handle, amdsmi_accelerator_partition_profile_config_t *profile_config)
Returns gpu accelerator partition caps as currently configured in the system.
amdsmi_status_t amdsmi_set_gpu_memory_partition_mode(amdsmi_processor_handle processor_handle, amdsmi_memory_partition_type_t mode)
Sets memory partition mode.
amdsmi_status_t amdsmi_get_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_handle, amdsmi_accelerator_partition_profile_t *profile, uint32_t *partition_id)
Returns current gpu accelerator partition cap.
amdsmi_status_t amdsmi_get_fb_layout(amdsmi_processor_handle processor_handle, amdsmi_pf_fb_info_t *info)
Returns the framebuffer info for the ASIC.
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.
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_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info)
Returns the ASIC information for the processor.
amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t *processor_count, amdsmi_processor_handle *processor_handles)
Returns a list of AMD GPU devices in the system.
amdsmi_status_t amdsmi_get_index_from_processor_handle(amdsmi_processor_handle processor_handle, uint32_t *processor_index)
Returns the index of the given processor handle.
amdsmi_status_t amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid)
Returns the UUID of the processor.
amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_handle, processor_type_t *processor_type)
Get the processor type.
amdsmi_status_t amdsmi_get_socket_info(amdsmi_socket_handle socket_handle, size_t len, char *name)
Returns socket information about given socket handle NOT SUPPORTED YET, CURRENTLY HARDCODED TO RETURN...
amdsmi_status_t amdsmi_get_processor_handle_from_uuid(const char *uuid, amdsmi_processor_handle *processor_handle)
Returns the processor handle from the given UUID.
amdsmi_status_t amdsmi_get_socket_handles(uint32_t *socket_count, amdsmi_socket_handle *socket_handles)
Returns a list of socket handles in the system. NOT SUPPORTED YET, CURRENTLY HARDCODED TO RETURN EMPT...
amdsmi_status_t amdsmi_get_vf_bdf(amdsmi_vf_handle_t vf_handle, amdsmi_bdf_t *bdf)
Returns BDF of the given device (VF).
amdsmi_status_t amdsmi_get_vf_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_vf_handle_t *vf_handle)
Returns VF handle from the given BDF.
amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle *processor_handle)
Returns processor handle (PF) from the given BDF.
amdsmi_status_t amdsmi_get_vf_handle_from_vf_index(amdsmi_processor_handle processor_handle, uint32_t fcn_idx, amdsmi_vf_handle_t *vf_handle)
Returns the handle of a virtual function given its index.
amdsmi_status_t amdsmi_get_vf_uuid(amdsmi_vf_handle_t processor_handle, unsigned int *uuid_length, char *uuid)
Returns the UUID of the VF.
amdsmi_status_t amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf)
Returns BDF of the given processor (PF or VF).
amdsmi_status_t amdsmi_get_vf_handle_from_uuid(const char *uuid, amdsmi_vf_handle_t *vf_handle)
Returns the handle of a virtual function from the given UUID.
amdsmi_status_t amdsmi_get_processor_handle_from_index(uint32_t processor_index, amdsmi_processor_handle *processor_handle)
Returns the processor handle from the given processor index.
amdsmi_status_t amdsmi_get_gpu_total_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec)
Returns the number of ECC errors (correctable, uncorrectable and deferred) in the given GPU.
amdsmi_status_t amdsmi_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec)
Returns the number of ECC errors (correctable, uncorrectable and deferred) for the given GPU block.
amdsmi_status_t amdsmi_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks)
Returns the enabled ECC bitmask.
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_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *bad_page_size, amdsmi_eeprom_table_record_t *bad_pages)
Returns the bad page info.
amdsmi_status_t amdsmi_event_destroy(amdsmi_event_set set)
Destroys and frees an event set.
amdsmi_status_t amdsmi_event_read(amdsmi_event_set set, int64_t timeout_usec, amdsmi_event_entry_t *event)
The call blocks till timeout is expired to copy one event specified by the event set into the user pr...
amdsmi_status_t amdsmi_event_create(amdsmi_processor_handle *processor_list, uint32_t num_devices, uint64_t event_types, amdsmi_event_set *set)
Allocate a new event set notifier to monitor different types of issues with the GPU running virtualiz...
amdsmi_status_t amdsmi_get_vf_partition_info(amdsmi_processor_handle processor_handle, unsigned int vf_buffer_num, amdsmi_partition_info_t *info)
Returns the current framebuffer partitioning structure as currently configured by the driver.
amdsmi_status_t amdsmi_get_num_vf(amdsmi_processor_handle processor_handle, uint32_t *num_vf_enabled, uint32_t *num_vf_supported)
Returns the number of VFs enabled by gpuv in the ASIC.
amdsmi_status_t amdsmi_set_num_vf(amdsmi_processor_handle processor_handle, uint32_t num_vf)
Enable a given number of VF.
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 processor.
amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info)
Returns the firmware versions running on PF of the processor.
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 processor.
amdsmi_status_t amdsmi_get_dfc_fw_table(amdsmi_processor_handle processor_handle, amdsmi_dfc_fw_t *info)
Returns the DFC fw table.
amdsmi_status_t amdsmi_get_fw_error_records(amdsmi_processor_handle processor_handle, amdsmi_fw_error_record_t *records)
Gets firmware error records.
amdsmi_status_t amdsmi_get_gpu_metrics(amdsmi_processor_handle processor_handle, uint32_t *metrics_size, amdsmi_metric_t *metrics)
Returns metrics information.
amdsmi_status_t amdsmi_get_power_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_info_t *info)
Returns the current power and voltage of the GPU.
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)
Returns temperature measurements of the GPU. The results are in °C.
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_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap)
Sets GPU power cap.
amdsmi_status_t amdsmi_get_soc_pstate(amdsmi_processor_handle processor_handle, amdsmi_dpm_policy_t *policy)
Returns the soc pstate policy for the processor.
amdsmi_status_t amdsmi_set_soc_pstate(amdsmi_processor_handle processor_handle, uint32_t policy_id)
Set the soc pstate policy for the processor.
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_is_gpu_power_management_enabled(amdsmi_processor_handle processor_handle, bool *enabled)
Returns is power management enabled.
amdsmi_status_t amdsmi_get_guest_data(amdsmi_vf_handle_t vf_handle, amdsmi_guest_data_t *info)
Returns guest OS information of the queried VF. The fw_info field from the amdsmi_guest_data structur...
amdsmi_status_t amdsmi_get_partition_profile_info(amdsmi_processor_handle processor_handle, amdsmi_profile_info_t *profile_info)
Return the list of supported profiles on the given GPU device.
amdsmi_status_t amdsmi_get_vf_fw_info(amdsmi_vf_handle_t vf_handle, amdsmi_fw_info_t *info)
Returns the firmware versions running on a VF. In case the VM is not started on the VF,...
amdsmi_status_t amdsmi_shut_down(void)
The library frees all associated with the library on the current process.
amdsmi_status_t amdsmi_init(uint64_t init_flags)
Initializes the library and the internal software structures.
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_gpu_driver_model(amdsmi_processor_handle processor_handle, amdsmi_driver_model_type_t *model)
Returns the driver model information.
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_get_vf_info(amdsmi_vf_handle_t vf_handle, amdsmi_vf_info_t *config)
Returns the configuration structure for a VF.
amdsmi_status_t amdsmi_get_vf_data(amdsmi_vf_handle_t vf_handle, amdsmi_vf_data_t *info)
Returns the data structure for a VF.
amdsmi_status_t amdsmi_clear_vf_fb(amdsmi_vf_handle_t vf_handle)
Clear the framebuffer of a VF. If trying to clear the framebuffer of an active function,...
uint32_t default_profile_index
The index of the default profile in the profiles array.
Definition: amdsmi.h:1548
uint32_t num_profiles
The length of profiles array.
Definition: amdsmi.h:1545
uint32_t profile_index
The index in the profiles array in amdsmi_accelerator_partition_profile_t.
Definition: amdsmi.h:1530
uint32_t num_partitions
On MI300X, SPX: 1, DPX: 2, QPX: 4, CPX: 8.
Definition: amdsmi.h:1528
amdsmi_nps_caps_t memory_caps
Memory capabilities of the profile.
Definition: amdsmi.h:1529
amdsmi_accelerator_partition_type_t profile_type
SPX, DPX, QPX, CPX and so on.
Definition: amdsmi.h:1527
uint32_t num_resources
length of array resources
Definition: amdsmi.h:1531
uint32_t partition_resource
The resources a partition can be used, which may be shared.
Definition: amdsmi.h:1539
uint32_t num_partitions_share_resource
If it is greater than 1, then resource is shared.
Definition: amdsmi.h:1540
Definition: amdsmi.h:1197
uint32_t vendor_id
Use 32 bit to be compatible with other platform.
Definition: amdsmi.h:1202
uint64_t device_id
The unique id of a GPU.
Definition: amdsmi.h:1204
uint32_t subvendor_id
The subsystem vendor id.
Definition: amdsmi.h:1203
uint32_t subsystem_id
The subsystem device id.
Definition: amdsmi.h:1209
Definition: amdsmi.h:1123
Definition: amdsmi.h:1274
Definition: amdsmi.h:1235
Definition: amdsmi.h:1580
Definition: amdsmi.h:1604
Definition: amdsmi.h:1593
Definition: amdsmi.h:1394
Definition: amdsmi.h:1377
Definition: amdsmi.h:1406
Definition: amdsmi.h:1390
Definition: amdsmi.h:1385
Definition: amdsmi.h:1553
Definition: amdsmi.h:1559
uint32_t cur
Definition: amdsmi.h:1568
uint32_t num_supported
Definition: amdsmi.h:1563
Definition: amdsmi.h:1213
Definition: amdsmi.h:1411
uint64_t retired_page
Bad page frame address.
Definition: amdsmi.h:1412
Definition: amdsmi.h:1228
Definition: amdsmi.h:1244
uint64_t uncorrectable_count
Accumulated uncorrectable errors.
Definition: amdsmi.h:1246
uint64_t correctable_count
Accumulated correctable errors.
Definition: amdsmi.h:1245
uint64_t deferred_count
Accumulated deferred errors.
Definition: amdsmi.h:1247
Definition: amdsmi.h:1261
uint64_t timestamp
UTC microseconds.
Definition: amdsmi.h:1264
Definition: amdsmi.h:1432
Definition: amdsmi.h:1187
Definition: amdsmi.h:1424
uint64_t timestamp
UTC microseconds.
Definition: amdsmi.h:1425
uint16_t status
Definition: amdsmi.h:1428
Definition: amdsmi.h:1176
Definition: amdsmi.h:1174
Definition: amdsmi.h:1305
Definition: amdsmi.h:1371
uint32_t fb_usage
Definition: amdsmi.h:1373
Definition: amdsmi.h:1514
Definition: amdsmi.h:1481
uint32_t flags
used to determine type of the metric (amdsmi_metric_type_t)
Definition: amdsmi.h:1485
uint32_t vf_mask
Mask of all active VFs + PF that this metric applies to.
Definition: amdsmi.h:1486
Definition: amdsmi.h:1504
Definition: amdsmi.h:1299
Definition: amdsmi.h:1141
uint64_t pcie_nak_received_count
total number of NAKs issued on the PCIe link by the receiver
Definition: amdsmi.h:1149
uint64_t pcie_replay_count
total number of the replays issued on the PCIe link
Definition: amdsmi.h:1145
uint16_t pcie_width
current PCIe width
Definition: amdsmi.h:1142
uint32_t pcie_speed
current PCIe speed in MT/s
Definition: amdsmi.h:1143
uint32_t pcie_bandwidth
current PCIe bandwidth in Mb/s
Definition: amdsmi.h:1144
uint64_t pcie_l0_to_recovery_count
total number of times the PCIe link transitioned from L0 to the recovery state
Definition: amdsmi.h:1146
uint64_t pcie_nak_sent_count
total number of NAKs issued on the PCIe link by the device
Definition: amdsmi.h:1148
uint64_t pcie_replay_roll_over_count
total number of replay rollovers issued on the PCIe link
Definition: amdsmi.h:1147
uint32_t pcie_lc_perf_other_end_recovery_count
PCIe other end recovery counter.
Definition: amdsmi.h:1150
Definition: amdsmi.h:1133
uint16_t max_pcie_width
maximum number of PCIe lanes
Definition: amdsmi.h:1134
uint32_t max_pcie_interface_version
maximum PCIe link generation
Definition: amdsmi.h:1138
amdsmi_card_form_factor_t slot_type
card form factor
Definition: amdsmi.h:1137
uint32_t max_pcie_speed
maximum PCIe speed
Definition: amdsmi.h:1135
uint32_t pcie_interface_version
PCIe interface version.
Definition: amdsmi.h:1136
Definition: amdsmi.h:1132
Definition: amdsmi.h:1283
uint32_t pf_fb_reserved
Definition: amdsmi.h:1285
uint32_t min_vf_fb_usable
Definition: amdsmi.h:1289
uint32_t fb_alignment
Definition: amdsmi.h:1287
uint32_t total_fb_size
Definition: amdsmi.h:1284
uint32_t max_vf_fb_usable
Definition: amdsmi.h:1288
uint32_t pf_fb_offset
Definition: amdsmi.h:1286
Definition: amdsmi.h:1157
Definition: amdsmi.h:1220
uint64_t soc_voltage
SOC voltage measurement in mV.
Definition: amdsmi.h:1223
uint64_t mem_voltage
MEM voltage measurement in mV.
Definition: amdsmi.h:1224
uint64_t gfx_voltage
GFX voltage measurement in mV.
Definition: amdsmi.h:1222
Definition: amdsmi.h:1352
Definition: amdsmi.h:1361
Definition: amdsmi.h:1251
uint32_t supported_ecc_correction_schema
ecc_correction_schema mask used with amdsmi_ecc_correction_schema_support_t flags
Definition: amdsmi.h:1253
Definition: amdsmi.h:1327
uint64_t boot_up_time
in microseconds
Definition: amdsmi.h:1329
Definition: amdsmi.h:1166
This structure holds version information.
Definition: amdsmi.h:1494
uint32_t minor
Minor version.
Definition: amdsmi.h:1496
uint32_t major
Major version.
Definition: amdsmi.h:1495
uint32_t release
Patch, build or stepping version.
Definition: amdsmi.h:1497
Definition: amdsmi.h:1346
Definition: amdsmi.h:1293
uint32_t fb_size
Definition: amdsmi.h:1295
uint32_t fb_offset
Definition: amdsmi.h:1294
Definition: amdsmi.h:1257
Definition: amdsmi.h:1321
uint32_t gfx_timeslice
Definition: amdsmi.h:1323
Definition: amdsmi.h:1473
uint32_t vram_size
vram size in MB
Definition: amdsmi.h:1476
Definition: amdsmi.h:1462
AUX STRUCTURES.
Definition: amdsmi.h:1122
This union holds memory partition bitmask.
Definition: amdsmi.h:1503
Definition: amdsmi.h:1461