diff --git a/projects/amdsmi/CHANGELOG.md b/projects/amdsmi/CHANGELOG.md index a2a0cd6d933f..c465cda4eda1 100644 --- a/projects/amdsmi/CHANGELOG.md +++ b/projects/amdsmi/CHANGELOG.md @@ -17,6 +17,9 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr - Consumers that pass explicit `--gtest_filter` values should update those filters to the new suite names. - See the [AMD SMI test design](docs/conceptual/test-design.md#naming-conventions) for the suite naming convention and `--gtest_filter` usage. +- **Widened five `amdsmi_gpu_metrics_t` accumulator counters from 32-bit to 64-bit** (breaking). + - `gfx_activity_acc`, `mem_activity_acc`, `pcie_nak_sent_count_acc`, `pcie_nak_rcvd_count_acc`, and `pcie_lc_perf_other_end_recovery` are now `uint64_t` to match the amdgpu pmfw metrics header. Recompile callers that read these fields; the struct layout and field offsets have changed. + ### Fixed - **Fixed `amd-smi ras --cper --json` emitting nothing when there are no CPER entries**. diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 097d8bea9309..f5460400098d 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2381,8 +2381,8 @@ typedef struct { /* * v1.1 additions */ - uint32_t gfx_activity_acc; //!< new in v1 - uint32_t mem_activity_acc; //!< new in v1 + uint64_t gfx_activity_acc; //!< new in v1 + uint64_t mem_activity_acc; //!< new in v1 uint16_t temperature_hbm[AMDSMI_NUM_HBM_INSTANCES]; //!< new in v1 /* @@ -2435,8 +2435,8 @@ typedef struct { * @brief v1.5 additions */ uint16_t jpeg_activity[AMDSMI_MAX_NUM_JPEG]; //!< JPEG activity percent (encode/decode) - uint32_t pcie_nak_sent_count_acc; //!< PCIE NAK sent accumulated count - uint32_t pcie_nak_rcvd_count_acc; //!< PCIE NAK received accumulated count + uint64_t pcie_nak_sent_count_acc; //!< PCIE NAK sent accumulated count + uint64_t pcie_nak_rcvd_count_acc; //!< PCIE NAK received accumulated count /** * @brief v1.6 additions @@ -2489,7 +2489,7 @@ typedef struct { amdsmi_gpu_xcp_metrics_t xcp_stats[AMDSMI_MAX_NUM_XCP]; /**< XCP (Graphic Cluster Partitions) metrics stats */ - uint32_t pcie_lc_perf_other_end_recovery; //!< PCIE other end recovery counter + uint64_t pcie_lc_perf_other_end_recovery; //!< PCIE other end recovery counter /** * @brief v1.7 additions diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index b82d8e8bb4b8..26b9d68032de 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -5717,10 +5717,10 @@ def amdsmi_get_gpu_metrics_info(processor_handle: processor_handle_t) -> Dict[st gpu_metrics.pcie_link_speed, MaxUIntegerTypes.UINT16_T ), "gfx_activity_acc": _validate_if_max_uint( - gpu_metrics.gfx_activity_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.gfx_activity_acc, MaxUIntegerTypes.UINT64_T ), "mem_activity_acc": _validate_if_max_uint( - gpu_metrics.mem_activity_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.mem_activity_acc, MaxUIntegerTypes.UINT64_T ), "temperature_hbm": _validate_if_max_uint( list(gpu_metrics.temperature_hbm), MaxUIntegerTypes.UINT16_T @@ -5786,10 +5786,10 @@ def amdsmi_get_gpu_metrics_info(processor_handle: processor_handle_t) -> Dict[st list(gpu_metrics.jpeg_activity), MaxUIntegerTypes.UINT16_T, isActivity=True ), "pcie_nak_sent_count_acc": _validate_if_max_uint( - gpu_metrics.pcie_nak_sent_count_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.pcie_nak_sent_count_acc, MaxUIntegerTypes.UINT64_T ), "pcie_nak_rcvd_count_acc": _validate_if_max_uint( - gpu_metrics.pcie_nak_rcvd_count_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.pcie_nak_rcvd_count_acc, MaxUIntegerTypes.UINT64_T ), "accumulation_counter": _validate_if_max_uint( gpu_metrics.accumulation_counter, MaxUIntegerTypes.UINT64_T @@ -5823,7 +5823,7 @@ def amdsmi_get_gpu_metrics_info(processor_handle: processor_handle_t) -> Dict[st "xcp_stats.gfx_below_host_limit_total_acc": list(gpu_metrics.xcp_stats), "xcp_stats.temperature_xcd": list(gpu_metrics.xcp_stats), "pcie_lc_perf_other_end_recovery": _validate_if_max_uint( - gpu_metrics.pcie_lc_perf_other_end_recovery, MaxUIntegerTypes.UINT32_T + gpu_metrics.pcie_lc_perf_other_end_recovery, MaxUIntegerTypes.UINT64_T ), "vram_max_bandwidth": _validate_if_max_uint( gpu_metrics.vram_max_bandwidth, MaxUIntegerTypes.UINT64_T @@ -6053,10 +6053,10 @@ def amdsmi_get_gpu_partition_metrics_info(processor_handle: processor_handle_t) gpu_metrics.pcie_link_speed, MaxUIntegerTypes.UINT16_T ), "gfx_activity_acc": _validate_if_max_uint( - gpu_metrics.gfx_activity_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.gfx_activity_acc, MaxUIntegerTypes.UINT64_T ), "mem_activity_acc": _validate_if_max_uint( - gpu_metrics.mem_activity_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.mem_activity_acc, MaxUIntegerTypes.UINT64_T ), "temperature_hbm": _validate_if_max_uint( list(gpu_metrics.temperature_hbm), MaxUIntegerTypes.UINT16_T @@ -6122,10 +6122,10 @@ def amdsmi_get_gpu_partition_metrics_info(processor_handle: processor_handle_t) list(gpu_metrics.jpeg_activity), MaxUIntegerTypes.UINT16_T, isActivity=True ), "pcie_nak_sent_count_acc": _validate_if_max_uint( - gpu_metrics.pcie_nak_sent_count_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.pcie_nak_sent_count_acc, MaxUIntegerTypes.UINT64_T ), "pcie_nak_rcvd_count_acc": _validate_if_max_uint( - gpu_metrics.pcie_nak_rcvd_count_acc, MaxUIntegerTypes.UINT32_T + gpu_metrics.pcie_nak_rcvd_count_acc, MaxUIntegerTypes.UINT64_T ), "accumulation_counter": _validate_if_max_uint( gpu_metrics.accumulation_counter, MaxUIntegerTypes.UINT64_T @@ -6159,7 +6159,7 @@ def amdsmi_get_gpu_partition_metrics_info(processor_handle: processor_handle_t) "xcp_stats.gfx_below_host_limit_total_acc": list(gpu_metrics.xcp_stats), "xcp_stats.temperature_xcd": list(gpu_metrics.xcp_stats), "pcie_lc_perf_other_end_recovery": _validate_if_max_uint( - gpu_metrics.pcie_lc_perf_other_end_recovery, MaxUIntegerTypes.UINT32_T + gpu_metrics.pcie_lc_perf_other_end_recovery, MaxUIntegerTypes.UINT64_T ), "vram_max_bandwidth": _validate_if_max_uint( gpu_metrics.vram_max_bandwidth, MaxUIntegerTypes.UINT64_T diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index b65dede4da8c..df41a1a7070c 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -2396,8 +2396,8 @@ class struct_amdsmi_gpu_metrics_t(Structure): ('pcie_link_width', ctypes.c_uint16), ('pcie_link_speed', ctypes.c_uint16), ('PADDING_0', ctypes.c_ubyte * 2), - ('gfx_activity_acc', ctypes.c_uint32), - ('mem_activity_acc', ctypes.c_uint32), + ('gfx_activity_acc', ctypes.c_uint64), + ('mem_activity_acc', ctypes.c_uint64), ('temperature_hbm', ctypes.c_uint16 * 4), ('firmware_timestamp', ctypes.c_uint64), ('voltage_soc', ctypes.c_uint16), @@ -2424,8 +2424,8 @@ class struct_amdsmi_gpu_metrics_t(Structure): ('current_vclk0s', ctypes.c_uint16 * 4), ('current_dclk0s', ctypes.c_uint16 * 4), ('jpeg_activity', ctypes.c_uint16 * 32), - ('pcie_nak_sent_count_acc', ctypes.c_uint32), - ('pcie_nak_rcvd_count_acc', ctypes.c_uint32), + ('pcie_nak_sent_count_acc', ctypes.c_uint64), + ('pcie_nak_rcvd_count_acc', ctypes.c_uint64), ('accumulation_counter', ctypes.c_uint64), ('prochot_residency_acc', ctypes.c_uint64), ('ppt_residency_acc', ctypes.c_uint64), @@ -2435,8 +2435,7 @@ class struct_amdsmi_gpu_metrics_t(Structure): ('num_partition', ctypes.c_uint16), ('PADDING_4', ctypes.c_ubyte * 6), ('xcp_stats', struct_amdsmi_gpu_xcp_metrics_t * 8), - ('pcie_lc_perf_other_end_recovery', ctypes.c_uint32), - ('PADDING_5', ctypes.c_ubyte * 4), + ('pcie_lc_perf_other_end_recovery', ctypes.c_uint64), ('vram_max_bandwidth', ctypes.c_uint64), ('xgmi_link_status', ctypes.c_uint16 * 8), ('temperature_hbm_stacks', ctypes.c_uint16 * 12), diff --git a/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi.h b/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi.h index d91c079fec0a..474110270553 100644 --- a/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi.h +++ b/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi.h @@ -1520,8 +1520,8 @@ typedef struct { /* * v1.1 additions */ - uint32_t gfx_activity_acc; // new in v1 - uint32_t mem_activity_acc; // new in v1 + uint64_t gfx_activity_acc; // new in v1 + uint64_t mem_activity_acc; // new in v1 uint16_t temperature_hbm[RSMI_NUM_HBM_INSTANCES]; // new in v1 /* @@ -1589,10 +1589,10 @@ typedef struct { uint16_t jpeg_activity[RSMI_MAX_NUM_JPEG_ENGS]; // PCIE NAK sent accumulated count - uint32_t pcie_nak_sent_count_acc; + uint64_t pcie_nak_sent_count_acc; // PCIE NAK received accumulated count - uint32_t pcie_nak_rcvd_count_acc; + uint64_t pcie_nak_rcvd_count_acc; /* * v1.6 additions @@ -1646,7 +1646,7 @@ typedef struct { struct amdgpu_xcp_metrics_t xcp_stats[RSMI_MAX_NUM_XCP]; /* PCIE other end recovery counter */ - uint32_t pcie_lc_perf_other_end_recovery; + uint64_t pcie_lc_perf_other_end_recovery; /* * v1.7 additions diff --git a/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_dyn_gpu_metrics.h b/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_dyn_gpu_metrics.h index 194a18ba501d..fa2f123e4345 100644 --- a/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_dyn_gpu_metrics.h +++ b/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_dyn_gpu_metrics.h @@ -894,7 +894,7 @@ static const auto AMDGpuMetricsBaseSchema = details::AMDGpuMetricSchemaMapType_t details::AMDGpuMetricAttributeInstance_t( "GFX Activity Accumulator", "Accumulator for GFX activity percentage", details::AMDGpuMetricAttributeId_t::GFX_ACTIVITY_ACC, - details::AMDGpuMetricAttributeType_t::TYPE_UINT32, + details::AMDGpuMetricAttributeType_t::TYPE_UINT64, details::AMDGpuMetricUnitType_t::PERCENT), static_cast(0)}}, @@ -903,7 +903,7 @@ static const auto AMDGpuMetricsBaseSchema = details::AMDGpuMetricSchemaMapType_t details::AMDGpuMetricAttributeInstance_t( "Memory Activity Accumulator", "Accumulator for memory activity percentage", details::AMDGpuMetricAttributeId_t::MEM_ACTIVITY_ACC, - details::AMDGpuMetricAttributeType_t::TYPE_UINT32, + details::AMDGpuMetricAttributeType_t::TYPE_UINT64, details::AMDGpuMetricUnitType_t::PERCENT), static_cast(0)}}, @@ -957,7 +957,7 @@ static const auto AMDGpuMetricsBaseSchema = details::AMDGpuMetricSchemaMapType_t details::AMDGpuMetricAttributeInstance_t( "PCIe NAK Sent Count Accumulator", "Accumulator for PCIe NAK sent count", details::AMDGpuMetricAttributeId_t::PCIE_NAK_SENT_COUNT_ACC, - details::AMDGpuMetricAttributeType_t::TYPE_UINT32, + details::AMDGpuMetricAttributeType_t::TYPE_UINT64, details::AMDGpuMetricUnitType_t::COUNT_ACCUMULATOR), static_cast(0)}}, @@ -966,7 +966,7 @@ static const auto AMDGpuMetricsBaseSchema = details::AMDGpuMetricSchemaMapType_t details::AMDGpuMetricAttributeInstance_t( "PCIe NAK Received Count Accumulator", "Accumulator for PCIe NAK received count", details::AMDGpuMetricAttributeId_t::PCIE_NAK_RCVD_COUNT_ACC, - details::AMDGpuMetricAttributeType_t::TYPE_UINT32, + details::AMDGpuMetricAttributeType_t::TYPE_UINT64, details::AMDGpuMetricUnitType_t::COUNT_ACCUMULATOR), static_cast(0)}}, @@ -1061,7 +1061,7 @@ static const auto AMDGpuMetricsBaseSchema = details::AMDGpuMetricSchemaMapType_t details::AMDGpuMetricAttributeInstance_t( "PCIe LC Perf Other End Recovery", "PCIe link control performance other end recovery", details::AMDGpuMetricAttributeId_t::PCIE_LC_PERF_OTHER_END_RECOVERY, - details::AMDGpuMetricAttributeType_t::TYPE_UINT32, + details::AMDGpuMetricAttributeType_t::TYPE_UINT64, details::AMDGpuMetricUnitType_t::COUNT_ACCUMULATOR), static_cast(0)}}, diff --git a/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs b/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs index 473c9382b301..b617d4e68c0f 100644 --- a/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs +++ b/projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs @@ -137,6 +137,15 @@ pub const AMDSMI_DATE_FORMAT: &[u8; 35] = b"%04d-%02d-%02d:%02d:%02d:%02d.%03d\0 pub const AMDSMI_LIB_VERSION_MAJOR: u32 = 27; pub const AMDSMI_LIB_VERSION_MINOR: u32 = 0; pub const AMDSMI_LIB_VERSION_RELEASE: u32 = 0; +pub const AMDSMI_MAX_VF_COUNT: u32 = 32; +pub const AMDSMI_MAX_DRIVER_NUM: u32 = 2; +pub const AMDSMI_DFC_FW_NUMBER_OF_ENTRIES: u32 = 9; +pub const AMDSMI_MAX_WHITE_LIST_ELEMENTS: u32 = 16; +pub const AMDSMI_MAX_BLACK_LIST_ELEMENTS: u32 = 64; +pub const AMDSMI_MAX_TA_WHITE_LIST_ELEMENTS: u32 = 8; +pub const AMDSMI_MAX_ERR_RECORDS: u32 = 10; +pub const AMDSMI_MAX_PROFILE_COUNT: u32 = 16; +pub const AMDSMI_PF_INDEX: u32 = 31; pub const AMDSMI_MAX_DRIVER_INFO_RSVD: u32 = 64; pub const AMDSMI_MAX_UUID_ELEMENTS: u32 = 16; pub const AMDSMI_MAX_NUM_FREQUENCIES: u32 = 33; @@ -2931,8 +2940,8 @@ pub struct AmdsmiGpuMetricsT { pub current_fan_speed: u16, pub pcie_link_width: u16, pub pcie_link_speed: u16, - pub gfx_activity_acc: u32, - pub mem_activity_acc: u32, + pub gfx_activity_acc: u64, + pub mem_activity_acc: u64, pub temperature_hbm: [u16; 4usize], pub firmware_timestamp: u64, pub voltage_soc: u16, @@ -2956,8 +2965,8 @@ pub struct AmdsmiGpuMetricsT { pub current_vclk0s: [u16; 4usize], pub current_dclk0s: [u16; 4usize], pub jpeg_activity: [u16; 32usize], - pub pcie_nak_sent_count_acc: u32, - pub pcie_nak_rcvd_count_acc: u32, + pub pcie_nak_sent_count_acc: u64, + pub pcie_nak_rcvd_count_acc: u64, pub accumulation_counter: u64, pub prochot_residency_acc: u64, pub ppt_residency_acc: u64, @@ -2966,7 +2975,7 @@ pub struct AmdsmiGpuMetricsT { pub hbm_thm_residency_acc: u64, pub num_partition: u16, pub xcp_stats: [AmdsmiGpuXcpMetricsT; 8usize], - pub pcie_lc_perf_other_end_recovery: u32, + pub pcie_lc_perf_other_end_recovery: u64, pub vram_max_bandwidth: u64, pub xgmi_link_status: [u16; 8usize], pub temperature_hbm_stacks: [u16; 12usize], @@ -2978,7 +2987,7 @@ pub struct AmdsmiGpuMetricsT { } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of AmdsmiGpuMetricsT"][::std::mem::size_of::() - 4720usize]; + ["Size of AmdsmiGpuMetricsT"][::std::mem::size_of::() - 4736usize]; ["Alignment of AmdsmiGpuMetricsT"][::std::mem::align_of::() - 8usize]; ["Offset of field: AmdsmiGpuMetricsT::common_header"] [::std::mem::offset_of!(AmdsmiGpuMetricsT, common_header) - 0usize]; @@ -3045,91 +3054,91 @@ const _: () = { ["Offset of field: AmdsmiGpuMetricsT::gfx_activity_acc"] [::std::mem::offset_of!(AmdsmiGpuMetricsT, gfx_activity_acc) - 80usize]; ["Offset of field: AmdsmiGpuMetricsT::mem_activity_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, mem_activity_acc) - 84usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, mem_activity_acc) - 88usize]; ["Offset of field: AmdsmiGpuMetricsT::temperature_hbm"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_hbm) - 88usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_hbm) - 96usize]; ["Offset of field: AmdsmiGpuMetricsT::firmware_timestamp"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, firmware_timestamp) - 96usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, firmware_timestamp) - 104usize]; ["Offset of field: AmdsmiGpuMetricsT::voltage_soc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, voltage_soc) - 104usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, voltage_soc) - 112usize]; ["Offset of field: AmdsmiGpuMetricsT::voltage_gfx"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, voltage_gfx) - 106usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, voltage_gfx) - 114usize]; ["Offset of field: AmdsmiGpuMetricsT::voltage_mem"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, voltage_mem) - 108usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, voltage_mem) - 116usize]; ["Offset of field: AmdsmiGpuMetricsT::indep_throttle_status"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, indep_throttle_status) - 112usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, indep_throttle_status) - 120usize]; ["Offset of field: AmdsmiGpuMetricsT::current_socket_power"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_socket_power) - 120usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_socket_power) - 128usize]; ["Offset of field: AmdsmiGpuMetricsT::vcn_activity"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, vcn_activity) - 122usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, vcn_activity) - 130usize]; ["Offset of field: AmdsmiGpuMetricsT::gfxclk_lock_status"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, gfxclk_lock_status) - 132usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, gfxclk_lock_status) - 140usize]; ["Offset of field: AmdsmiGpuMetricsT::xgmi_link_width"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_link_width) - 136usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_link_width) - 144usize]; ["Offset of field: AmdsmiGpuMetricsT::xgmi_link_speed"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_link_speed) - 138usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_link_speed) - 146usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_bandwidth_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_bandwidth_acc) - 144usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_bandwidth_acc) - 152usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_bandwidth_inst"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_bandwidth_inst) - 152usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_bandwidth_inst) - 160usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_l0_to_recov_count_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_l0_to_recov_count_acc) - 160usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_l0_to_recov_count_acc) - 168usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_replay_count_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_replay_count_acc) - 168usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_replay_count_acc) - 176usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_replay_rover_count_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_replay_rover_count_acc) - 176usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_replay_rover_count_acc) - 184usize]; ["Offset of field: AmdsmiGpuMetricsT::xgmi_read_data_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_read_data_acc) - 184usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_read_data_acc) - 192usize]; ["Offset of field: AmdsmiGpuMetricsT::xgmi_write_data_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_write_data_acc) - 248usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_write_data_acc) - 256usize]; ["Offset of field: AmdsmiGpuMetricsT::current_gfxclks"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_gfxclks) - 312usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_gfxclks) - 320usize]; ["Offset of field: AmdsmiGpuMetricsT::current_socclks"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_socclks) - 328usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_socclks) - 336usize]; ["Offset of field: AmdsmiGpuMetricsT::current_vclk0s"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_vclk0s) - 336usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_vclk0s) - 344usize]; ["Offset of field: AmdsmiGpuMetricsT::current_dclk0s"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_dclk0s) - 344usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_dclk0s) - 352usize]; ["Offset of field: AmdsmiGpuMetricsT::jpeg_activity"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, jpeg_activity) - 352usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, jpeg_activity) - 360usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_nak_sent_count_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_nak_sent_count_acc) - 416usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_nak_sent_count_acc) - 424usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_nak_rcvd_count_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_nak_rcvd_count_acc) - 420usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_nak_rcvd_count_acc) - 432usize]; ["Offset of field: AmdsmiGpuMetricsT::accumulation_counter"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, accumulation_counter) - 424usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, accumulation_counter) - 440usize]; ["Offset of field: AmdsmiGpuMetricsT::prochot_residency_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, prochot_residency_acc) - 432usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, prochot_residency_acc) - 448usize]; ["Offset of field: AmdsmiGpuMetricsT::ppt_residency_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, ppt_residency_acc) - 440usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, ppt_residency_acc) - 456usize]; ["Offset of field: AmdsmiGpuMetricsT::socket_thm_residency_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, socket_thm_residency_acc) - 448usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, socket_thm_residency_acc) - 464usize]; ["Offset of field: AmdsmiGpuMetricsT::vr_thm_residency_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, vr_thm_residency_acc) - 456usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, vr_thm_residency_acc) - 472usize]; ["Offset of field: AmdsmiGpuMetricsT::hbm_thm_residency_acc"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, hbm_thm_residency_acc) - 464usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, hbm_thm_residency_acc) - 480usize]; ["Offset of field: AmdsmiGpuMetricsT::num_partition"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, num_partition) - 472usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, num_partition) - 488usize]; ["Offset of field: AmdsmiGpuMetricsT::xcp_stats"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, xcp_stats) - 480usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, xcp_stats) - 496usize]; ["Offset of field: AmdsmiGpuMetricsT::pcie_lc_perf_other_end_recovery"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_lc_perf_other_end_recovery) - 4640usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, pcie_lc_perf_other_end_recovery) - 4656usize]; ["Offset of field: AmdsmiGpuMetricsT::vram_max_bandwidth"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, vram_max_bandwidth) - 4648usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, vram_max_bandwidth) - 4664usize]; ["Offset of field: AmdsmiGpuMetricsT::xgmi_link_status"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_link_status) - 4656usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, xgmi_link_status) - 4672usize]; ["Offset of field: AmdsmiGpuMetricsT::temperature_hbm_stacks"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_hbm_stacks) - 4672usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_hbm_stacks) - 4688usize]; ["Offset of field: AmdsmiGpuMetricsT::temperature_mid"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_mid) - 4696usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_mid) - 4712usize]; ["Offset of field: AmdsmiGpuMetricsT::temperature_aid"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_aid) - 4700usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, temperature_aid) - 4716usize]; ["Offset of field: AmdsmiGpuMetricsT::current_uclk_aid"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_uclk_aid) - 4704usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_uclk_aid) - 4720usize]; ["Offset of field: AmdsmiGpuMetricsT::current_socclks_mid"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_socclks_mid) - 4708usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, current_socclks_mid) - 4724usize]; ["Offset of field: AmdsmiGpuMetricsT::apu_metrics"] - [::std::mem::offset_of!(AmdsmiGpuMetricsT, apu_metrics) - 4712usize]; + [::std::mem::offset_of!(AmdsmiGpuMetricsT, apu_metrics) - 4728usize]; }; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -4073,6 +4082,12 @@ extern "C" { gpu_busy_percent: *mut u32, ) -> AmdsmiStatusT; } +extern "C" { + pub fn amdsmi_get_vcn_busy_percent( + processor_handle: AmdsmiProcessorHandle, + vcn_busy_percent: *mut u32, + ) -> AmdsmiStatusT; +} extern "C" { pub fn amdsmi_get_utilization_count( processor_handle: AmdsmiProcessorHandle, diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 389ae113a671..0e99da000949 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -5682,23 +5682,8 @@ amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, info->pcie_metric.pcie_replay_count = metric_info.pcie_replay_count_acc; info->pcie_metric.pcie_l0_to_recovery_count = metric_info.pcie_l0_to_recov_count_acc; info->pcie_metric.pcie_replay_roll_over_count = metric_info.pcie_replay_rover_count_acc; - /** - * pcie_metric.pcie_nak_received_count: (uint64_t) - * metric_info.pcie_nak_rcvd_count_acc: (uint32_t) - */ - info->pcie_metric.pcie_nak_received_count = - translate_umax_or_assign_valuepcie_metric.pcie_nak_received_count)>( - metric_info.pcie_nak_rcvd_count_acc, (metric_info.pcie_nak_rcvd_count_acc)); - /** - * pcie_metric.pcie_nak_sent_count: (uint64_t) - * metric_info.pcie_nak_sent_count_acc: (uint32_t) - */ - info->pcie_metric.pcie_nak_sent_count = - translate_umax_or_assign_valuepcie_metric.pcie_nak_sent_count)>( - metric_info.pcie_nak_sent_count_acc, (metric_info.pcie_nak_sent_count_acc)); - /** - * pcie_metric.pcie_lc_perf_other_end_recovery: (uint32_t) - */ + info->pcie_metric.pcie_nak_received_count = metric_info.pcie_nak_rcvd_count_acc; + info->pcie_metric.pcie_nak_sent_count = metric_info.pcie_nak_sent_count_acc; info->pcie_metric.pcie_lc_perf_other_end_recovery_count = translate_umax_or_assign_value< decltype(info->pcie_metric.pcie_lc_perf_other_end_recovery_count)>( metric_info.pcie_lc_perf_other_end_recovery, (metric_info.pcie_lc_perf_other_end_recovery));