rocm_smi.h Source File

rocm_smi.h Source File#

ROCmSMI: rocm_smi.h Source File
rocm_smi.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) 2017-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 ROCM_SMI_ROCM_SMI_H_
44 #define ROCM_SMI_ROCM_SMI_H_
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #include <cstdint>
49 #else
50 #include <stdint.h>
51 #endif // __cplusplus
52 
53 #include <stddef.h>
54 #include <stdbool.h>
55 
56 #include "rocm_smi/kfd_ioctl.h"
57 
74 #define RSMI_MAX_NUM_FREQUENCIES 33
75 
78 #define RSMI_MAX_FAN_SPEED 255
79 
81 #define RSMI_NUM_VOLTAGE_CURVE_POINTS 3
82 
83 
87 typedef enum {
109  RSMI_INITIALIZATION_ERROR = RSMI_STATUS_INIT_ERROR,
135 
137 } rsmi_status_t;
138 
145 typedef enum {
152  RSMI_INIT_FLAG_THRAD_ONLY_MUTEX = 0x400000000000000,
153  RSMI_INIT_FLAG_RESRV_TEST1 = 0x800000000000000,
155 
159 typedef enum {
161  RSMI_DEV_PERF_LEVEL_FIRST = RSMI_DEV_PERF_LEVEL_AUTO,
162 
177 
178  RSMI_DEV_PERF_LEVEL_LAST = RSMI_DEV_PERF_LEVEL_DETERMINISM,
179 
183 typedef rsmi_dev_perf_level_t rsmi_dev_perf_level;
185 
192 typedef enum {
193  RSMI_SW_COMP_FIRST = 0x0,
194 
195  RSMI_SW_COMP_DRIVER = RSMI_SW_COMP_FIRST,
196 
197  RSMI_SW_COMP_LAST = RSMI_SW_COMP_DRIVER
199 
207 typedef uintptr_t rsmi_event_handle_t;
208 
215 typedef enum {
218  RSMI_EVNT_GRP_INVALID = 0xFFFFFFFF
220 
227 typedef enum {
228  RSMI_EVNT_FIRST = RSMI_EVNT_GRP_XGMI,
229 
230  RSMI_EVNT_XGMI_FIRST = RSMI_EVNT_GRP_XGMI,
231  RSMI_EVNT_XGMI_0_NOP_TX = RSMI_EVNT_XGMI_FIRST,
236 
249  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
259 
260  RSMI_EVNT_XGMI_LAST = RSMI_EVNT_XGMI_1_BEATS_TX, // 5
261 
262  RSMI_EVNT_XGMI_DATA_OUT_FIRST = RSMI_EVNT_GRP_XGMI_DATA_OUT, // 10
263 
264  /*
265  * @brief Events in the RSMI_EVNT_GRP_XGMI_DATA_OUT group measure
266  * the number of beats sent on an XGMI link. Each beat represents
267  * 32 bytes. RSMI_EVNT_XGMI_DATA_OUT_n represents the number of
268  * outbound beats (each representing 32 bytes) on link n.<br><br>
269  *
270  * XGMI throughput can be calculated by multiplying a event
271  * such as ::RSMI_EVNT_XGMI_DATA_OUT_n by 32 and dividing by
272  * the time for which event collection occurred,
273  * ::rsmi_counter_value_t.time_running (which is in nanoseconds). To get
274  * bytes per second, multiply this value by 10<sup>9</sup>.<br>
275  * <br>
276  * Throughput = BEATS/time_running * 10<sup>9</sup> (bytes/second)<br>
277  */
278  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
279  RSMI_EVNT_XGMI_DATA_OUT_0 = RSMI_EVNT_XGMI_DATA_OUT_FIRST,
285  RSMI_EVNT_XGMI_DATA_OUT_LAST = RSMI_EVNT_XGMI_DATA_OUT_5,
286 
287  RSMI_EVNT_LAST = RSMI_EVNT_XGMI_DATA_OUT_LAST,
289 
293 typedef enum {
298 
302 typedef struct {
303  uint64_t value;
304  uint64_t time_enabled;
306  uint64_t time_running;
309 
313 typedef enum {
314  RSMI_EVT_NOTIF_NONE = KFD_SMI_EVENT_NONE,
315  RSMI_EVT_NOTIF_VMFAULT = KFD_SMI_EVENT_VMFAULT,
316  RSMI_EVT_NOTIF_FIRST = RSMI_EVT_NOTIF_VMFAULT,
317  RSMI_EVT_NOTIF_THERMAL_THROTTLE = KFD_SMI_EVENT_THERMAL_THROTTLE,
318  RSMI_EVT_NOTIF_GPU_PRE_RESET = KFD_SMI_EVENT_GPU_PRE_RESET,
319  RSMI_EVT_NOTIF_GPU_POST_RESET = KFD_SMI_EVENT_GPU_POST_RESET,
320  RSMI_EVT_NOTIF_RING_HANG = KFD_SMI_EVENT_RING_HANG,
321 
322  RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_RING_HANG
324 
328 #define RSMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
329 
331 #define MAX_EVENT_NOTIFICATION_MSG_SIZE 64
332 
336 typedef struct {
337  uint32_t dv_ind;
341 
345 typedef enum {
347  RSMI_CLK_TYPE_FIRST = RSMI_CLK_TYPE_SYS,
354 
355  // Add new clocks to the end (not in the middle) and update
356  // RSMI_CLK_TYPE_LAST
357  RSMI_CLK_TYPE_LAST = RSMI_CLK_TYPE_MEM,
358  RSMI_CLK_INVALID = 0xFFFFFFFF
361 typedef rsmi_clk_type_t rsmi_clk_type;
363 
368 typedef enum {
369  RSMI_COMPUTE_PARTITION_INVALID = 0,
382 typedef rsmi_compute_partition_type_t rsmi_compute_partition_type;
384 
389 typedef enum {
390  RSMI_MEMORY_PARTITION_UNKNOWN = 0,
406 typedef rsmi_memory_partition_type_t rsmi_memory_partition_type;
408 
414 typedef enum {
416  RSMI_TEMP_FIRST = RSMI_TEMP_CURRENT,
417 
448 
449  RSMI_TEMP_LAST = RSMI_TEMP_HIGHEST
452 typedef rsmi_temperature_metric_t rsmi_temperature_metric;
454 
459 typedef enum {
460  RSMI_TEMP_TYPE_FIRST = 0,
461 
462  RSMI_TEMP_TYPE_EDGE = RSMI_TEMP_TYPE_FIRST,
470  RSMI_TEMP_TYPE_LAST = RSMI_TEMP_TYPE_HBM_3,
471  RSMI_TEMP_TYPE_INVALID = 0xFFFFFFFF
473 
479 typedef enum {
480  /* Utilization */
481  RSMI_ACTIVITY_GFX = (0x1 << 0),
482  RSMI_ACTIVITY_UMC = (0x1 << 1),
483  RSMI_ACTIVITY_MM = (0x1 << 2)
485 
486 
492 typedef enum {
494 
495  RSMI_VOLT_FIRST = RSMI_VOLT_CURRENT,
503 
504  RSMI_VOLT_LAST = RSMI_VOLT_HIGHEST
506 
511 typedef enum {
512  RSMI_VOLT_TYPE_FIRST = 0,
513 
514  RSMI_VOLT_TYPE_VDDGFX = RSMI_VOLT_TYPE_FIRST,
516  RSMI_VOLT_TYPE_LAST = RSMI_VOLT_TYPE_VDDGFX,
517  RSMI_VOLT_TYPE_INVALID = 0xFFFFFFFF
519 
526 typedef enum {
532 
534  RSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK = 0x20,
537 
539  RSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF
542 typedef rsmi_power_profile_preset_masks_t rsmi_power_profile_preset_masks;
544 
548 typedef enum {
549  RSMI_GPU_BLOCK_INVALID = 0x0000000000000000,
551  RSMI_GPU_BLOCK_FIRST = 0x0000000000000001,
552 
553  RSMI_GPU_BLOCK_UMC = RSMI_GPU_BLOCK_FIRST,
554  RSMI_GPU_BLOCK_SDMA = 0x0000000000000002,
555  RSMI_GPU_BLOCK_GFX = 0x0000000000000004,
556  RSMI_GPU_BLOCK_MMHUB = 0x0000000000000008,
557  RSMI_GPU_BLOCK_ATHUB = 0x0000000000000010,
558  RSMI_GPU_BLOCK_PCIE_BIF = 0x0000000000000020,
559  RSMI_GPU_BLOCK_HDP = 0x0000000000000040,
560  RSMI_GPU_BLOCK_XGMI_WAFL = 0x0000000000000080,
561  RSMI_GPU_BLOCK_DF = 0x0000000000000100,
562  RSMI_GPU_BLOCK_SMN = 0x0000000000000200,
563  RSMI_GPU_BLOCK_SEM = 0x0000000000000400,
564  RSMI_GPU_BLOCK_MP0 = 0x0000000000000800,
565  RSMI_GPU_BLOCK_MP1 = 0x0000000000001000,
566  RSMI_GPU_BLOCK_FUSE = 0x0000000000002000,
567 
570  RSMI_GPU_BLOCK_RESERVED = 0x8000000000000000
573 typedef rsmi_gpu_block_t rsmi_gpu_block;
575 
579 typedef enum {
588 
589  RSMI_RAS_ERR_STATE_LAST = RSMI_RAS_ERR_STATE_ENABLED,
590  RSMI_RAS_ERR_STATE_INVALID = 0xFFFFFFFF
592 
596 typedef enum {
597  RSMI_MEM_TYPE_FIRST = 0,
598 
599  RSMI_MEM_TYPE_VRAM = RSMI_MEM_TYPE_FIRST,
602 
603  RSMI_MEM_TYPE_LAST = RSMI_MEM_TYPE_GTT
605 
609 typedef enum {
612  RSMI_FREQ_IND_INVALID = 0xFFFFFFFF
615 typedef rsmi_freq_ind_t rsmi_freq_ind;
617 
618 
623 typedef enum {
624  RSMI_FW_BLOCK_FIRST = 0,
625 
626  RSMI_FW_BLOCK_ASD = RSMI_FW_BLOCK_FIRST,
627  RSMI_FW_BLOCK_CE,
628  RSMI_FW_BLOCK_DMCU,
629  RSMI_FW_BLOCK_MC,
630  RSMI_FW_BLOCK_ME,
631  RSMI_FW_BLOCK_MEC,
632  RSMI_FW_BLOCK_MEC2,
633  RSMI_FW_BLOCK_MES,
634  RSMI_FW_BLOCK_MES_KIQ,
635  RSMI_FW_BLOCK_PFP,
636  RSMI_FW_BLOCK_RLC,
637  RSMI_FW_BLOCK_RLC_SRLC,
638  RSMI_FW_BLOCK_RLC_SRLG,
639  RSMI_FW_BLOCK_RLC_SRLS,
640  RSMI_FW_BLOCK_SDMA,
641  RSMI_FW_BLOCK_SDMA2,
642  RSMI_FW_BLOCK_SMC,
643  RSMI_FW_BLOCK_SOS,
644  RSMI_FW_BLOCK_TA_RAS,
645  RSMI_FW_BLOCK_TA_XGMI,
646  RSMI_FW_BLOCK_UVD,
647  RSMI_FW_BLOCK_VCE,
648  RSMI_FW_BLOCK_VCN,
649 
650  RSMI_FW_BLOCK_LAST = RSMI_FW_BLOCK_VCN
652 
656 typedef enum {
657  RSMI_XGMI_STATUS_NO_ERRORS = 0,
658  RSMI_XGMI_STATUS_ERROR,
659  RSMI_XGMI_STATUS_MULTIPLE_ERRORS,
661 
665 typedef uint64_t rsmi_bit_field_t;
667 typedef rsmi_bit_field_t rsmi_bit_field;
669 
673 typedef enum {
681 
685 typedef enum _RSMI_IO_LINK_TYPE {
690  RSMI_IOLINK_TYPE_SIZE = 0xFFFFFFFF
692 
695 #define CPU_NODE_INDEX 0xFFFFFFFF
696 
700 typedef enum {
703  RSMI_COARSE_GRAIN_GFX_ACTIVITY = RSMI_UTILIZATION_COUNTER_FIRST,
705  RSMI_UTILIZATION_COUNTER_LAST = RSMI_COARSE_GRAIN_MEM_ACTIVITY
707 
711 typedef enum {
714  RSMI_INVALID_POWER = 0xFFFFFFFF
716 
720 typedef struct {
722  uint64_t value;
724 
728 typedef struct {
729  uint64_t page_address;
730  uint64_t page_size;
733 
737 #define RSMI_MAX_NUM_POWER_PROFILES (sizeof(rsmi_bit_field_t) * 8)
738 
744 typedef struct {
749 
754 
758  uint32_t num_profiles;
761 typedef rsmi_power_profile_status_t rsmi_power_profile_status;
763 
767 typedef struct {
772 
776  uint32_t num_supported;
777 
781  uint32_t current;
782 
787  uint64_t frequency[RSMI_MAX_NUM_FREQUENCIES];
790 typedef rsmi_frequencies_t rsmi_frequencies;
792 
798 typedef struct {
803 
808  uint32_t lanes[RSMI_MAX_NUM_FREQUENCIES];
810 
812 typedef rsmi_pcie_bandwidth_t rsmi_pcie_bandwidth;
814 
819 typedef struct {
820  /* Utilization */
825 
829 typedef struct {
830  uint32_t major;
831  uint32_t minor;
832  uint32_t patch;
833  const char *build;
836 typedef rsmi_version_t rsmi_version;
838 
841 typedef struct {
842  uint64_t lower_bound;
843  uint64_t upper_bound;
844 } rsmi_range_t;
846 typedef rsmi_range_t rsmi_range;
848 
852 typedef struct {
853  uint64_t frequency;
854  uint64_t voltage;
857 typedef rsmi_od_vddc_point_t rsmi_od_vddc_point;
859 
865 typedef struct {
870 typedef rsmi_freq_volt_region_t rsmi_freq_volt_region;
872 
876 typedef struct {
884 typedef rsmi_od_volt_curve_t rsmi_od_volt_curve;
886 
890 typedef struct {
896 
901  uint32_t num_regions;
904 typedef rsmi_od_volt_freq_data_t rsmi_od_volt_freq_data;
906 
907 
916  // TODO(amd) Doxygen documents
917  // Note: This should match: AMDGpuMetricsHeader_v1_t
919  uint16_t structure_size;
920  uint8_t format_revision;
921  uint8_t content_revision;
923 };
927 
931 #define CENTRIGRADE_TO_MILLI_CENTIGRADE 1000
932 
936 #define RSMI_NUM_HBM_INSTANCES 4
937 
941 #define RSMI_MAX_NUM_VCNS 4
942 
946 #define RSMI_MAX_NUM_JPEG_ENGS 32
947 
951 #define RSMI_MAX_NUM_CLKS 4
952 
956 #define RSMI_MAX_NUM_XGMI_LINKS 8
957 
961 #define RSMI_MAX_NUM_GFX_CLKS 8
962 
972 #define RSMI_MAX_NUM_XCC 8
973 
984 #define RSMI_MAX_NUM_XCP 8
985 
990  /* Utilization Instantaneous (%) */
991  uint32_t gfx_busy_inst[RSMI_MAX_NUM_XCC];
992  uint16_t jpeg_busy[RSMI_MAX_NUM_JPEG_ENGS];
993  uint16_t vcn_busy[RSMI_MAX_NUM_VCNS];
994 
995  /* Utilization Accumulated (%) */
996  uint64_t gfx_busy_acc[RSMI_MAX_NUM_XCC];
997 };
998 
999 typedef struct {
1000  // TODO(amd) Doxygen documents
1001  // Note: This structure is extended to fit the needs of different GPU metric
1002  // versions when exposing data through the structure.
1003  // Depending on the version, some data members will hold data, and
1004  // some will not. A good example is the set of 'current clocks':
1005  // - current_gfxclk, current_socclk, current_vclk0, current_dclk0
1006  // These are single-valued data members, up to version 1.3.
1007  // For version 1.4 and up these are multi-valued data members (arrays)
1008  // and their counterparts;
1009  // - current_gfxclks[], current_socclks[], current_vclk0s[],
1010  // current_dclk0s[]
1011  // will hold the data
1013 
1014  /*
1015  * v1.0 Base
1016  */
1017  struct metrics_table_header_t common_header;
1018 
1019  // Temperature (C)
1020  uint16_t temperature_edge;
1021  uint16_t temperature_hotspot;
1022  uint16_t temperature_mem;
1023  uint16_t temperature_vrgfx;
1024  uint16_t temperature_vrsoc;
1025  uint16_t temperature_vrmem;
1026 
1027  // Utilization (%)
1028  uint16_t average_gfx_activity;
1029  uint16_t average_umc_activity; // memory controller
1030  uint16_t average_mm_activity; // UVD or VCN
1031 
1032  // Power (W) /Energy (15.259uJ per 1ns)
1033  uint16_t average_socket_power;
1034  uint64_t energy_accumulator; // v1 mod. (32->64)
1035 
1036  // Driver attached timestamp (in ns)
1037  uint64_t system_clock_counter; // v1 mod. (moved from top of struct)
1038 
1039  // Average clocks (MHz)
1040  uint16_t average_gfxclk_frequency;
1041  uint16_t average_socclk_frequency;
1042  uint16_t average_uclk_frequency;
1043  uint16_t average_vclk0_frequency;
1044  uint16_t average_dclk0_frequency;
1045  uint16_t average_vclk1_frequency;
1046  uint16_t average_dclk1_frequency;
1047 
1048  // Current clocks (MHz)
1049  uint16_t current_gfxclk;
1050  uint16_t current_socclk;
1051  uint16_t current_uclk;
1052  uint16_t current_vclk0;
1053  uint16_t current_dclk0;
1054  uint16_t current_vclk1;
1055  uint16_t current_dclk1;
1056 
1057  // Throttle status
1058  uint32_t throttle_status;
1059 
1060  // Fans (RPM)
1061  uint16_t current_fan_speed;
1062 
1063  // Link width (number of lanes) /speed (0.1 GT/s)
1064  uint16_t pcie_link_width; // v1 mod.(8->16)
1065  uint16_t pcie_link_speed; // in 0.1 GT/s; v1 mod. (8->16)
1066 
1067 
1068  /*
1069  * v1.1 additions
1070  */
1071  uint32_t gfx_activity_acc; // new in v1
1072  uint32_t mem_activity_acc; // new in v1
1073  uint16_t temperature_hbm[RSMI_NUM_HBM_INSTANCES]; // new in v1
1074 
1075 
1076  /*
1077  * v1.2 additions
1078  */
1079  // PMFW attached timestamp (10ns resolution)
1080  uint64_t firmware_timestamp;
1081 
1082 
1083  /*
1084  * v1.3 additions
1085  */
1086  // Voltage (mV)
1087  uint16_t voltage_soc;
1088  uint16_t voltage_gfx;
1089  uint16_t voltage_mem;
1090 
1091  // Throttle status
1092  uint64_t indep_throttle_status;
1093 
1094 
1095  /*
1096  * v1.4 additions
1097  */
1098  // Power (Watts)
1099  uint16_t current_socket_power;
1100 
1101  // Utilization (%)
1102  uint16_t vcn_activity[RSMI_MAX_NUM_VCNS]; // VCN instances activity percent (encode/decode)
1103 
1104  // Clock Lock Status. Each bit corresponds to clock instance
1105  uint32_t gfxclk_lock_status;
1106 
1107  // XGMI bus width and bitrate (in GB/s)
1108  uint16_t xgmi_link_width;
1109  uint16_t xgmi_link_speed;
1110 
1111  // PCIE accumulated bandwidth (GB/sec)
1112  uint64_t pcie_bandwidth_acc;
1113 
1114  // PCIE instantaneous bandwidth (GB/sec)
1115  uint64_t pcie_bandwidth_inst;
1116 
1117  // PCIE L0 to recovery state transition accumulated count
1118  uint64_t pcie_l0_to_recov_count_acc;
1119 
1120  // PCIE replay accumulated count
1121  uint64_t pcie_replay_count_acc;
1122 
1123  // PCIE replay rollover accumulated count
1124  uint64_t pcie_replay_rover_count_acc;
1125 
1126  // XGMI accumulated data transfer size(KiloBytes)
1127  uint64_t xgmi_read_data_acc[RSMI_MAX_NUM_XGMI_LINKS];
1128  uint64_t xgmi_write_data_acc[RSMI_MAX_NUM_XGMI_LINKS];
1129 
1130  // XGMI accumulated data transfer size(KiloBytes)
1131  uint16_t current_gfxclks[RSMI_MAX_NUM_GFX_CLKS];
1132  uint16_t current_socclks[RSMI_MAX_NUM_CLKS];
1133  uint16_t current_vclk0s[RSMI_MAX_NUM_CLKS];
1134  uint16_t current_dclk0s[RSMI_MAX_NUM_CLKS];
1135 
1136  /*
1137  * v1.5 additions
1138  */
1139  // JPEG activity percent (encode/decode)
1140  uint16_t jpeg_activity[RSMI_MAX_NUM_JPEG_ENGS];
1141 
1142  // PCIE NAK sent accumulated count
1143  uint32_t pcie_nak_sent_count_acc;
1144 
1145  // PCIE NAK received accumulated count
1146  uint32_t pcie_nak_rcvd_count_acc;
1147 
1148  /*
1149  * v1.6 additions
1150  */
1151  /* Accumulation cycle counter */
1152  uint64_t accumulation_counter;
1153 
1157  uint64_t prochot_residency_acc;
1172  uint64_t ppt_residency_acc;
1187  uint64_t socket_thm_residency_acc;
1188  uint64_t vr_thm_residency_acc;
1189  uint64_t hbm_thm_residency_acc;
1190 
1191  /* Number of current partition */
1192  uint16_t num_partition;
1193 
1194  /* XCP (Graphic Cluster Partitions) metrics stats */
1195  struct amdgpu_xcp_metrics_t xcp_stats[RSMI_MAX_NUM_XCP];
1196 
1197  /* PCIE other end recovery counter */
1198  uint32_t pcie_lc_perf_other_end_recovery;
1199 
1202 
1206 typedef struct {
1207  uint64_t correctable_err;
1210 
1214 typedef struct {
1215  uint32_t process_id;
1216  uint32_t pasid;
1217  uint64_t vram_usage;
1218  uint64_t sdma_usage;
1219  uint32_t cu_occupancy;
1221 
1223 #define CU_OCCUPANCY_INVALID 0xFFFFFFFF
1224 
1228 typedef struct rsmi_func_id_iter_handle * rsmi_func_id_iter_handle_t;
1229 
1232 #define RSMI_DEFAULT_VARIANT 0xFFFFFFFFFFFFFFFF
1233 
1239 typedef union id {
1240  uint64_t id;
1241  const char *name;
1242  union {
1256  rsmi_gpu_block_t gpu_block_type;
1257  };
1259 
1260 
1261 /*****************************************************************************/
1279 rsmi_status_t rsmi_init(uint64_t init_flags);
1280 
1287  // end of InitShut
1289 
1290 /*****************************************************************************/
1308 
1336 rsmi_status_t rsmi_dev_id_get(uint32_t dv_ind, uint16_t *id);
1337 
1352 rsmi_status_t rsmi_dev_revision_get(uint32_t dv_ind, uint16_t *revision);
1353 
1378 rsmi_status_t rsmi_dev_sku_get(uint32_t dv_ind, uint16_t *sku);
1379 
1403 rsmi_status_t rsmi_dev_vendor_id_get(uint32_t dv_ind, uint16_t *id);
1404 
1439 rsmi_status_t rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len);
1440 
1473 rsmi_status_t rsmi_dev_brand_get(uint32_t dv_ind, char *brand, uint32_t len);
1474 
1509 rsmi_status_t rsmi_dev_vendor_name_get(uint32_t dv_ind, char *name,
1510  size_t len);
1511 
1534 rsmi_status_t rsmi_dev_vram_vendor_get(uint32_t dv_ind, char *brand,
1535  uint32_t len);
1536 
1566  char *serial_num, uint32_t len);
1590 rsmi_status_t rsmi_dev_subsystem_id_get(uint32_t dv_ind, uint16_t *id);
1591 
1627 rsmi_dev_subsystem_name_get(uint32_t dv_ind, char *name, size_t len);
1628 
1647 rsmi_dev_drm_render_minor_get(uint32_t dv_ind, uint32_t *minor);
1648 
1671 rsmi_status_t rsmi_dev_subsystem_vendor_id_get(uint32_t dv_ind, uint16_t *id);
1672 
1694 rsmi_status_t rsmi_dev_unique_id_get(uint32_t dv_ind, uint64_t *id);
1695 
1710 rsmi_status_t rsmi_dev_xgmi_physical_id_get(uint32_t dv_ind, uint16_t *id);
1711 
1734 rsmi_status_t rsmi_dev_guid_get(uint32_t dv_ind, uint64_t *guid);
1735 
1758 rsmi_status_t rsmi_dev_node_id_get(uint32_t dv_ind, uint32_t *node_id);
1759 
1760  // end of IDQuer
1762 
1763 /*****************************************************************************/
1789 
1827 rsmi_status_t rsmi_dev_pci_id_get(uint32_t dv_ind, uint64_t *bdfid);
1828 
1851 rsmi_status_t rsmi_topo_numa_affinity_get(uint32_t dv_ind, int32_t *numa_node);
1852 
1877 rsmi_status_t rsmi_dev_pci_throughput_get(uint32_t dv_ind, uint64_t *sent,
1878  uint64_t *received, uint64_t *max_pkt_sz);
1879 
1903  uint64_t *counter);
1904  // end of PCIeQuer
1906 /*****************************************************************************/
1941 rsmi_status_t rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask);
1942  // end of PCIeCont
1944 
1945 /*****************************************************************************/
1981 rsmi_dev_power_ave_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *power);
1982 
2005 rsmi_dev_current_socket_power_get(uint32_t dv_ind, uint64_t *socket_power);
2006 
2041 rsmi_status_t rsmi_dev_power_get(uint32_t dv_ind, uint64_t *power,
2042  RSMI_POWER_TYPE *type);
2043 
2075 rsmi_dev_energy_count_get(uint32_t dv_ind, uint64_t *power,
2076  float *counter_resolution, uint64_t *timestamp);
2077 
2104 rsmi_dev_power_cap_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *cap);
2105 
2128 rsmi_dev_power_cap_default_get(uint32_t dv_ind, uint64_t *default_cap);
2129 
2162 rsmi_dev_power_cap_range_get(uint32_t dv_ind, uint32_t sensor_ind,
2163  uint64_t *max, uint64_t *min);
2164  // end of PowerQuer
2166 
2167 /*****************************************************************************/
2193 rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap);
2194 
2215 rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t reserved,
2216  rsmi_power_profile_preset_masks_t profile); // end of PowerCont
2218 /*****************************************************************************/
2219 
2220 
2221 
2222 /*****************************************************************************/
2255  uint64_t *total);
2256 
2285  uint64_t *used);
2286 
2310 rsmi_dev_memory_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent);
2311 
2348 rsmi_dev_memory_reserved_pages_get(uint32_t dv_ind, uint32_t *num_pages,
2349  rsmi_retired_page_record_t *records); // end of MemQuer
2351 
2383 rsmi_status_t rsmi_dev_fan_rpms_get(uint32_t dv_ind, uint32_t sensor_ind,
2384  int64_t *speed);
2385 
2414  uint32_t sensor_ind, int64_t *speed);
2415 
2442  uint32_t sensor_ind, uint64_t *max_speed);
2443 
2474 rsmi_status_t rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_type,
2475  rsmi_temperature_metric_t metric, int64_t *temperature);
2476 
2508  rsmi_voltage_type_t sensor_type,
2509  rsmi_voltage_metric_t metric, int64_t *voltage); // end of PhysQuer
2511 
2512 /*****************************************************************************/
2532 rsmi_status_t rsmi_dev_fan_reset(uint32_t dv_ind, uint32_t sensor_ind);
2533 
2556 rsmi_status_t rsmi_dev_fan_speed_set(uint32_t dv_ind, uint32_t sensor_ind,
2557  uint64_t speed);
2558  // end of PhysCont
2560 /*****************************************************************************/
2591 rsmi_dev_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent);
2592 
2624  rsmi_utilization_counter_t utilization_counters[],
2625  uint32_t count,
2626  uint64_t *timestamp);
2627 
2653  rsmi_activity_metric_t activity_metric_type,
2654  rsmi_activity_metric_counter_t* activity_metric_counter);
2655 
2677 rsmi_dev_activity_avg_mm_get(uint32_t dv_ind, uint16_t* avg_activity);
2678 
2703  rsmi_dev_perf_level_t *perf);
2704 
2727  uint64_t clkvalue);
2728 
2752 rsmi_status_t rsmi_dev_overdrive_level_get(uint32_t dv_ind, uint32_t *od);
2753 
2777 rsmi_status_t rsmi_dev_mem_overdrive_level_get(uint32_t dv_ind, uint32_t *od);
2778 
2812  rsmi_clk_type_t clk_type, rsmi_frequencies_t *f);
2813 
2828 
2851 
2873  rsmi_gpu_metrics_t *pgpu_metrics);
2874 
2897 rsmi_status_t rsmi_dev_clk_range_set(uint32_t dv_ind, uint64_t minclkvalue,
2898  uint64_t maxclkvalue,
2899  rsmi_clk_type_t clkType);
2900 
2923  uint64_t clkvalue,
2924  rsmi_clk_type_t clkType);
2925 
2949  uint64_t clkvalue,
2950  rsmi_clk_type_t clkType);
2951 
2973 rsmi_status_t rsmi_dev_od_volt_info_set(uint32_t dv_ind, uint32_t vpoint,
2974  uint64_t clkvalue, uint64_t voltvalue);
2975 
3015  uint32_t *num_regions, rsmi_freq_volt_region_t *buffer);
3016 
3053 rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind,
3054  rsmi_power_profile_status_t *status);
3055  // end of PerfQuer
3057 /*****************************************************************************/
3058 
3087 
3108 
3152 rsmi_status_t rsmi_dev_overdrive_level_set(uint32_t dv_ind, uint32_t od);
3153 
3193 rsmi_status_t rsmi_dev_overdrive_level_set_v1(uint32_t dv_ind, uint32_t od);
3194 
3230  rsmi_clk_type_t clk_type, uint64_t freq_bitmask);
3231  // end of PerfCont
3233 
3234 /*****************************************************************************/
3255 
3283  uint32_t len);
3284 
3312 rsmi_dev_vbios_version_get(uint32_t dv_ind, char *vbios, uint32_t len);
3313 
3340  uint64_t *fw_version);
3341 
3363  uint64_t *gfx_version);
3364  // end of VersQuer
3366 
3367 /*****************************************************************************/
3401 
3430  uint64_t *enabled_blocks);
3431 
3458  rsmi_ras_err_state_t *state);
3474 rsmi_status_string(rsmi_status_t status, const char **status_string);
3475  // end of ErrQuer
3477 
3478 /*****************************************************************************/
3601 
3632  rsmi_event_handle_t *evnt_handle);
3633 
3649 
3669  rsmi_counter_command_t cmd, void *cmd_args);
3670 
3690  rsmi_counter_value_t *value);
3691 
3713  rsmi_event_group_t grp, uint32_t *available); // end of PerfCntr
3715 
3716 /*****************************************************************************/
3756 
3780 
3816 rsmi_compute_process_gpus_get(uint32_t pid, uint32_t *dv_indices,
3817  uint32_t *num_devices);
3818 
3839 rsmi_compute_process_info_by_device_get(uint32_t pid, uint32_t dv_ind,
3840  rsmi_process_info_t *proc);
3841  // end of SysInfo
3843 
3844 /*****************************************************************************/
3875 
3889 rsmi_dev_xgmi_error_reset(uint32_t dv_ind);
3890 
3910 rsmi_dev_xgmi_hive_id_get(uint32_t dv_ind, uint64_t *hive_id);
3911  // end of SysInfo
3913 
3914 /*****************************************************************************/
3938 rsmi_topo_get_numa_node_number(uint32_t dv_ind, uint32_t *numa_node);
3939 
3961 rsmi_topo_get_link_weight(uint32_t dv_ind_src, uint32_t dv_ind_dst,
3962  uint64_t *weight);
3963 
3987 rsmi_minmax_bandwidth_get(uint32_t dv_ind_src, uint32_t dv_ind_dst,
3988  uint64_t *min_bandwidth, uint64_t *max_bandwidth);
3989 
4023 rsmi_topo_get_link_type(uint32_t dv_ind_src, uint32_t dv_ind_dst,
4024  uint64_t *hops, RSMI_IO_LINK_TYPE *type);
4025 
4047 rsmi_is_P2P_accessible(uint32_t dv_ind_src, uint32_t dv_ind_dst,
4048  bool *accessible);
4049  // end of HWTopo
4051 
4052 /*****************************************************************************/
4088 rsmi_dev_compute_partition_get(uint32_t dv_ind, char *compute_partition,
4089  uint32_t len);
4090 
4117  rsmi_compute_partition_type_t compute_partition);
4118 
4141 rsmi_status_t rsmi_dev_partition_id_get(uint32_t dv_ind, uint32_t *partition_id);
4142  // end of ComputePartition
4144 
4145 /*****************************************************************************/
4181 rsmi_dev_memory_partition_get(uint32_t dv_ind, char *memory_partition,
4182  uint32_t len);
4183 
4215  uint32_t dv_ind, char *memory_partition_caps, uint32_t len);
4216 
4242  rsmi_memory_partition_type_t memory_partition);
4243  // end of memory_partition
4245 
4246 /*****************************************************************************/
4381  rsmi_func_id_iter_handle_t *handle);
4382 
4409  rsmi_func_id_iter_handle_t *var_iter);
4410 
4431 
4445 
4466  rsmi_func_id_value_t *value);
4467  // end of APISupport
4469 
4470 /*****************************************************************************/
4492 
4520 rsmi_event_notification_mask_set(uint32_t dv_ind, uint64_t mask);
4521 
4564  uint32_t *num_elem, rsmi_evt_notification_data_t *data);
4565 
4585  // end of EvntNotif
4587 
4588 
4589 /*****************************************************************************/
4614 
4632 rsmi_dev_metrics_xcd_counter_get(uint32_t dv_ind, uint16_t* xcd_counter_value);
4633 
4646 rsmi_dev_metrics_log_get(uint32_t dv_ind);
4647  // end of DevMetricsHeaderInfoGet
4649 
4650 #ifdef __cplusplus
4651 }
4652 #endif // __cplusplus
4653 #endif // ROCM_SMI_ROCM_SMI_H_
rsmi_status_t rsmi_func_iter_value_get(rsmi_func_id_iter_handle_t handle, rsmi_func_id_value_t *value)
Get the value associated with a function/variant iterator.
rsmi_status_t rsmi_dev_supported_variant_iterator_open(rsmi_func_id_iter_handle_t obj_h, rsmi_func_id_iter_handle_t *var_iter)
Get a variant iterator for a given handle.
rsmi_status_t rsmi_func_iter_next(rsmi_func_id_iter_handle_t handle)
Advance a function identifer iterator.
rsmi_status_t rsmi_dev_supported_func_iterator_close(rsmi_func_id_iter_handle_t *handle)
Close a variant iterator handle.
rsmi_status_t rsmi_dev_supported_func_iterator_open(uint32_t dv_ind, rsmi_func_id_iter_handle_t *handle)
Get a function name iterator of supported RSMI functions for a device.
rsmi_status_t rsmi_dev_partition_id_get(uint32_t dv_ind, uint32_t *partition_id)
Retrieves the partition_id for a desired device.
rsmi_status_t rsmi_dev_compute_partition_set(uint32_t dv_ind, rsmi_compute_partition_type_t compute_partition)
Modifies a selected device's compute partition setting.
rsmi_status_t rsmi_dev_compute_partition_get(uint32_t dv_ind, char *compute_partition, uint32_t len)
Retrieves the current compute partitioning for a desired device.
rsmi_status_t rsmi_dev_ecc_status_get(uint32_t dv_ind, rsmi_gpu_block_t block, rsmi_ras_err_state_t *state)
Retrieve the ECC status for a GPU block.
rsmi_status_t rsmi_dev_ecc_enabled_get(uint32_t dv_ind, uint64_t *enabled_blocks)
Retrieve the enabled ECC bit-mask.
rsmi_status_t rsmi_dev_ecc_count_get(uint32_t dv_ind, rsmi_gpu_block_t block, rsmi_error_count_t *ec)
Retrieve the error counts for a GPU block.
rsmi_status_t rsmi_status_string(rsmi_status_t status, const char **status_string)
Get a description of a provided RSMI error status.
rsmi_status_t rsmi_event_notification_stop(uint32_t dv_ind)
Close any file handles and free any resources used by event notification for a GPU.
rsmi_status_t rsmi_event_notification_get(int timeout_ms, uint32_t *num_elem, rsmi_evt_notification_data_t *data)
Collect event notifications, waiting a specified amount of time.
rsmi_status_t rsmi_event_notification_init(uint32_t dv_ind)
Prepare to collect event notifications for a GPU.
rsmi_status_t rsmi_event_notification_mask_set(uint32_t dv_ind, uint64_t mask)
Specify which events to collect for a device.
rsmi_status_t rsmi_dev_metrics_xcd_counter_get(uint32_t dv_ind, uint16_t *xcd_counter_value)
Get the 'xcd_counter' from the GPU metrics associated with the device.
rsmi_status_t rsmi_dev_metrics_header_info_get(uint32_t dv_ind, metrics_table_header_t *header_value)
Get the 'metrics_header_info' from the GPU metrics associated with the device.
rsmi_status_t rsmi_dev_metrics_log_get(uint32_t dv_ind)
Get the log from the GPU metrics associated with the device.
rsmi_status_t rsmi_topo_get_link_type(uint32_t dv_ind_src, uint32_t dv_ind_dst, uint64_t *hops, RSMI_IO_LINK_TYPE *type)
Retrieve the hops and the connection type between GPU to GPU/CPU.
rsmi_status_t rsmi_topo_get_link_weight(uint32_t dv_ind_src, uint32_t dv_ind_dst, uint64_t *weight)
Retrieve the weight for a connection between 2 GPUs.
rsmi_status_t rsmi_minmax_bandwidth_get(uint32_t dv_ind_src, uint32_t dv_ind_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth)
Retreive minimal and maximal io link bandwidth between 2 GPUs.
rsmi_status_t rsmi_is_P2P_accessible(uint32_t dv_ind_src, uint32_t dv_ind_dst, bool *accessible)
Return P2P availability status between 2 GPUs.
rsmi_status_t rsmi_topo_get_numa_node_number(uint32_t dv_ind, uint32_t *numa_node)
Retrieve the NUMA CPU node number for a device.
rsmi_status_t rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len)
Get the name string of a gpu device.
rsmi_status_t rsmi_dev_unique_id_get(uint32_t dv_ind, uint64_t *id)
Get Unique ID.
rsmi_status_t rsmi_num_monitor_devices(uint32_t *num_devices)
Get the number of devices that have monitor information.
rsmi_status_t rsmi_dev_guid_get(uint32_t dv_ind, uint64_t *guid)
Get the GUID, also known as the GPU device id, associated with the provided device index indicated by...
rsmi_status_t rsmi_dev_vram_vendor_get(uint32_t dv_ind, char *brand, uint32_t len)
Get the vram vendor string of a gpu device.
rsmi_status_t rsmi_dev_sku_get(uint32_t dv_ind, uint16_t *sku)
Get the SKU for a desired device associated with the device with provided device index.
rsmi_status_t rsmi_dev_drm_render_minor_get(uint32_t dv_ind, uint32_t *minor)
Get the drm minor number associated with this device.
rsmi_status_t rsmi_dev_subsystem_id_get(uint32_t dv_ind, uint16_t *id)
Get the subsystem device id associated with the device with provided device index.
rsmi_status_t rsmi_dev_xgmi_physical_id_get(uint32_t dv_ind, uint16_t *id)
Get the XGMI physical id associated with the device.
rsmi_status_t rsmi_dev_serial_number_get(uint32_t dv_ind, char *serial_num, uint32_t len)
Get the serial number string for a device.
rsmi_status_t rsmi_dev_vendor_name_get(uint32_t dv_ind, char *name, size_t len)
Get the name string for a give vendor ID.
rsmi_status_t rsmi_dev_brand_get(uint32_t dv_ind, char *brand, uint32_t len)
Get the brand string of a gpu device.
rsmi_status_t rsmi_dev_id_get(uint32_t dv_ind, uint16_t *id)
Get the device id associated with the device with provided device index.
rsmi_status_t rsmi_dev_subsystem_name_get(uint32_t dv_ind, char *name, size_t len)
Get the name string for the device subsytem.
rsmi_status_t rsmi_dev_node_id_get(uint32_t dv_ind, uint32_t *node_id)
Get the node id associated with the provided device index indicated by KFD.
rsmi_status_t rsmi_dev_revision_get(uint32_t dv_ind, uint16_t *revision)
Get the device revision associated with the device.
rsmi_status_t rsmi_dev_subsystem_vendor_id_get(uint32_t dv_ind, uint16_t *id)
Get the device subsystem vendor id associated with the device with provided device index.
rsmi_status_t rsmi_dev_vendor_id_get(uint32_t dv_ind, uint16_t *id)
Get the device vendor id associated with the device with provided device index.
rsmi_status_t rsmi_init(uint64_t init_flags)
Initialize ROCm SMI.
rsmi_status_t rsmi_shut_down(void)
Shutdown ROCm SMI.
rsmi_status_t rsmi_dev_memory_total_get(uint32_t dv_ind, rsmi_memory_type_t mem_type, uint64_t *total)
Get the total amount of memory that exists.
rsmi_status_t rsmi_dev_memory_usage_get(uint32_t dv_ind, rsmi_memory_type_t mem_type, uint64_t *used)
Get the current memory usage.
rsmi_status_t rsmi_dev_memory_reserved_pages_get(uint32_t dv_ind, uint32_t *num_pages, rsmi_retired_page_record_t *records)
Get information about reserved ("retired") memory pages.
rsmi_status_t rsmi_dev_memory_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent)
Get percentage of time any device memory is being used.
rsmi_status_t rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask)
Control the set of allowed PCIe bandwidths that can be used.
rsmi_status_t rsmi_dev_pci_throughput_get(uint32_t dv_ind, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz)
Get PCIe traffic information.
rsmi_status_t rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth_t *bandwidth)
Get the list of possible PCIe bandwidths that are available.
rsmi_status_t rsmi_topo_numa_affinity_get(uint32_t dv_ind, int32_t *numa_node)
Get the NUMA node associated with a device.
rsmi_status_t rsmi_dev_pci_replay_counter_get(uint32_t dv_ind, uint64_t *counter)
Get PCIe replay counter.
rsmi_status_t rsmi_dev_pci_id_get(uint32_t dv_ind, uint64_t *bdfid)
Get the unique PCI device identifier associated for a device.
rsmi_status_t rsmi_counter_control(rsmi_event_handle_t evt_handle, rsmi_counter_command_t cmd, void *cmd_args)
Issue performance counter control commands.
rsmi_status_t rsmi_counter_read(rsmi_event_handle_t evt_handle, rsmi_counter_value_t *value)
Read the current value of a performance counter.
rsmi_status_t rsmi_counter_available_counters_get(uint32_t dv_ind, rsmi_event_group_t grp, uint32_t *available)
Get the number of currently available counters.
rsmi_status_t rsmi_dev_counter_destroy(rsmi_event_handle_t evnt_handle)
Deallocate a performance counter object.
rsmi_status_t rsmi_dev_counter_create(uint32_t dv_ind, rsmi_event_type_t type, rsmi_event_handle_t *evnt_handle)
Create a performance counter object.
rsmi_status_t rsmi_dev_counter_group_supported(uint32_t dv_ind, rsmi_event_group_t group)
Tell if an event group is supported by a given device.
rsmi_status_t rsmi_dev_overdrive_level_set_v1(uint32_t dv_ind, uint32_t od)
Set the overdrive percent associated with the device with provided device index with the provided val...
rsmi_status_t rsmi_dev_perf_level_set(uint32_t dv_ind, rsmi_dev_perf_level_t perf_lvl)
Set the PowerPlay performance level associated with the device with provided device index with the pr...
rsmi_status_t rsmi_dev_overdrive_level_set(uint32_t dv_ind, uint32_t od)
Set the overdrive percent associated with the device with provided device index with the provided val...
rsmi_status_t rsmi_dev_gpu_clk_freq_set(uint32_t dv_ind, rsmi_clk_type_t clk_type, uint64_t freq_bitmask)
Control the set of allowed frequencies that can be used for the specified clock.
rsmi_status_t rsmi_dev_perf_level_set_v1(uint32_t dv_ind, rsmi_dev_perf_level_t perf_lvl)
Set the PowerPlay performance level associated with the device with provided device index with the pr...
rsmi_status_t rsmi_dev_clk_range_set(uint32_t dv_ind, uint64_t minclkvalue, uint64_t maxclkvalue, rsmi_clk_type_t clkType)
This function sets the clock range information.
rsmi_status_t rsmi_dev_od_volt_curve_regions_get(uint32_t dv_ind, uint32_t *num_regions, rsmi_freq_volt_region_t *buffer)
This function will retrieve the current valid regions in the frequency/voltage space.
rsmi_status_t rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind, rsmi_power_profile_status_t *status)
Get the list of available preset power profiles and an indication of which profile is currently activ...
rsmi_status_t rsmi_dev_od_clk_info_set(uint32_t dv_ind, rsmi_freq_ind_t level, uint64_t clkvalue, rsmi_clk_type_t clkType)
This function sets the clock frequency information.
rsmi_status_t rsmi_dev_perf_level_get(uint32_t dv_ind, rsmi_dev_perf_level_t *perf)
Get the performance level of the device with provided device index.
rsmi_status_t rsmi_dev_gpu_reset(uint32_t dv_ind)
Reset the gpu associated with the device with provided device index.
rsmi_status_t rsmi_dev_activity_metric_get(uint32_t dv_ind, rsmi_activity_metric_t activity_metric_type, rsmi_activity_metric_counter_t *activity_metric_counter)
Get activity metric average utilization counter of the specified device.
rsmi_status_t rsmi_dev_od_volt_info_get(uint32_t dv_ind, rsmi_od_volt_freq_data_t *odv)
This function retrieves the voltage/frequency curve information.
rsmi_status_t rsmi_dev_gpu_metrics_info_get(uint32_t dv_ind, rsmi_gpu_metrics_t *pgpu_metrics)
This function retrieves the gpu metrics information.
rsmi_status_t rsmi_perf_determinism_mode_set(uint32_t dv_ind, uint64_t clkvalue)
Enter performance determinism mode with provided device index.
rsmi_status_t rsmi_utilization_count_get(uint32_t dv_ind, rsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp)
Get coarse grain utilization counter of the specified device.
rsmi_status_t rsmi_dev_clk_extremum_set(uint32_t dv_ind, rsmi_freq_ind_t level, uint64_t clkvalue, rsmi_clk_type_t clkType)
This function sets the clock min/max level.
rsmi_status_t rsmi_dev_od_volt_info_set(uint32_t dv_ind, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue)
This function sets 1 of the 3 voltage curve points.
rsmi_status_t rsmi_dev_overdrive_level_get(uint32_t dv_ind, uint32_t *od)
Get the overdrive percent associated with the device with provided device index.
rsmi_status_t rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, rsmi_clk_type_t clk_type, rsmi_frequencies_t *f)
Get the list of possible system clock speeds of device for a specified clock type.
rsmi_status_t rsmi_dev_activity_avg_mm_get(uint32_t dv_ind, uint16_t *avg_activity)
Get activity metric bandwidth average utilization counter of the specified device.
rsmi_status_t rsmi_dev_mem_overdrive_level_get(uint32_t dv_ind, uint32_t *od)
Get the memory clock overdrive percent associated with the device with provided device index.
rsmi_status_t rsmi_dev_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent)
Get percentage of time device is busy doing any processing.
rsmi_status_t rsmi_dev_fan_speed_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t speed)
Set the fan speed for the specified device with the provided speed, in RPMs.
rsmi_status_t rsmi_dev_fan_reset(uint32_t dv_ind, uint32_t sensor_ind)
Reset the fan to automatic driver control.
rsmi_status_t rsmi_dev_volt_metric_get(uint32_t dv_ind, rsmi_voltage_type_t sensor_type, rsmi_voltage_metric_t metric, int64_t *voltage)
Get the voltage metric value for the specified metric, from the specified voltage sensor on the speci...
rsmi_status_t rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_type, rsmi_temperature_metric_t metric, int64_t *temperature)
Get the temperature metric value for the specified metric, from the specified temperature sensor on t...
rsmi_status_t rsmi_dev_fan_speed_max_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *max_speed)
Get the max. fan speed of the device with provided device index.
rsmi_status_t rsmi_dev_fan_rpms_get(uint32_t dv_ind, uint32_t sensor_ind, int64_t *speed)
Get the fan speed in RPMs of the device with the specified device index and 0-based sensor index.
rsmi_status_t rsmi_dev_fan_speed_get(uint32_t dv_ind, uint32_t sensor_ind, int64_t *speed)
Get the fan speed for the specified device as a value relative to RSMI_MAX_FAN_SPEED.
rsmi_status_t rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap)
Set the power cap value.
rsmi_status_t rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t reserved, rsmi_power_profile_preset_masks_t profile)
Set the power profile.
rsmi_status_t rsmi_dev_energy_count_get(uint32_t dv_ind, uint64_t *power, float *counter_resolution, uint64_t *timestamp)
Get the energy accumulator counter of the device with provided device index.
rsmi_status_t rsmi_dev_power_cap_default_get(uint32_t dv_ind, uint64_t *default_cap)
Get the default power cap for the device specified by dv_ind.
rsmi_status_t rsmi_dev_power_ave_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *power)
Get the average power consumption of the device with provided device index.
rsmi_status_t rsmi_dev_power_get(uint32_t dv_ind, uint64_t *power, RSMI_POWER_TYPE *type)
A generic get which attempts to retieve current socket power (also known as instant power) of the dev...
rsmi_status_t rsmi_dev_power_cap_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *cap)
Get the cap on power which, when reached, causes the system to take action to reduce power.
rsmi_status_t rsmi_dev_power_cap_range_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *max, uint64_t *min)
Get the range of valid values for the power cap.
rsmi_status_t rsmi_dev_current_socket_power_get(uint32_t dv_ind, uint64_t *socket_power)
Get the current socket power (also known as instant power) of the device index provided.
rsmi_status_t rsmi_compute_process_info_by_device_get(uint32_t pid, uint32_t dv_ind, rsmi_process_info_t *proc)
Get the info of a process on a specific device.
rsmi_status_t rsmi_compute_process_gpus_get(uint32_t pid, uint32_t *dv_indices, uint32_t *num_devices)
Get the device indices currently being used by a process.
rsmi_status_t rsmi_compute_process_info_by_pid_get(uint32_t pid, rsmi_process_info_t *proc)
Get process information about a specific process.
rsmi_status_t rsmi_compute_process_info_get(rsmi_process_info_t *procs, uint32_t *num_items)
Get process information about processes currently using GPU.
rsmi_status_t rsmi_version_get(rsmi_version_t *version)
Get the build version information for the currently running build of RSMI.
rsmi_status_t rsmi_dev_vbios_version_get(uint32_t dv_ind, char *vbios, uint32_t len)
Get the VBIOS identifer string.
rsmi_status_t rsmi_dev_firmware_version_get(uint32_t dv_ind, rsmi_fw_block_t block, uint64_t *fw_version)
Get the firmware versions for a device.
rsmi_status_t rsmi_version_str_get(rsmi_sw_component_t component, char *ver_str, uint32_t len)
Get the driver version string for the current system.
rsmi_status_t rsmi_dev_target_graphics_version_get(uint32_t dv_ind, uint64_t *gfx_version)
Get the target graphics version for a GPU device.
rsmi_status_t rsmi_dev_xgmi_error_status(uint32_t dv_ind, rsmi_xgmi_status_t *status)
Retrieve the XGMI error status for a device.
rsmi_status_t rsmi_dev_xgmi_error_reset(uint32_t dv_ind)
Reset the XGMI error status for a device.
rsmi_status_t rsmi_dev_xgmi_hive_id_get(uint32_t dv_ind, uint64_t *hive_id)
Retrieve the XGMI hive id for a device.
rsmi_status_t rsmi_dev_memory_partition_get(uint32_t dv_ind, char *memory_partition, uint32_t len)
Retrieves the current memory partition for a desired device.
rsmi_status_t rsmi_dev_memory_partition_set(uint32_t dv_ind, rsmi_memory_partition_type_t memory_partition)
Modifies a selected device's current memory partition setting.
rsmi_status_t rsmi_dev_memory_partition_capabilities_get(uint32_t dv_ind, char *memory_partition_caps, uint32_t len)
Retrieves the available memory partition capabilities for a desired device.
rsmi_activity_metric_t
Activity (Utilization) Metrics. This enum is used to identify various activity metrics.
Definition: rocm_smi.h:479
@ RSMI_ACTIVITY_UMC
memory controller
Definition: rocm_smi.h:482
@ RSMI_ACTIVITY_MM
UVD or VCN.
Definition: rocm_smi.h:483
struct rsmi_func_id_iter_handle * rsmi_func_id_iter_handle_t
Opaque handle to function-support object.
Definition: rocm_smi.h:1228
rsmi_memory_page_status_t
Reserved Memory Page States.
Definition: rocm_smi.h:673
@ RSMI_MEM_PAGE_STATUS_UNRESERVABLE
Unable to reserve this page.
Definition: rocm_smi.h:679
@ RSMI_MEM_PAGE_STATUS_PENDING
Definition: rocm_smi.h:676
@ RSMI_MEM_PAGE_STATUS_RESERVED
Definition: rocm_smi.h:674
rsmi_status_t
Error codes retured by rocm_smi_lib functions.
Definition: rocm_smi.h:87
@ RSMI_STATUS_UNEXPECTED_DATA
Definition: rocm_smi.h:124
@ RSMI_STATUS_REFCOUNT_OVERFLOW
Definition: rocm_smi.h:129
@ RSMI_STATUS_NOT_FOUND
Definition: rocm_smi.h:114
@ RSMI_STATUS_UNKNOWN_ERROR
An unknown error occurred.
Definition: rocm_smi.h:136
@ RSMI_STATUS_INIT_ERROR
Definition: rocm_smi.h:106
@ RSMI_STATUS_SETTING_UNAVAILABLE
Definition: rocm_smi.h:131
@ RSMI_STATUS_INSUFFICIENT_SIZE
Definition: rocm_smi.h:116
@ RSMI_STATUS_INVALID_ARGS
Passed in arguments are not valid.
Definition: rocm_smi.h:89
@ RSMI_STATUS_NOT_SUPPORTED
Definition: rocm_smi.h:90
@ RSMI_STATUS_NO_DATA
Definition: rocm_smi.h:122
@ RSMI_STATUS_UNEXPECTED_SIZE
Definition: rocm_smi.h:120
@ RSMI_STATUS_AMDGPU_RESTART_ERR
Definition: rocm_smi.h:133
@ RSMI_STATUS_FILE_ERROR
Definition: rocm_smi.h:93
@ RSMI_STATUS_BUSY
Definition: rocm_smi.h:126
@ RSMI_STATUS_NOT_YET_IMPLEMENTED
Definition: rocm_smi.h:110
@ RSMI_STATUS_OUT_OF_RESOURCES
Definition: rocm_smi.h:101
@ RSMI_STATUS_INTERRUPT
Definition: rocm_smi.h:118
@ RSMI_STATUS_INTERNAL_EXCEPTION
An internal exception was caught.
Definition: rocm_smi.h:103
@ RSMI_STATUS_SUCCESS
Operation was successful.
Definition: rocm_smi.h:88
@ RSMI_STATUS_INPUT_OUT_OF_BOUNDS
Definition: rocm_smi.h:104
@ RSMI_STATUS_PERMISSION
Definition: rocm_smi.h:98
RSMI_UTILIZATION_COUNTER_TYPE
The utilization counter type.
Definition: rocm_smi.h:700
@ RSMI_COARSE_GRAIN_MEM_ACTIVITY
Memory Activity.
Definition: rocm_smi.h:704
@ RSMI_UTILIZATION_COUNTER_FIRST
GFX Activity.
Definition: rocm_smi.h:701
_RSMI_IO_LINK_TYPE
Types for IO Link.
Definition: rocm_smi.h:685
@ RSMI_IOLINK_TYPE_XGMI
XGMI.
Definition: rocm_smi.h:688
@ RSMI_IOLINK_TYPE_UNDEFINED
unknown type.
Definition: rocm_smi.h:686
@ RSMI_IOLINK_TYPE_PCIEXPRESS
PCI Express.
Definition: rocm_smi.h:687
@ RSMI_IOLINK_TYPE_SIZE
Max of IO Link types.
Definition: rocm_smi.h:690
@ RSMI_IOLINK_TYPE_NUMIOLINKTYPES
Number of IO Link types.
Definition: rocm_smi.h:689
rsmi_sw_component_t
Available clock types.
Definition: rocm_smi.h:192
@ RSMI_SW_COMP_DRIVER
Driver.
Definition: rocm_smi.h:195
rsmi_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: rocm_smi.h:215
@ RSMI_EVNT_GRP_XGMI
Data Fabric (XGMI) related events.
Definition: rocm_smi.h:216
@ RSMI_EVNT_GRP_XGMI_DATA_OUT
XGMI Outbound data.
Definition: rocm_smi.h:217
#define MAX_EVENT_NOTIFICATION_MSG_SIZE
Maximum number of characters an event notification message will be.
Definition: rocm_smi.h:331
#define RSMI_MAX_NUM_CLKS
This should match kRSMI_MAX_NUM_CLKS.
Definition: rocm_smi.h:951
#define RSMI_MAX_NUM_JPEG_ENGS
This should match kRSMI_MAX_JPEG_ENGINES.
Definition: rocm_smi.h:946
rsmi_dev_perf_level_t
PowerPlay performance levels.
Definition: rocm_smi.h:159
@ RSMI_DEV_PERF_LEVEL_LOW
Definition: rocm_smi.h:163
@ RSMI_DEV_PERF_LEVEL_MANUAL
Definition: rocm_smi.h:167
@ RSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK
Definition: rocm_smi.h:172
@ RSMI_DEV_PERF_LEVEL_UNKNOWN
Unknown performance level.
Definition: rocm_smi.h:180
@ RSMI_DEV_PERF_LEVEL_DETERMINISM
Performance determinism state.
Definition: rocm_smi.h:176
@ RSMI_DEV_PERF_LEVEL_HIGH
Definition: rocm_smi.h:165
@ RSMI_DEV_PERF_LEVEL_STABLE_STD
Definition: rocm_smi.h:169
@ RSMI_DEV_PERF_LEVEL_STABLE_PEAK
Stable power state with peak clocks.
Definition: rocm_smi.h:171
@ RSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK
Definition: rocm_smi.h:174
@ RSMI_DEV_PERF_LEVEL_AUTO
Performance level is "auto".
Definition: rocm_smi.h:160
rsmi_voltage_metric_t
Voltage Metrics. This enum is used to identify various Volatge metrics. Corresponding values will be ...
Definition: rocm_smi.h:492
@ RSMI_VOLT_LOWEST
Historical minimum voltage.
Definition: rocm_smi.h:501
@ RSMI_VOLT_MIN_CRIT
Voltage critical min value.
Definition: rocm_smi.h:497
@ RSMI_VOLT_MAX_CRIT
Voltage critical max value.
Definition: rocm_smi.h:499
@ RSMI_VOLT_CURRENT
Voltage current value.
Definition: rocm_smi.h:493
@ RSMI_VOLT_MIN
Voltage min value.
Definition: rocm_smi.h:498
@ RSMI_VOLT_AVERAGE
Average voltage.
Definition: rocm_smi.h:500
@ RSMI_VOLT_MAX
Voltage max value.
Definition: rocm_smi.h:496
@ RSMI_VOLT_HIGHEST
Historical maximum voltage.
Definition: rocm_smi.h:502
rsmi_evt_notification_type_t
Definition: rocm_smi.h:313
@ RSMI_EVT_NOTIF_VMFAULT
VM page fault.
Definition: rocm_smi.h:315
@ RSMI_EVT_NOTIF_NONE
Unused.
Definition: rocm_smi.h:314
#define RSMI_NUM_VOLTAGE_CURVE_POINTS
The number of points that make up a voltage-frequency curve definition.
Definition: rocm_smi.h:81
#define RSMI_MAX_NUM_GFX_CLKS
This should match kRSMI_MAX_NUM_GFX_CLKS.
Definition: rocm_smi.h:961
rsmi_xgmi_status_t
XGMI Status.
Definition: rocm_smi.h:656
rsmi_compute_partition_type_t
Compute Partition. This enum is used to identify various compute partitioning settings.
Definition: rocm_smi.h:368
@ RSMI_COMPUTE_PARTITION_SPX
Definition: rocm_smi.h:370
@ RSMI_COMPUTE_PARTITION_DPX
Definition: rocm_smi.h:372
@ RSMI_COMPUTE_PARTITION_QPX
Definition: rocm_smi.h:376
@ RSMI_COMPUTE_PARTITION_TPX
Definition: rocm_smi.h:374
@ RSMI_COMPUTE_PARTITION_CPX
Definition: rocm_smi.h:378
rsmi_voltage_type_t
This ennumeration is used to indicate which type of voltage reading should be obtained.
Definition: rocm_smi.h:511
@ RSMI_VOLT_TYPE_VDDGFX
Definition: rocm_smi.h:514
@ RSMI_VOLT_TYPE_INVALID
Invalid type.
Definition: rocm_smi.h:517
rsmi_temperature_metric_t
Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values ...
Definition: rocm_smi.h:414
@ RSMI_TEMP_CURRENT
Temperature current value.
Definition: rocm_smi.h:415
@ RSMI_TEMP_LOWEST
Historical minimum temperature.
Definition: rocm_smi.h:446
@ RSMI_TEMP_CRIT_MIN
Definition: rocm_smi.h:438
@ RSMI_TEMP_CRIT_MIN_HYST
Definition: rocm_smi.h:441
@ RSMI_TEMP_MIN
Temperature min value.
Definition: rocm_smi.h:419
@ RSMI_TEMP_MAX
Temperature max value.
Definition: rocm_smi.h:418
@ RSMI_TEMP_EMERGENCY
Definition: rocm_smi.h:431
@ RSMI_TEMP_MAX_HYST
Definition: rocm_smi.h:420
@ RSMI_TEMP_MIN_HYST
Definition: rocm_smi.h:423
@ RSMI_TEMP_CRITICAL_HYST
Definition: rocm_smi.h:428
@ RSMI_TEMP_EMERGENCY_HYST
Definition: rocm_smi.h:435
@ RSMI_TEMP_HIGHEST
Historical maximum temperature.
Definition: rocm_smi.h:447
@ RSMI_TEMP_CRITICAL
Definition: rocm_smi.h:426
@ RSMI_TEMP_OFFSET
Definition: rocm_smi.h:444
rsmi_ras_err_state_t
The current ECC state.
Definition: rocm_smi.h:579
@ RSMI_RAS_ERR_STATE_MULT_UC
Multiple uncorrectable errors.
Definition: rocm_smi.h:584
@ RSMI_RAS_ERR_STATE_POISON
Definition: rocm_smi.h:585
@ RSMI_RAS_ERR_STATE_DISABLED
ECC is disabled.
Definition: rocm_smi.h:581
@ RSMI_RAS_ERR_STATE_PARITY
ECC errors present, but type unknown.
Definition: rocm_smi.h:582
@ RSMI_RAS_ERR_STATE_SING_C
Single correctable error.
Definition: rocm_smi.h:583
@ RSMI_RAS_ERR_STATE_ENABLED
ECC is enabled.
Definition: rocm_smi.h:587
@ RSMI_RAS_ERR_STATE_NONE
No current errors.
Definition: rocm_smi.h:580
#define RSMI_NUM_HBM_INSTANCES
This should match kRSMI_MAX_NUM_HBM_INSTANCES.
Definition: rocm_smi.h:936
#define RSMI_MAX_NUM_XCC
This should match kRSMI_MAX_NUM_XCC; XCC - Accelerated Compute Core, the collection of compute units,...
Definition: rocm_smi.h:972
rsmi_event_type_t
Event type enum. Events belonging to a particular event group rsmi_event_group_t should begin enumera...
Definition: rocm_smi.h:227
@ RSMI_EVNT_XGMI_1_RESPONSE_TX
Definition: rocm_smi.h:254
@ RSMI_EVNT_XGMI_DATA_OUT_5
Outbound beats to neighbor 5.
Definition: rocm_smi.h:284
@ RSMI_EVNT_XGMI_1_BEATS_TX
Definition: rocm_smi.h:256
@ RSMI_EVNT_XGMI_1_NOP_TX
NOPs sent to neighbor 1.
Definition: rocm_smi.h:251
@ RSMI_EVNT_XGMI_0_NOP_TX
NOPs sent to neighbor 0.
Definition: rocm_smi.h:231
@ RSMI_EVNT_XGMI_1_REQUEST_TX
neighbor 1
Definition: rocm_smi.h:252
@ RSMI_EVNT_XGMI_DATA_OUT_3
Outbound beats to neighbor 3.
Definition: rocm_smi.h:282
@ RSMI_EVNT_XGMI_DATA_OUT_4
Outbound beats to neighbor 4.
Definition: rocm_smi.h:283
@ RSMI_EVNT_XGMI_DATA_OUT_2
Outbound beats to neighbor 2.
Definition: rocm_smi.h:281
@ RSMI_EVNT_XGMI_0_RESPONSE_TX
Definition: rocm_smi.h:234
@ RSMI_EVNT_XGMI_DATA_OUT_1
Outbound beats to neighbor 1.
Definition: rocm_smi.h:280
@ RSMI_EVNT_XGMI_0_BEATS_TX
Data beats sent to neighbor 0; Each beat represents 32 bytes.
Definition: rocm_smi.h:250
@ RSMI_EVNT_XGMI_0_REQUEST_TX
Definition: rocm_smi.h:232
rsmi_freq_ind_t
The values of this enum are used as frequency identifiers.
Definition: rocm_smi.h:609
@ RSMI_FREQ_IND_MAX
Index used for the maximum frequency value.
Definition: rocm_smi.h:611
@ RSMI_FREQ_IND_MIN
Index used for the minimum frequency value.
Definition: rocm_smi.h:610
@ RSMI_FREQ_IND_INVALID
An invalid frequency index.
Definition: rocm_smi.h:612
rsmi_memory_type_t
Types of memory.
Definition: rocm_smi.h:596
@ RSMI_MEM_TYPE_VRAM
VRAM memory.
Definition: rocm_smi.h:599
@ RSMI_MEM_TYPE_GTT
GTT memory.
Definition: rocm_smi.h:601
@ RSMI_MEM_TYPE_VIS_VRAM
VRAM memory that is visible.
Definition: rocm_smi.h:600
rsmi_power_profile_preset_masks_t
Pre-set Profile Selections. These bitmasks can be AND'd with the rsmi_power_profile_status_t....
Definition: rocm_smi.h:526
@ RSMI_PWR_PROF_PRST_LAST
Invalid power profile.
Definition: rocm_smi.h:536
@ RSMI_PWR_PROF_PRST_VIDEO_MASK
Video Power Profile.
Definition: rocm_smi.h:528
@ RSMI_PWR_PROF_PRST_VR_MASK
VR Power Profile.
Definition: rocm_smi.h:531
@ RSMI_PWR_PROF_PRST_CUSTOM_MASK
Custom Power Profile.
Definition: rocm_smi.h:527
@ RSMI_PWR_PROF_PRST_POWER_SAVING_MASK
Power Saving Profile.
Definition: rocm_smi.h:529
@ RSMI_PWR_PROF_PRST_COMPUTE_MASK
Compute Saving Profile.
Definition: rocm_smi.h:530
@ RSMI_PWR_PROF_PRST_BOOTUP_DEFAULT
Default Boot Up Profile.
Definition: rocm_smi.h:535
rsmi_gpu_block_t
This enum is used to identify different GPU blocks.
Definition: rocm_smi.h:548
@ RSMI_GPU_BLOCK_SMN
SMN block.
Definition: rocm_smi.h:562
@ RSMI_GPU_BLOCK_ATHUB
ATHUB block.
Definition: rocm_smi.h:557
@ RSMI_GPU_BLOCK_GFX
GFX block.
Definition: rocm_smi.h:555
@ RSMI_GPU_BLOCK_MMHUB
MMHUB block.
Definition: rocm_smi.h:556
@ RSMI_GPU_BLOCK_FUSE
Fuse block.
Definition: rocm_smi.h:566
@ RSMI_GPU_BLOCK_HDP
HDP block.
Definition: rocm_smi.h:559
@ RSMI_GPU_BLOCK_DF
DF block.
Definition: rocm_smi.h:561
@ RSMI_GPU_BLOCK_SEM
SEM block.
Definition: rocm_smi.h:563
@ RSMI_GPU_BLOCK_INVALID
Definition: rocm_smi.h:549
@ RSMI_GPU_BLOCK_MP1
MP1 block.
Definition: rocm_smi.h:565
@ RSMI_GPU_BLOCK_XGMI_WAFL
XGMI block.
Definition: rocm_smi.h:560
@ RSMI_GPU_BLOCK_UMC
UMC block.
Definition: rocm_smi.h:553
@ RSMI_GPU_BLOCK_LAST
for supported blocks
Definition: rocm_smi.h:568
@ RSMI_GPU_BLOCK_PCIE_BIF
PCIE_BIF block.
Definition: rocm_smi.h:558
@ RSMI_GPU_BLOCK_MP0
MP0 block.
Definition: rocm_smi.h:564
@ RSMI_GPU_BLOCK_SDMA
SDMA block.
Definition: rocm_smi.h:554
#define RSMI_MAX_NUM_VCNS
This should match kRSMI_MAX_NUM_VCNS.
Definition: rocm_smi.h:941
rsmi_fw_block_t
The values of this enum are used to identify the various firmware blocks.
Definition: rocm_smi.h:623
rsmi_init_flags_t
Initialization flags.
Definition: rocm_smi.h:145
@ RSMI_INIT_FLAG_RESRV_TEST1
Reserved for test.
Definition: rocm_smi.h:153
@ RSMI_INIT_FLAG_THRAD_ONLY_MUTEX
The mutex limit to thread.
Definition: rocm_smi.h:152
@ RSMI_INIT_FLAG_ALL_GPUS
Definition: rocm_smi.h:146
enum _RSMI_IO_LINK_TYPE RSMI_IO_LINK_TYPE
Types for IO Link.
#define RSMI_MAX_NUM_FREQUENCIES
Definition: rocm_smi.h:74
#define RSMI_MAX_NUM_XGMI_LINKS
This should match kRSMI_MAX_NUM_XGMI_LINKS.
Definition: rocm_smi.h:956
uintptr_t rsmi_event_handle_t
Handle to performance event counter.
Definition: rocm_smi.h:207
rsmi_counter_command_t
Definition: rocm_smi.h:293
@ RSMI_CNTR_CMD_START
Start the counter.
Definition: rocm_smi.h:294
@ RSMI_CNTR_CMD_STOP
Definition: rocm_smi.h:295
uint64_t rsmi_bit_field_t
Bitfield used in various RSMI calls.
Definition: rocm_smi.h:665
#define RSMI_MAX_NUM_XCP
This should match kRSMI_MAX_NUM_XCP; XCP - Accelerated Compute Processor, also referred to as the Gra...
Definition: rocm_smi.h:984
rsmi_clk_type_t
Definition: rocm_smi.h:345
@ RSMI_CLK_TYPE_MEM
Memory clock.
Definition: rocm_smi.h:352
@ RSMI_CLK_TYPE_DCEF
Display Controller Engine clock.
Definition: rocm_smi.h:350
@ RSMI_CLK_TYPE_PCIE
PCIE clock.
Definition: rocm_smi.h:353
@ RSMI_CLK_TYPE_SOC
SOC clock.
Definition: rocm_smi.h:351
@ RSMI_CLK_TYPE_DF
Definition: rocm_smi.h:348
@ RSMI_CLK_TYPE_SYS
System clock.
Definition: rocm_smi.h:346
rsmi_memory_partition_type_t
Memory Partitions. This enum is used to identify various memory partition types.
Definition: rocm_smi.h:389
@ RSMI_MEMORY_PARTITION_NPS8
Definition: rocm_smi.h:399
@ RSMI_MEMORY_PARTITION_NPS4
Definition: rocm_smi.h:396
@ RSMI_MEMORY_PARTITION_NPS2
Definition: rocm_smi.h:393
@ RSMI_MEMORY_PARTITION_NPS1
Definition: rocm_smi.h:391
union id rsmi_func_id_value_t
This union holds the value of an rsmi_func_id_iter_handle_t. The value may be a function name,...
RSMI_POWER_TYPE
Power types.
Definition: rocm_smi.h:711
@ RSMI_AVERAGE_POWER
Average Power.
Definition: rocm_smi.h:712
@ RSMI_INVALID_POWER
Invalid / Undetected Power.
Definition: rocm_smi.h:714
@ RSMI_CURRENT_POWER
Current / Instant Power.
Definition: rocm_smi.h:713
rsmi_temperature_type_t
This enumeration is used to indicate from which part of the device a temperature reading should be ob...
Definition: rocm_smi.h:459
@ RSMI_TEMP_TYPE_HBM_2
HBM temperature instance 2.
Definition: rocm_smi.h:468
@ RSMI_TEMP_TYPE_HBM_0
HBM temperature instance 0.
Definition: rocm_smi.h:466
@ RSMI_TEMP_TYPE_HBM_1
HBM temperature instance 1.
Definition: rocm_smi.h:467
@ RSMI_TEMP_TYPE_MEMORY
VRAM temperature.
Definition: rocm_smi.h:465
@ RSMI_TEMP_TYPE_INVALID
Invalid type.
Definition: rocm_smi.h:471
@ RSMI_TEMP_TYPE_EDGE
Edge GPU temperature.
Definition: rocm_smi.h:462
@ RSMI_TEMP_TYPE_JUNCTION
Definition: rocm_smi.h:463
@ RSMI_TEMP_TYPE_HBM_3
HBM temperature instance 3.
Definition: rocm_smi.h:469
The following structures hold the gpu statistics for a device.
Definition: rocm_smi.h:989
The following structures hold the gpu metrics values for a device.
Definition: rocm_smi.h:915
This structure holds information about the possible activity averages. Specifically,...
Definition: rocm_smi.h:819
uint16_t average_mm_activity
UVD or VCN.
Definition: rocm_smi.h:823
uint16_t average_gfx_activity
Average graphics activity.
Definition: rocm_smi.h:821
uint16_t average_umc_activity
memory controller
Definition: rocm_smi.h:822
Definition: rocm_smi.h:302
uint64_t value
Counter value.
Definition: rocm_smi.h:303
uint64_t time_enabled
Definition: rocm_smi.h:304
uint64_t time_running
Definition: rocm_smi.h:306
This structure holds error counts.
Definition: rocm_smi.h:1206
uint64_t correctable_err
Accumulated correctable errors.
Definition: rocm_smi.h:1207
uint64_t uncorrectable_err
Accumulated uncorrectable errors.
Definition: rocm_smi.h:1208
Definition: rocm_smi.h:336
rsmi_evt_notification_type_t event
Event type.
Definition: rocm_smi.h:338
uint32_t dv_ind
Index of device that corresponds to the event.
Definition: rocm_smi.h:337
This structure holds 2 rsmi_range_t's, one for frequency and one for voltage. These 2 ranges indicate...
Definition: rocm_smi.h:865
rsmi_range_t volt_range
The voltage range for this VDDC Curve point.
Definition: rocm_smi.h:867
rsmi_range_t freq_range
The frequency range for this VDDC Curve point.
Definition: rocm_smi.h:866
This structure holds information about clock frequencies.
Definition: rocm_smi.h:767
uint32_t current
Definition: rocm_smi.h:781
uint32_t num_supported
Definition: rocm_smi.h:776
bool has_deep_sleep
Definition: rocm_smi.h:771
Definition: rocm_smi.h:999
This structure represents a point on the frequency-voltage plane.
Definition: rocm_smi.h:852
uint64_t frequency
Frequency coordinate (in Hz)
Definition: rocm_smi.h:853
uint64_t voltage
Voltage coordinate (in mV)
Definition: rocm_smi.h:854
Definition: rocm_smi.h:876
This structure holds the frequency-voltage values for a device.
Definition: rocm_smi.h:890
rsmi_range_t mclk_freq_limits
The range possible of MCLK values.
Definition: rocm_smi.h:895
uint32_t num_regions
The number of voltage curve regions.
Definition: rocm_smi.h:901
rsmi_range_t curr_mclk_range
Definition: rocm_smi.h:892
rsmi_range_t sclk_freq_limits
The range possible of SCLK values.
Definition: rocm_smi.h:894
rsmi_range_t curr_sclk_range
The current SCLK frequency range.
Definition: rocm_smi.h:891
rsmi_od_volt_curve_t curve
The current voltage curve.
Definition: rocm_smi.h:900
This structure holds information about the possible PCIe bandwidths. Specifically,...
Definition: rocm_smi.h:798
rsmi_frequencies_t transfer_rate
Definition: rocm_smi.h:802
This structure contains information about which power profiles are supported by the system for a give...
Definition: rocm_smi.h:744
uint32_t num_profiles
Definition: rocm_smi.h:758
rsmi_bit_field_t available_profiles
Definition: rocm_smi.h:748
rsmi_power_profile_preset_masks_t current
Definition: rocm_smi.h:753
This structure contains information specific to a process.
Definition: rocm_smi.h:1214
uint32_t cu_occupancy
Compute Unit usage in percent.
Definition: rocm_smi.h:1219
uint32_t pasid
PASID.
Definition: rocm_smi.h:1216
uint32_t process_id
Process ID.
Definition: rocm_smi.h:1215
uint64_t sdma_usage
SDMA usage in microseconds.
Definition: rocm_smi.h:1218
uint64_t vram_usage
VRAM usage.
Definition: rocm_smi.h:1217
This structure represents a range (e.g., frequencies or voltages).
Definition: rocm_smi.h:841
uint64_t upper_bound
Upper bound of range.
Definition: rocm_smi.h:843
uint64_t lower_bound
Lower bound of range.
Definition: rocm_smi.h:842
Reserved Memory Page Record.
Definition: rocm_smi.h:728
uint64_t page_size
Page size.
Definition: rocm_smi.h:730
rsmi_memory_page_status_t status
Page "reserved" status.
Definition: rocm_smi.h:731
uint64_t page_address
Start address of page.
Definition: rocm_smi.h:729
The utilization counter data.
Definition: rocm_smi.h:720
RSMI_UTILIZATION_COUNTER_TYPE type
Utilization counter type.
Definition: rocm_smi.h:721
uint64_t value
Utilization counter value.
Definition: rocm_smi.h:722
This structure holds version information.
Definition: rocm_smi.h:829
uint32_t patch
Patch, build or stepping version.
Definition: rocm_smi.h:832
const char * build
Build string.
Definition: rocm_smi.h:833
uint32_t minor
Minor version.
Definition: rocm_smi.h:831
uint32_t major
Major version.
Definition: rocm_smi.h:830
This union holds the value of an rsmi_func_id_iter_handle_t. The value may be a function name,...
Definition: rocm_smi.h:1239
rsmi_temperature_metric_t temp_metric
Used for rsmi_event_type_t variants.
Definition: rocm_smi.h:1246
rsmi_memory_type_t memory_type
< Used for rsmi_memory_type_t variants
Definition: rocm_smi.h:1244
rsmi_event_group_t evnt_group
Used for rsmi_clk_type_t variants.
Definition: rocm_smi.h:1250
rsmi_clk_type_t clk_type
Used for rsmi_fw_block_t variants.
Definition: rocm_smi.h:1252
uint64_t id
uint64_t representation of value
Definition: rocm_smi.h:1240
rsmi_event_type_t evnt_type
Used for rsmi_event_group_t variants.
Definition: rocm_smi.h:1248
rsmi_fw_block_t fw_block
Used for rsmi_gpu_block_t variants.
Definition: rocm_smi.h:1254
const char * name
name string (applicable to functions only)
Definition: rocm_smi.h:1241