Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions projects/amdsmi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
Expand Down
10 changes: 5 additions & 5 deletions projects/amdsmi/include/amd_smi/amdsmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions projects/amdsmi/py-interface/amdsmi_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions projects/amdsmi/py-interface/amdsmi_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down
10 changes: 5 additions & 5 deletions projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<details::AMDGpuMetricAttributeValue_t>(0)}},

Expand All @@ -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<details::AMDGpuMetricAttributeValue_t>(0)}},

Expand Down Expand Up @@ -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<details::AMDGpuMetricAttributeValue_t>(0)}},

Expand All @@ -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<details::AMDGpuMetricAttributeValue_t>(0)}},

Expand Down Expand Up @@ -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<details::AMDGpuMetricAttributeValue_t>(0)}},

Expand Down
Loading
Loading