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 INCLUDE_ROCM_SMI_ROCM_SMI_H_
44 #define INCLUDE_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 
73 #define RSMI_MAX_NUM_FREQUENCIES 32
74 
77 #define RSMI_MAX_FAN_SPEED 255
78 
80 #define RSMI_NUM_VOLTAGE_CURVE_POINTS 3
81 
85 typedef enum {
107  RSMI_INITIALIZATION_ERROR = RSMI_STATUS_INIT_ERROR,
133 
135 } rsmi_status_t;
136 
143 typedef enum {
150  RSMI_INIT_FLAG_RESRV_TEST1 = 0x800000000000000,
152 
156 typedef enum {
158  RSMI_DEV_PERF_LEVEL_FIRST = RSMI_DEV_PERF_LEVEL_AUTO,
159 
174 
175  RSMI_DEV_PERF_LEVEL_LAST = RSMI_DEV_PERF_LEVEL_DETERMINISM,
176 
180 typedef rsmi_dev_perf_level_t rsmi_dev_perf_level;
182 
189 typedef enum {
190  RSMI_SW_COMP_FIRST = 0x0,
191 
192  RSMI_SW_COMP_DRIVER = RSMI_SW_COMP_FIRST,
193 
194  RSMI_SW_COMP_LAST = RSMI_SW_COMP_DRIVER
196 
204 typedef uintptr_t rsmi_event_handle_t;
205 
212 typedef enum {
215  RSMI_EVNT_GRP_INVALID = 0xFFFFFFFF
217 
224 typedef enum {
225  RSMI_EVNT_FIRST = RSMI_EVNT_GRP_XGMI,
226 
227  RSMI_EVNT_XGMI_FIRST = RSMI_EVNT_GRP_XGMI,
228  RSMI_EVNT_XGMI_0_NOP_TX = RSMI_EVNT_XGMI_FIRST,
233 
246  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
256 
257  RSMI_EVNT_XGMI_LAST = RSMI_EVNT_XGMI_1_BEATS_TX, // 5
258 
259  RSMI_EVNT_XGMI_DATA_OUT_FIRST = RSMI_EVNT_GRP_XGMI_DATA_OUT, // 10
260 
261  /*
262  * @brief Events in the RSMI_EVNT_GRP_XGMI_DATA_OUT group measure
263  * the number of beats sent on an XGMI link. Each beat represents
264  * 32 bytes. RSMI_EVNT_XGMI_DATA_OUT_n represents the number of
265  * outbound beats (each representing 32 bytes) on link n.<br><br>
266  *
267  * XGMI throughput can be calculated by multiplying a event
268  * such as ::RSMI_EVNT_XGMI_DATA_OUT_n by 32 and dividing by
269  * the time for which event collection occurred,
270  * ::rsmi_counter_value_t.time_running (which is in nanoseconds). To get
271  * bytes per second, multiply this value by 10<sup>9</sup>.<br>
272  * <br>
273  * Throughput = BEATS/time_running * 10<sup>9</sup> (bytes/second)<br>
274  */
275  // ie, Throughput = BEATS/time_running 10^9 bytes/sec
276  RSMI_EVNT_XGMI_DATA_OUT_0 = RSMI_EVNT_XGMI_DATA_OUT_FIRST,
282  RSMI_EVNT_XGMI_DATA_OUT_LAST = RSMI_EVNT_XGMI_DATA_OUT_5,
283 
284  RSMI_EVNT_LAST = RSMI_EVNT_XGMI_DATA_OUT_LAST,
286 
290 typedef enum {
295 
299 typedef struct {
300  uint64_t value;
301  uint64_t time_enabled;
303  uint64_t time_running;
306 
310 typedef enum {
311  RSMI_EVT_NOTIF_VMFAULT = KFD_SMI_EVENT_VMFAULT,
312  RSMI_EVT_NOTIF_FIRST = RSMI_EVT_NOTIF_VMFAULT,
313  RSMI_EVT_NOTIF_THERMAL_THROTTLE = KFD_SMI_EVENT_THERMAL_THROTTLE,
314  RSMI_EVT_NOTIF_GPU_PRE_RESET = KFD_SMI_EVENT_GPU_PRE_RESET,
315  RSMI_EVT_NOTIF_GPU_POST_RESET = KFD_SMI_EVENT_GPU_POST_RESET,
316 
317  RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_GPU_POST_RESET
319 
323 #define RSMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
324 
326 #define MAX_EVENT_NOTIFICATION_MSG_SIZE 64
327 
331 typedef struct {
332  uint32_t dv_ind;
336 
340 typedef enum {
342  RSMI_CLK_TYPE_FIRST = RSMI_CLK_TYPE_SYS,
349 
350  // Add new clocks to the end (not in the middle) and update
351  // RSMI_CLK_TYPE_LAST
352  RSMI_CLK_TYPE_LAST = RSMI_CLK_TYPE_MEM,
353  RSMI_CLK_INVALID = 0xFFFFFFFF
356 typedef rsmi_clk_type_t rsmi_clk_type;
358 
363 typedef enum {
364  RSMI_COMPUTE_PARTITION_INVALID = 0,
377 typedef rsmi_compute_partition_type_t rsmi_compute_partition_type;
379 
384 typedef enum {
385  RSMI_MEMORY_PARTITION_UNKNOWN = 0,
401 typedef rsmi_nps_mode_type_t rsmi_nps_mode_type;
403 
409 typedef enum {
411  RSMI_TEMP_FIRST = RSMI_TEMP_CURRENT,
412 
443 
444  RSMI_TEMP_LAST = RSMI_TEMP_HIGHEST
447 typedef rsmi_temperature_metric_t rsmi_temperature_metric;
449 
454 typedef enum {
455  RSMI_TEMP_TYPE_FIRST = 0,
456 
457  RSMI_TEMP_TYPE_EDGE = RSMI_TEMP_TYPE_FIRST,
465  RSMI_TEMP_TYPE_LAST = RSMI_TEMP_TYPE_HBM_3,
466  RSMI_TEMP_TYPE_INVALID = 0xFFFFFFFF
468 
474 typedef enum {
476 
477  RSMI_VOLT_FIRST = RSMI_VOLT_CURRENT,
485 
486  RSMI_VOLT_LAST = RSMI_VOLT_HIGHEST
488 
493 typedef enum {
494  RSMI_VOLT_TYPE_FIRST = 0,
495 
496  RSMI_VOLT_TYPE_VDDGFX = RSMI_VOLT_TYPE_FIRST,
498  RSMI_VOLT_TYPE_LAST = RSMI_VOLT_TYPE_VDDGFX,
499  RSMI_VOLT_TYPE_INVALID = 0xFFFFFFFF
501 
508 typedef enum {
514 
516  RSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK = 0x20,
519 
521  RSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF
524 typedef rsmi_power_profile_preset_masks_t rsmi_power_profile_preset_masks;
526 
530 typedef enum {
531  RSMI_GPU_BLOCK_INVALID = 0x0000000000000000,
533  RSMI_GPU_BLOCK_FIRST = 0x0000000000000001,
534 
535  RSMI_GPU_BLOCK_UMC = RSMI_GPU_BLOCK_FIRST,
536  RSMI_GPU_BLOCK_SDMA = 0x0000000000000002,
537  RSMI_GPU_BLOCK_GFX = 0x0000000000000004,
538  RSMI_GPU_BLOCK_MMHUB = 0x0000000000000008,
539  RSMI_GPU_BLOCK_ATHUB = 0x0000000000000010,
540  RSMI_GPU_BLOCK_PCIE_BIF = 0x0000000000000020,
541  RSMI_GPU_BLOCK_HDP = 0x0000000000000040,
542  RSMI_GPU_BLOCK_XGMI_WAFL = 0x0000000000000080,
543  RSMI_GPU_BLOCK_DF = 0x0000000000000100,
544  RSMI_GPU_BLOCK_SMN = 0x0000000000000200,
545  RSMI_GPU_BLOCK_SEM = 0x0000000000000400,
546  RSMI_GPU_BLOCK_MP0 = 0x0000000000000800,
547  RSMI_GPU_BLOCK_MP1 = 0x0000000000001000,
548  RSMI_GPU_BLOCK_FUSE = 0x0000000000002000,
549 
552  RSMI_GPU_BLOCK_RESERVED = 0x8000000000000000
555 typedef rsmi_gpu_block_t rsmi_gpu_block;
557 
561 typedef enum {
570 
571  RSMI_RAS_ERR_STATE_LAST = RSMI_RAS_ERR_STATE_ENABLED,
572  RSMI_RAS_ERR_STATE_INVALID = 0xFFFFFFFF
574 
578 typedef enum {
579  RSMI_MEM_TYPE_FIRST = 0,
580 
581  RSMI_MEM_TYPE_VRAM = RSMI_MEM_TYPE_FIRST,
584 
585  RSMI_MEM_TYPE_LAST = RSMI_MEM_TYPE_GTT
587 
591 typedef enum {
594  RSMI_FREQ_IND_INVALID = 0xFFFFFFFF
597 typedef rsmi_freq_ind_t rsmi_freq_ind;
599 
600 
605 typedef enum {
606  RSMI_FW_BLOCK_FIRST = 0,
607 
608  RSMI_FW_BLOCK_ASD = RSMI_FW_BLOCK_FIRST,
609  RSMI_FW_BLOCK_CE,
610  RSMI_FW_BLOCK_DMCU,
611  RSMI_FW_BLOCK_MC,
612  RSMI_FW_BLOCK_ME,
613  RSMI_FW_BLOCK_MEC,
614  RSMI_FW_BLOCK_MEC2,
615  RSMI_FW_BLOCK_PFP,
616  RSMI_FW_BLOCK_RLC,
617  RSMI_FW_BLOCK_RLC_SRLC,
618  RSMI_FW_BLOCK_RLC_SRLG,
619  RSMI_FW_BLOCK_RLC_SRLS,
620  RSMI_FW_BLOCK_SDMA,
621  RSMI_FW_BLOCK_SDMA2,
622  RSMI_FW_BLOCK_SMC,
623  RSMI_FW_BLOCK_SOS,
624  RSMI_FW_BLOCK_TA_RAS,
625  RSMI_FW_BLOCK_TA_XGMI,
626  RSMI_FW_BLOCK_UVD,
627  RSMI_FW_BLOCK_VCE,
628  RSMI_FW_BLOCK_VCN,
629 
630  RSMI_FW_BLOCK_LAST = RSMI_FW_BLOCK_VCN
632 
636 typedef enum {
637  RSMI_XGMI_STATUS_NO_ERRORS = 0,
638  RSMI_XGMI_STATUS_ERROR,
639  RSMI_XGMI_STATUS_MULTIPLE_ERRORS,
641 
645 typedef uint64_t rsmi_bit_field_t;
647 typedef rsmi_bit_field_t rsmi_bit_field;
649 
653 typedef enum {
661 
665 typedef enum _RSMI_IO_LINK_TYPE {
670  RSMI_IOLINK_TYPE_SIZE = 0xFFFFFFFF
672 
676 typedef enum {
679  RSMI_COARSE_GRAIN_GFX_ACTIVITY = RSMI_UTILIZATION_COUNTER_FIRST,
681  RSMI_UTILIZATION_COUNTER_LAST = RSMI_COARSE_GRAIN_MEM_ACTIVITY
683 
687 typedef struct {
689  uint64_t value;
691 
695 typedef struct {
696  uint64_t page_address;
697  uint64_t page_size;
700 
704 #define RSMI_MAX_NUM_POWER_PROFILES (sizeof(rsmi_bit_field_t) * 8)
705 
711 typedef struct {
716 
721 
725  uint32_t num_profiles;
728 typedef rsmi_power_profile_status_t rsmi_power_profile_status;
730 
734 typedef struct {
738  uint32_t num_supported;
739 
743  uint32_t current;
744 
749  uint64_t frequency[RSMI_MAX_NUM_FREQUENCIES];
752 typedef rsmi_frequencies_t rsmi_frequencies;
754 
760 typedef struct {
765 
770  uint32_t lanes[RSMI_MAX_NUM_FREQUENCIES];
772 
774 typedef rsmi_pcie_bandwidth_t rsmi_pcie_bandwidth;
776 
780 typedef struct {
781  uint32_t major;
782  uint32_t minor;
783  uint32_t patch;
784  const char *build;
787 typedef rsmi_version_t rsmi_version;
789 
792 typedef struct {
793  uint64_t lower_bound;
794  uint64_t upper_bound;
795 } rsmi_range_t;
797 typedef rsmi_range_t rsmi_range;
799 
803 typedef struct {
804  uint64_t frequency;
805  uint64_t voltage;
808 typedef rsmi_od_vddc_point_t rsmi_od_vddc_point;
810 
816 typedef struct {
821 typedef rsmi_freq_volt_region_t rsmi_freq_volt_region;
823 
827 typedef struct {
835 typedef rsmi_od_volt_curve_t rsmi_od_volt_curve;
837 
841 typedef struct {
847 
852  uint32_t num_regions;
855 typedef rsmi_od_volt_freq_data_t rsmi_od_volt_freq_data;
857 
858 
867  // TODO(amd) Doxygen documents
869  uint16_t structure_size;
870  uint8_t format_revision;
871  uint8_t content_revision;
873 };
874 
878 // Below is the assumed version of gpu_metric data on the device. If the device
879 // is using this version, we can read data directly into rsmi_gpu_metrics_t.
880 // If the device is using an older format, a conversion of formats will be
881 // required.
882 // DGPU targets have a format version of 1. APU targets have a format version of
883 // 2. Currently, only version 1 (DGPU) gpu_metrics is supported.
884 #define RSMI_GPU_METRICS_API_FORMAT_VER 1
885 // The content version increments when gpu_metrics is extended with new and/or
886 // existing field sizes are changed.
887 #define RSMI_GPU_METRICS_API_CONTENT_VER_1 1
888 #define RSMI_GPU_METRICS_API_CONTENT_VER_2 2
889 #define RSMI_GPU_METRICS_API_CONTENT_VER_3 3
890 
891 // This should match NUM_HBM_INSTANCES
892 #define RSMI_NUM_HBM_INSTANCES 4
893 
894 // Unit conversion factor for HBM temperatures
895 #define CENTRIGRADE_TO_MILLI_CENTIGRADE 1000
896 
897 typedef struct {
898  // TODO(amd) Doxygen documents
900  struct metrics_table_header_t common_header;
901 
902 /* Temperature */
903  uint16_t temperature_edge;
904  uint16_t temperature_hotspot;
905  uint16_t temperature_mem;
906  uint16_t temperature_vrgfx;
907  uint16_t temperature_vrsoc;
908  uint16_t temperature_vrmem;
909 
910 /* Utilization */
911  uint16_t average_gfx_activity;
912  uint16_t average_umc_activity; // memory controller
913  uint16_t average_mm_activity; // UVD or VCN
914 
915 /* Power/Energy */
916  uint16_t average_socket_power;
917  uint64_t energy_accumulator; // v1 mod. (32->64)
918 
919 /* Driver attached timestamp (in ns) */
920  uint64_t system_clock_counter; // v1 mod. (moved from top of struct)
921 
922 /* Average clocks */
923  uint16_t average_gfxclk_frequency;
924  uint16_t average_socclk_frequency;
925  uint16_t average_uclk_frequency;
926  uint16_t average_vclk0_frequency;
927  uint16_t average_dclk0_frequency;
928  uint16_t average_vclk1_frequency;
929  uint16_t average_dclk1_frequency;
930 
931 /* Current clocks */
932  uint16_t current_gfxclk;
933  uint16_t current_socclk;
934  uint16_t current_uclk;
935  uint16_t current_vclk0;
936  uint16_t current_dclk0;
937  uint16_t current_vclk1;
938  uint16_t current_dclk1;
939 
940 /* Throttle status */
941  uint32_t throttle_status;
942 
943 /* Fans */
944  uint16_t current_fan_speed;
945 
946 /* Link width/speed */
947  uint16_t pcie_link_width; // v1 mod.(8->16)
948  uint16_t pcie_link_speed; // in 0.1 GT/s; v1 mod. (8->16)
949 
950  uint16_t padding; // new in v1
951 
952  uint32_t gfx_activity_acc; // new in v1
953  uint32_t mem_actvity_acc; // new in v1
954  uint16_t temperature_hbm[RSMI_NUM_HBM_INSTANCES]; // new in v1
957 
961 typedef struct {
962  uint64_t correctable_err;
963  uint64_t uncorrectable_err;
965 
969 typedef struct {
970  uint32_t process_id;
971  uint32_t pasid;
972  uint64_t vram_usage;
973  uint64_t sdma_usage;
974  uint32_t cu_occupancy;
976 
977 
981 typedef struct rsmi_func_id_iter_handle * rsmi_func_id_iter_handle_t;
982 
985 #define RSMI_DEFAULT_VARIANT 0xFFFFFFFFFFFFFFFF
986 
992 typedef union id {
993  uint64_t id;
994  const char *name;
995  union {
1009  rsmi_gpu_block_t gpu_block_type;
1010  };
1012 
1013 
1014 /*****************************************************************************/
1032 rsmi_status_t rsmi_init(uint64_t init_flags);
1033 
1040  // end of InitShut
1042 
1043 /*****************************************************************************/
1061 
1089 rsmi_status_t rsmi_dev_id_get(uint32_t dv_ind, uint16_t *id);
1090 
1091 
1116 rsmi_status_t rsmi_dev_sku_get(uint32_t dv_ind, char *sku);
1117 
1141 rsmi_status_t rsmi_dev_vendor_id_get(uint32_t dv_ind, uint16_t *id);
1142 
1177 rsmi_status_t rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len);
1178 
1211 rsmi_status_t rsmi_dev_brand_get(uint32_t dv_ind, char *brand, uint32_t len);
1212 
1247 rsmi_status_t rsmi_dev_vendor_name_get(uint32_t dv_ind, char *name,
1248  size_t len);
1249 
1272 rsmi_status_t rsmi_dev_vram_vendor_get(uint32_t dv_ind, char *brand,
1273  uint32_t len);
1274 
1304  char *serial_num, uint32_t len);
1328 rsmi_status_t rsmi_dev_subsystem_id_get(uint32_t dv_ind, uint16_t *id);
1329 
1365 rsmi_dev_subsystem_name_get(uint32_t dv_ind, char *name, size_t len);
1366 
1385 rsmi_dev_drm_render_minor_get(uint32_t dv_ind, uint32_t *minor);
1386 
1409 rsmi_status_t rsmi_dev_subsystem_vendor_id_get(uint32_t dv_ind, uint16_t *id);
1410 
1432 rsmi_status_t rsmi_dev_unique_id_get(uint32_t dv_ind, uint64_t *id);
1433  // end of IDQuer
1435 
1436 /*****************************************************************************/
1460 
1496 rsmi_status_t rsmi_dev_pci_id_get(uint32_t dv_ind, uint64_t *bdfid);
1497 
1520 rsmi_status_t rsmi_topo_numa_affinity_get(uint32_t dv_ind, uint32_t *numa_node);
1521 
1546 rsmi_status_t rsmi_dev_pci_throughput_get(uint32_t dv_ind, uint64_t *sent,
1547  uint64_t *received, uint64_t *max_pkt_sz);
1548 
1572  uint64_t *counter);
1573  // end of PCIeQuer
1575 /*****************************************************************************/
1610 rsmi_status_t rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask);
1611  // end of PCIeCont
1613 
1614 /*****************************************************************************/
1645 rsmi_dev_power_ave_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *power);
1646 
1678 rsmi_dev_energy_count_get(uint32_t dv_ind, uint64_t *power,
1679  float *counter_resolution, uint64_t *timestamp);
1680 
1707 rsmi_dev_power_cap_get(uint32_t dv_ind, uint32_t sensor_ind, uint64_t *cap);
1708 
1731 rsmi_dev_power_cap_default_get(uint32_t dv_ind, uint64_t *default_cap);
1732 
1765 rsmi_dev_power_cap_range_get(uint32_t dv_ind, uint32_t sensor_ind,
1766  uint64_t *max, uint64_t *min);
1767  // end of PowerQuer
1769 
1770 /*****************************************************************************/
1796 rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap);
1797 
1818 rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t reserved,
1819  rsmi_power_profile_preset_masks_t profile); // end of PowerCont
1821 /*****************************************************************************/
1822 
1823 
1824 
1825 /*****************************************************************************/
1858  uint64_t *total);
1859 
1888  uint64_t *used);
1889 
1913 rsmi_dev_memory_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent);
1914 
1951 rsmi_dev_memory_reserved_pages_get(uint32_t dv_ind, uint32_t *num_pages,
1952  rsmi_retired_page_record_t *records); // end of MemQuer
1954 
1986 rsmi_status_t rsmi_dev_fan_rpms_get(uint32_t dv_ind, uint32_t sensor_ind,
1987  int64_t *speed);
1988 
2017  uint32_t sensor_ind, int64_t *speed);
2018 
2045  uint32_t sensor_ind, uint64_t *max_speed);
2046 
2077 rsmi_status_t rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_type,
2078  rsmi_temperature_metric_t metric, int64_t *temperature);
2079 
2111  rsmi_voltage_type_t sensor_type,
2112  rsmi_voltage_metric_t metric, int64_t *voltage); // end of PhysQuer
2114 
2115 /*****************************************************************************/
2135 rsmi_status_t rsmi_dev_fan_reset(uint32_t dv_ind, uint32_t sensor_ind);
2136 
2159 rsmi_status_t rsmi_dev_fan_speed_set(uint32_t dv_ind, uint32_t sensor_ind,
2160  uint64_t speed);
2161  // end of PhysCont
2163 /*****************************************************************************/
2194 rsmi_dev_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent);
2195 
2227  rsmi_utilization_counter_t utilization_counters[],
2228  uint32_t count,
2229  uint64_t *timestamp);
2230 
2255  rsmi_dev_perf_level_t *perf);
2256 
2278 rsmi_status_t rsmi_perf_determinism_mode_set(uint32_t dv_ind, uint64_t clkvalue);
2279 
2303 rsmi_status_t rsmi_dev_overdrive_level_get(uint32_t dv_ind, uint32_t *od);
2304 
2328 rsmi_status_t rsmi_dev_mem_overdrive_level_get(uint32_t dv_ind, uint32_t *od);
2329 
2361  rsmi_clk_type_t clk_type, rsmi_frequencies_t *f);
2362 
2377 
2400 
2422  rsmi_gpu_metrics_t *pgpu_metrics);
2423 
2446 rsmi_status_t rsmi_dev_clk_range_set(uint32_t dv_ind, uint64_t minclkvalue,
2447  uint64_t maxclkvalue,
2448  rsmi_clk_type_t clkType);
2449 
2473  uint64_t clkvalue,
2474  rsmi_clk_type_t clkType);
2475 
2497 rsmi_status_t rsmi_dev_od_volt_info_set(uint32_t dv_ind, uint32_t vpoint,
2498  uint64_t clkvalue, uint64_t voltvalue);
2499 
2539  uint32_t *num_regions, rsmi_freq_volt_region_t *buffer);
2540 
2577 rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind,
2578  rsmi_power_profile_status_t *status);
2579  // end of PerfQuer
2581 /*****************************************************************************/
2582 
2611 
2632 
2676 rsmi_status_t rsmi_dev_overdrive_level_set(int32_t dv_ind, uint32_t od);
2677 
2717 rsmi_status_t rsmi_dev_overdrive_level_set_v1(uint32_t dv_ind, uint32_t od);
2718 
2754  rsmi_clk_type_t clk_type, uint64_t freq_bitmask);
2755  // end of PerfCont
2757 
2758 /*****************************************************************************/
2779 
2807  uint32_t len);
2808 
2836 rsmi_dev_vbios_version_get(uint32_t dv_ind, char *vbios, uint32_t len);
2837 
2864  uint64_t *fw_version);
2865  // end of VersQuer
2867 
2868 /*****************************************************************************/
2902 
2931  uint64_t *enabled_blocks);
2932 
2959  rsmi_ras_err_state_t *state);
2975 rsmi_status_string(rsmi_status_t status, const char **status_string);
2976  // end of ErrQuer
2978 
2979 /*****************************************************************************/
3102 
3133  rsmi_event_handle_t *evnt_handle);
3134 
3150 
3170  rsmi_counter_command_t cmd, void *cmd_args);
3171 
3191  rsmi_counter_value_t *value);
3192 
3214  rsmi_event_group_t grp, uint32_t *available); // end of PerfCntr
3216 
3217 /*****************************************************************************/
3257 
3281 
3317 rsmi_compute_process_gpus_get(uint32_t pid, uint32_t *dv_indices,
3318  uint32_t *num_devices);
3319  // end of SysInfo
3321 
3322 /*****************************************************************************/
3353 
3367 rsmi_dev_xgmi_error_reset(uint32_t dv_ind);
3368 
3388 rsmi_dev_xgmi_hive_id_get(uint32_t dv_ind, uint64_t *hive_id);
3389  // end of SysInfo
3391 
3392 /*****************************************************************************/
3416 rsmi_topo_get_numa_node_number(uint32_t dv_ind, uint32_t *numa_node);
3417 
3439 rsmi_topo_get_link_weight(uint32_t dv_ind_src, uint32_t dv_ind_dst,
3440  uint64_t *weight);
3441 
3465 rsmi_minmax_bandwidth_get(uint32_t dv_ind_src, uint32_t dv_ind_dst,
3466  uint64_t *min_bandwidth, uint64_t *max_bandwidth);
3467 
3493 rsmi_topo_get_link_type(uint32_t dv_ind_src, uint32_t dv_ind_dst,
3494  uint64_t *hops, RSMI_IO_LINK_TYPE *type);
3495 
3517 rsmi_is_P2P_accessible(uint32_t dv_ind_src, uint32_t dv_ind_dst,
3518  bool *accessible);
3519  // end of HWTopo
3521 
3522 /*****************************************************************************/
3558 rsmi_dev_compute_partition_get(uint32_t dv_ind, char *compute_partition,
3559  uint32_t len);
3560 
3585  rsmi_compute_partition_type_t compute_partition);
3586 
3603  // end of ComputePartition
3605 
3606 /*****************************************************************************/
3641 rsmi_dev_nps_mode_get(uint32_t dv_ind, char *nps_mode, uint32_t len);
3642 
3665 rsmi_dev_nps_mode_set(uint32_t dv_ind, rsmi_nps_mode_type_t nps_mode);
3666 
3685  // end of NPSMode
3687 
3688 /*****************************************************************************/
3823  rsmi_func_id_iter_handle_t *handle);
3824 
3851  rsmi_func_id_iter_handle_t *var_iter);
3852 
3873 
3887 
3908  rsmi_func_id_value_t *value);
3909  // end of APISupport
3911 
3912 /*****************************************************************************/
3934 
3962 rsmi_event_notification_mask_set(uint32_t dv_ind, uint64_t mask);
3963 
4006  uint32_t *num_elem, rsmi_evt_notification_data_t *data);
4007 
4027  // end of EvntNotif
4029 
4030 #ifdef __cplusplus
4031 }
4032 #endif // __cplusplus
4033 #endif // INCLUDE_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_compute_partition_reset(uint32_t dv_ind)
Reverts a selected device's compute partition setting back to its boot state.
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_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 2 GPUs.
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_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, char *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_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_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_nps_mode_reset(uint32_t dv_ind)
Reverts a selected device's NPS mode setting back to its boot state.
rsmi_status_t rsmi_dev_nps_mode_set(uint32_t dv_ind, rsmi_nps_mode_type_t nps_mode)
Modifies a selected device's NPS mode (memory partition) setting.
rsmi_status_t rsmi_dev_nps_mode_get(uint32_t dv_ind, char *nps_mode, uint32_t len)
Retrieves the NPS mode (memory partition) for a desired device.
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_topo_numa_affinity_get(uint32_t dv_ind, uint32_t *numa_node)
Get the NUMA node associated with a device.
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_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(int32_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(int32_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_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_dev_gpu_reset(int32_t dv_ind)
Reset the gpu associated with the device 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_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_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_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_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_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.
struct rsmi_func_id_iter_handle * rsmi_func_id_iter_handle_t
Opaque handle to function-support object.
Definition: rocm_smi.h:981
rsmi_memory_page_status_t
Reserved Memory Page States.
Definition: rocm_smi.h:653
@ RSMI_MEM_PAGE_STATUS_UNRESERVABLE
Unable to reserve this page.
Definition: rocm_smi.h:659
@ RSMI_MEM_PAGE_STATUS_PENDING
Definition: rocm_smi.h:656
@ RSMI_MEM_PAGE_STATUS_RESERVED
Definition: rocm_smi.h:654
rsmi_status_t
Error codes retured by rocm_smi_lib functions.
Definition: rocm_smi.h:85
@ RSMI_STATUS_UNEXPECTED_DATA
Definition: rocm_smi.h:122
@ RSMI_STATUS_REFCOUNT_OVERFLOW
Definition: rocm_smi.h:127
@ RSMI_STATUS_NOT_FOUND
Definition: rocm_smi.h:112
@ RSMI_STATUS_UNKNOWN_ERROR
An unknown error occurred.
Definition: rocm_smi.h:134
@ RSMI_STATUS_INIT_ERROR
Definition: rocm_smi.h:104
@ RSMI_STATUS_SETTING_UNAVAILABLE
Definition: rocm_smi.h:129
@ RSMI_STATUS_INSUFFICIENT_SIZE
Definition: rocm_smi.h:114
@ RSMI_STATUS_INVALID_ARGS
Passed in arguments are not valid.
Definition: rocm_smi.h:87
@ RSMI_STATUS_NOT_SUPPORTED
Definition: rocm_smi.h:88
@ RSMI_STATUS_NO_DATA
Definition: rocm_smi.h:120
@ RSMI_STATUS_UNEXPECTED_SIZE
Definition: rocm_smi.h:118
@ RSMI_STATUS_AMDGPU_RESTART_ERR
Definition: rocm_smi.h:131
@ RSMI_STATUS_FILE_ERROR
Definition: rocm_smi.h:91
@ RSMI_STATUS_BUSY
Definition: rocm_smi.h:124
@ RSMI_STATUS_NOT_YET_IMPLEMENTED
Definition: rocm_smi.h:108
@ RSMI_STATUS_OUT_OF_RESOURCES
Definition: rocm_smi.h:99
@ RSMI_STATUS_INTERRUPT
Definition: rocm_smi.h:116
@ RSMI_STATUS_INTERNAL_EXCEPTION
An internal exception was caught.
Definition: rocm_smi.h:101
@ RSMI_STATUS_SUCCESS
Operation was successful.
Definition: rocm_smi.h:86
@ RSMI_STATUS_INPUT_OUT_OF_BOUNDS
Definition: rocm_smi.h:102
@ RSMI_STATUS_PERMISSION
Definition: rocm_smi.h:96
RSMI_UTILIZATION_COUNTER_TYPE
The utilization counter type.
Definition: rocm_smi.h:676
@ RSMI_COARSE_GRAIN_MEM_ACTIVITY
Memory Activity.
Definition: rocm_smi.h:680
@ RSMI_UTILIZATION_COUNTER_FIRST
GFX Activity.
Definition: rocm_smi.h:677
_RSMI_IO_LINK_TYPE
Types for IO Link.
Definition: rocm_smi.h:665
@ RSMI_IOLINK_TYPE_XGMI
XGMI.
Definition: rocm_smi.h:668
@ RSMI_IOLINK_TYPE_UNDEFINED
unknown type.
Definition: rocm_smi.h:666
@ RSMI_IOLINK_TYPE_PCIEXPRESS
PCI Express.
Definition: rocm_smi.h:667
@ RSMI_IOLINK_TYPE_SIZE
Max of IO Link types.
Definition: rocm_smi.h:670
@ RSMI_IOLINK_TYPE_NUMIOLINKTYPES
Number of IO Link types.
Definition: rocm_smi.h:669
rsmi_sw_component_t
Available clock types.
Definition: rocm_smi.h:189
@ RSMI_SW_COMP_DRIVER
Driver.
Definition: rocm_smi.h:192
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:212
@ RSMI_EVNT_GRP_XGMI
Data Fabric (XGMI) related events.
Definition: rocm_smi.h:213
@ RSMI_EVNT_GRP_XGMI_DATA_OUT
XGMI Outbound data.
Definition: rocm_smi.h:214
#define MAX_EVENT_NOTIFICATION_MSG_SIZE
Maximum number of characters an event notification message will be.
Definition: rocm_smi.h:326
rsmi_dev_perf_level_t
PowerPlay performance levels.
Definition: rocm_smi.h:156
@ RSMI_DEV_PERF_LEVEL_LOW
Definition: rocm_smi.h:160
@ RSMI_DEV_PERF_LEVEL_MANUAL
Definition: rocm_smi.h:164
@ RSMI_DEV_PERF_LEVEL_STABLE_MIN_MCLK
Definition: rocm_smi.h:169
@ RSMI_DEV_PERF_LEVEL_UNKNOWN
Unknown performance level.
Definition: rocm_smi.h:177
@ RSMI_DEV_PERF_LEVEL_DETERMINISM
Performance determinism state.
Definition: rocm_smi.h:173
@ RSMI_DEV_PERF_LEVEL_HIGH
Definition: rocm_smi.h:162
@ RSMI_DEV_PERF_LEVEL_STABLE_STD
Definition: rocm_smi.h:166
@ RSMI_DEV_PERF_LEVEL_STABLE_PEAK
Stable power state with peak clocks.
Definition: rocm_smi.h:168
@ RSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK
Definition: rocm_smi.h:171
@ RSMI_DEV_PERF_LEVEL_AUTO
Performance level is "auto".
Definition: rocm_smi.h:157
rsmi_voltage_metric_t
Voltage Metrics. This enum is used to identify various Volatge metrics. Corresponding values will be ...
Definition: rocm_smi.h:474
@ RSMI_VOLT_LOWEST
Historical minimum voltage.
Definition: rocm_smi.h:483
@ RSMI_VOLT_MIN_CRIT
Voltage critical min value.
Definition: rocm_smi.h:479
@ RSMI_VOLT_MAX_CRIT
Voltage critical max value.
Definition: rocm_smi.h:481
@ RSMI_VOLT_CURRENT
Voltage current value.
Definition: rocm_smi.h:475
@ RSMI_VOLT_MIN
Voltage min value.
Definition: rocm_smi.h:480
@ RSMI_VOLT_AVERAGE
Average voltage.
Definition: rocm_smi.h:482
@ RSMI_VOLT_MAX
Voltage max value.
Definition: rocm_smi.h:478
@ RSMI_VOLT_HIGHEST
Historical maximum voltage.
Definition: rocm_smi.h:484
rsmi_evt_notification_type_t
Definition: rocm_smi.h:310
@ RSMI_EVT_NOTIF_VMFAULT
VM page fault.
Definition: rocm_smi.h:311
#define RSMI_NUM_VOLTAGE_CURVE_POINTS
The number of points that make up a voltage-frequency curve definition.
Definition: rocm_smi.h:80
rsmi_xgmi_status_t
XGMI Status.
Definition: rocm_smi.h:636
rsmi_compute_partition_type_t
Compute Partition. This enum is used to identify various compute partitioning settings.
Definition: rocm_smi.h:363
@ RSMI_COMPUTE_PARTITION_SPX
Definition: rocm_smi.h:367
@ RSMI_COMPUTE_PARTITION_DPX
Definition: rocm_smi.h:369
@ RSMI_COMPUTE_PARTITION_QPX
Definition: rocm_smi.h:373
@ RSMI_COMPUTE_PARTITION_TPX
Definition: rocm_smi.h:371
@ RSMI_COMPUTE_PARTITION_CPX
Definition: rocm_smi.h:365
rsmi_voltage_type_t
This ennumeration is used to indicate which type of voltage reading should be obtained.
Definition: rocm_smi.h:493
@ RSMI_VOLT_TYPE_VDDGFX
Definition: rocm_smi.h:496
@ RSMI_VOLT_TYPE_INVALID
Invalid type.
Definition: rocm_smi.h:499
rsmi_temperature_metric_t
Temperature Metrics. This enum is used to identify various temperature metrics. Corresponding values ...
Definition: rocm_smi.h:409
@ RSMI_TEMP_CURRENT
Temperature current value.
Definition: rocm_smi.h:410
@ RSMI_TEMP_LOWEST
Historical minimum temperature.
Definition: rocm_smi.h:441
@ RSMI_TEMP_CRIT_MIN
Definition: rocm_smi.h:433
@ RSMI_TEMP_CRIT_MIN_HYST
Definition: rocm_smi.h:436
@ RSMI_TEMP_MIN
Temperature min value.
Definition: rocm_smi.h:414
@ RSMI_TEMP_MAX
Temperature max value.
Definition: rocm_smi.h:413
@ RSMI_TEMP_EMERGENCY
Definition: rocm_smi.h:426
@ RSMI_TEMP_MAX_HYST
Definition: rocm_smi.h:415
@ RSMI_TEMP_MIN_HYST
Definition: rocm_smi.h:418
@ RSMI_TEMP_CRITICAL_HYST
Definition: rocm_smi.h:423
@ RSMI_TEMP_EMERGENCY_HYST
Definition: rocm_smi.h:430
@ RSMI_TEMP_HIGHEST
Historical maximum temperature.
Definition: rocm_smi.h:442
@ RSMI_TEMP_CRITICAL
Definition: rocm_smi.h:421
@ RSMI_TEMP_OFFSET
Definition: rocm_smi.h:439
rsmi_ras_err_state_t
The current ECC state.
Definition: rocm_smi.h:561
@ RSMI_RAS_ERR_STATE_MULT_UC
Multiple uncorrectable errors.
Definition: rocm_smi.h:566
@ RSMI_RAS_ERR_STATE_POISON
Definition: rocm_smi.h:567
@ RSMI_RAS_ERR_STATE_DISABLED
ECC is disabled.
Definition: rocm_smi.h:563
@ RSMI_RAS_ERR_STATE_PARITY
ECC errors present, but type unknown.
Definition: rocm_smi.h:564
@ RSMI_RAS_ERR_STATE_SING_C
Single correctable error.
Definition: rocm_smi.h:565
@ RSMI_RAS_ERR_STATE_ENABLED
ECC is enabled.
Definition: rocm_smi.h:569
@ RSMI_RAS_ERR_STATE_NONE
No current errors.
Definition: rocm_smi.h:562
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:224
@ RSMI_EVNT_XGMI_1_RESPONSE_TX
Definition: rocm_smi.h:251
@ RSMI_EVNT_XGMI_DATA_OUT_5
Outbound beats to neighbor 5.
Definition: rocm_smi.h:281
@ RSMI_EVNT_XGMI_1_BEATS_TX
Definition: rocm_smi.h:253
@ RSMI_EVNT_XGMI_1_NOP_TX
NOPs sent to neighbor 1.
Definition: rocm_smi.h:248
@ RSMI_EVNT_XGMI_0_NOP_TX
NOPs sent to neighbor 0.
Definition: rocm_smi.h:228
@ RSMI_EVNT_XGMI_1_REQUEST_TX
neighbor 1
Definition: rocm_smi.h:249
@ RSMI_EVNT_XGMI_DATA_OUT_3
Outbound beats to neighbor 3.
Definition: rocm_smi.h:279
@ RSMI_EVNT_XGMI_DATA_OUT_4
Outbound beats to neighbor 4.
Definition: rocm_smi.h:280
@ RSMI_EVNT_XGMI_DATA_OUT_2
Outbound beats to neighbor 2.
Definition: rocm_smi.h:278
@ RSMI_EVNT_XGMI_0_RESPONSE_TX
Definition: rocm_smi.h:231
@ RSMI_EVNT_XGMI_DATA_OUT_1
Outbound beats to neighbor 1.
Definition: rocm_smi.h:277
@ RSMI_EVNT_XGMI_0_BEATS_TX
Data beats sent to neighbor 0; Each beat represents 32 bytes.
Definition: rocm_smi.h:247
@ RSMI_EVNT_XGMI_0_REQUEST_TX
Definition: rocm_smi.h:229
rsmi_freq_ind_t
The values of this enum are used as frequency identifiers.
Definition: rocm_smi.h:591
@ RSMI_FREQ_IND_MAX
Index used for the maximum frequency value.
Definition: rocm_smi.h:593
@ RSMI_FREQ_IND_MIN
Index used for the minimum frequency value.
Definition: rocm_smi.h:592
@ RSMI_FREQ_IND_INVALID
An invalid frequency index.
Definition: rocm_smi.h:594
rsmi_memory_type_t
Types of memory.
Definition: rocm_smi.h:578
@ RSMI_MEM_TYPE_VRAM
VRAM memory.
Definition: rocm_smi.h:581
@ RSMI_MEM_TYPE_GTT
GTT memory.
Definition: rocm_smi.h:583
@ RSMI_MEM_TYPE_VIS_VRAM
VRAM memory that is visible.
Definition: rocm_smi.h:582
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:508
@ RSMI_PWR_PROF_PRST_LAST
Invalid power profile.
Definition: rocm_smi.h:518
@ RSMI_PWR_PROF_PRST_VIDEO_MASK
Video Power Profile.
Definition: rocm_smi.h:510
@ RSMI_PWR_PROF_PRST_VR_MASK
VR Power Profile.
Definition: rocm_smi.h:513
@ RSMI_PWR_PROF_PRST_CUSTOM_MASK
Custom Power Profile.
Definition: rocm_smi.h:509
@ RSMI_PWR_PROF_PRST_POWER_SAVING_MASK
Power Saving Profile.
Definition: rocm_smi.h:511
@ RSMI_PWR_PROF_PRST_COMPUTE_MASK
Compute Saving Profile.
Definition: rocm_smi.h:512
@ RSMI_PWR_PROF_PRST_BOOTUP_DEFAULT
Default Boot Up Profile.
Definition: rocm_smi.h:517
rsmi_gpu_block_t
This enum is used to identify different GPU blocks.
Definition: rocm_smi.h:530
@ RSMI_GPU_BLOCK_SMN
SMN block.
Definition: rocm_smi.h:544
@ RSMI_GPU_BLOCK_ATHUB
ATHUB block.
Definition: rocm_smi.h:539
@ RSMI_GPU_BLOCK_GFX
GFX block.
Definition: rocm_smi.h:537
@ RSMI_GPU_BLOCK_MMHUB
MMHUB block.
Definition: rocm_smi.h:538
@ RSMI_GPU_BLOCK_FUSE
Fuse block.
Definition: rocm_smi.h:548
@ RSMI_GPU_BLOCK_HDP
HDP block.
Definition: rocm_smi.h:541
@ RSMI_GPU_BLOCK_DF
DF block.
Definition: rocm_smi.h:543
@ RSMI_GPU_BLOCK_SEM
SEM block.
Definition: rocm_smi.h:545
@ RSMI_GPU_BLOCK_INVALID
Definition: rocm_smi.h:531
@ RSMI_GPU_BLOCK_MP1
MP1 block.
Definition: rocm_smi.h:547
@ RSMI_GPU_BLOCK_XGMI_WAFL
XGMI block.
Definition: rocm_smi.h:542
@ RSMI_GPU_BLOCK_UMC
UMC block.
Definition: rocm_smi.h:535
@ RSMI_GPU_BLOCK_LAST
for supported blocks
Definition: rocm_smi.h:550
@ RSMI_GPU_BLOCK_PCIE_BIF
PCIE_BIF block.
Definition: rocm_smi.h:540
@ RSMI_GPU_BLOCK_MP0
MP0 block.
Definition: rocm_smi.h:546
@ RSMI_GPU_BLOCK_SDMA
SDMA block.
Definition: rocm_smi.h:536
rsmi_nps_mode_type_t
NPS Modes. This enum is used to identify various NPS mode types.
Definition: rocm_smi.h:384
@ RSMI_MEMORY_PARTITION_NPS8
Definition: rocm_smi.h:394
@ RSMI_MEMORY_PARTITION_NPS4
Definition: rocm_smi.h:391
@ RSMI_MEMORY_PARTITION_NPS2
Definition: rocm_smi.h:388
@ RSMI_MEMORY_PARTITION_NPS1
Definition: rocm_smi.h:386
rsmi_fw_block_t
The values of this enum are used to identify the various firmware blocks.
Definition: rocm_smi.h:605
rsmi_init_flags_t
Initialization flags.
Definition: rocm_smi.h:143
@ RSMI_INIT_FLAG_RESRV_TEST1
Reserved for test.
Definition: rocm_smi.h:150
@ RSMI_INIT_FLAG_ALL_GPUS
Definition: rocm_smi.h:144
enum _RSMI_IO_LINK_TYPE RSMI_IO_LINK_TYPE
Types for IO Link.
#define RSMI_MAX_NUM_FREQUENCIES
Guaranteed maximum possible number of supported frequencies.
Definition: rocm_smi.h:73
uintptr_t rsmi_event_handle_t
Handle to performance event counter.
Definition: rocm_smi.h:204
rsmi_counter_command_t
Definition: rocm_smi.h:290
@ RSMI_CNTR_CMD_START
Start the counter.
Definition: rocm_smi.h:291
@ RSMI_CNTR_CMD_STOP
Definition: rocm_smi.h:292
uint64_t rsmi_bit_field_t
Bitfield used in various RSMI calls.
Definition: rocm_smi.h:645
rsmi_clk_type_t
Definition: rocm_smi.h:340
@ RSMI_CLK_TYPE_MEM
Memory clock.
Definition: rocm_smi.h:347
@ RSMI_CLK_TYPE_DCEF
Display Controller Engine clock.
Definition: rocm_smi.h:345
@ RSMI_CLK_TYPE_PCIE
PCIE clock.
Definition: rocm_smi.h:348
@ RSMI_CLK_TYPE_SOC
SOC clock.
Definition: rocm_smi.h:346
@ RSMI_CLK_TYPE_DF
Definition: rocm_smi.h:343
@ RSMI_CLK_TYPE_SYS
System clock.
Definition: rocm_smi.h:341
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_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:454
@ RSMI_TEMP_TYPE_HBM_2
HBM temperature instance 2.
Definition: rocm_smi.h:463
@ RSMI_TEMP_TYPE_HBM_0
HBM temperature instance 0.
Definition: rocm_smi.h:461
@ RSMI_TEMP_TYPE_HBM_1
HBM temperature instance 1.
Definition: rocm_smi.h:462
@ RSMI_TEMP_TYPE_MEMORY
VRAM temperature.
Definition: rocm_smi.h:460
@ RSMI_TEMP_TYPE_INVALID
Invalid type.
Definition: rocm_smi.h:466
@ RSMI_TEMP_TYPE_EDGE
Edge GPU temperature.
Definition: rocm_smi.h:457
@ RSMI_TEMP_TYPE_JUNCTION
Definition: rocm_smi.h:458
@ RSMI_TEMP_TYPE_HBM_3
HBM temperature instance 3.
Definition: rocm_smi.h:464
The following structures hold the gpu metrics values for a device.
Definition: rocm_smi.h:866
Definition: rocm_smi.h:299
uint64_t value
Counter value.
Definition: rocm_smi.h:300
uint64_t time_enabled
Definition: rocm_smi.h:301
uint64_t time_running
Definition: rocm_smi.h:303
This structure holds error counts.
Definition: rocm_smi.h:961
uint64_t correctable_err
Accumulated correctable errors.
Definition: rocm_smi.h:962
uint64_t uncorrectable_err
Accumulated uncorrectable errors.
Definition: rocm_smi.h:963
Definition: rocm_smi.h:331
rsmi_evt_notification_type_t event
Event type.
Definition: rocm_smi.h:333
uint32_t dv_ind
Index of device that corresponds to the event.
Definition: rocm_smi.h:332
This structure holds 2 rsmi_range_t's, one for frequency and one for voltage. These 2 ranges indicate...
Definition: rocm_smi.h:816
rsmi_range_t volt_range
The voltage range for this VDDC Curve point.
Definition: rocm_smi.h:818
rsmi_range_t freq_range
The frequency range for this VDDC Curve point.
Definition: rocm_smi.h:817
This structure holds information about clock frequencies.
Definition: rocm_smi.h:734
uint32_t current
Definition: rocm_smi.h:743
uint32_t num_supported
Definition: rocm_smi.h:738
Definition: rocm_smi.h:897
This structure represents a point on the frequency-voltage plane.
Definition: rocm_smi.h:803
uint64_t frequency
Frequency coordinate (in Hz)
Definition: rocm_smi.h:804
uint64_t voltage
Voltage coordinate (in mV)
Definition: rocm_smi.h:805
Definition: rocm_smi.h:827
This structure holds the frequency-voltage values for a device.
Definition: rocm_smi.h:841
rsmi_range_t mclk_freq_limits
The range possible of MCLK values.
Definition: rocm_smi.h:846
uint32_t num_regions
The number of voltage curve regions.
Definition: rocm_smi.h:852
rsmi_range_t curr_mclk_range
Definition: rocm_smi.h:843
rsmi_range_t sclk_freq_limits
The range possible of SCLK values.
Definition: rocm_smi.h:845
rsmi_range_t curr_sclk_range
The current SCLK frequency range.
Definition: rocm_smi.h:842
rsmi_od_volt_curve_t curve
The current voltage curve.
Definition: rocm_smi.h:851
This structure holds information about the possible PCIe bandwidths. Specifically,...
Definition: rocm_smi.h:760
rsmi_frequencies_t transfer_rate
Definition: rocm_smi.h:764
This structure contains information about which power profiles are supported by the system for a give...
Definition: rocm_smi.h:711
uint32_t num_profiles
Definition: rocm_smi.h:725
rsmi_bit_field_t available_profiles
Definition: rocm_smi.h:715
rsmi_power_profile_preset_masks_t current
Definition: rocm_smi.h:720
This structure contains information specific to a process.
Definition: rocm_smi.h:969
uint32_t cu_occupancy
Compute Unit usage in percent.
Definition: rocm_smi.h:974
uint32_t pasid
PASID.
Definition: rocm_smi.h:971
uint32_t process_id
Process ID.
Definition: rocm_smi.h:970
uint64_t sdma_usage
SDMA usage in microseconds.
Definition: rocm_smi.h:973
uint64_t vram_usage
VRAM usage.
Definition: rocm_smi.h:972
This structure represents a range (e.g., frequencies or voltages).
Definition: rocm_smi.h:792
uint64_t upper_bound
Upper bound of range.
Definition: rocm_smi.h:794
uint64_t lower_bound
Lower bound of range.
Definition: rocm_smi.h:793
Reserved Memory Page Record.
Definition: rocm_smi.h:695
uint64_t page_size
Page size.
Definition: rocm_smi.h:697
rsmi_memory_page_status_t status
Page "reserved" status.
Definition: rocm_smi.h:698
uint64_t page_address
Start address of page.
Definition: rocm_smi.h:696
The utilization counter data.
Definition: rocm_smi.h:687
RSMI_UTILIZATION_COUNTER_TYPE type
Utilization counter type.
Definition: rocm_smi.h:688
uint64_t value
Utilization counter value.
Definition: rocm_smi.h:689
This structure holds version information.
Definition: rocm_smi.h:780
uint32_t patch
Patch, build or stepping version.
Definition: rocm_smi.h:783
const char * build
Build string.
Definition: rocm_smi.h:784
uint32_t minor
Minor version.
Definition: rocm_smi.h:782
uint32_t major
Major version.
Definition: rocm_smi.h:781
This union holds the value of an rsmi_func_id_iter_handle_t. The value may be a function name,...
Definition: rocm_smi.h:992
rsmi_temperature_metric_t temp_metric
Used for rsmi_event_type_t variants.
Definition: rocm_smi.h:999
rsmi_memory_type_t memory_type
< Used for rsmi_memory_type_t variants
Definition: rocm_smi.h:997
rsmi_event_group_t evnt_group
Used for rsmi_clk_type_t variants.
Definition: rocm_smi.h:1003
rsmi_clk_type_t clk_type
Used for rsmi_fw_block_t variants.
Definition: rocm_smi.h:1005
uint64_t id
uint64_t representation of value
Definition: rocm_smi.h:993
rsmi_event_type_t evnt_type
Used for rsmi_event_group_t variants.
Definition: rocm_smi.h:1001
rsmi_fw_block_t fw_block
Used for rsmi_gpu_block_t variants.
Definition: rocm_smi.h:1007
const char * name
name string (applicable to functions only)
Definition: rocm_smi.h:994