Skip to content

GPUOP-880: SR-IOV GIM host-side metric coverage (Phase A 8.7 + Phase …#76

Open
bhatturu wants to merge 1 commit into
ROCm:mainfrom
bhatturu:feat/gpuop-880-sriov-gim-coverage
Open

GPUOP-880: SR-IOV GIM host-side metric coverage (Phase A 8.7 + Phase …#76
bhatturu wants to merge 1 commit into
ROCm:mainfrom
bhatturu:feat/gpuop-880-sriov-gim-coverage

Conversation

@bhatturu

@bhatturu bhatturu commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

…B 9.0.0.K)

  • gimamdsmi stream walker (smi_walk_gpu_metrics) decodes the variable-length amdsmi_metric_t[] stream for clocks, temps, power, usage, and the throttle/violation accumulated counters (GIM has no fixed-struct amdsmi_get_gpu_metrics_info)
  • GIM SMI lib uplifted 8.7.0.K -> 9.0.0.K (prochot/ppt throttle cases)
  • accumulated counters only: the GIM stream carries no per_* violation percentages, so they are left at the sentinel (never derived) and DME suppresses them as unsupported
  • UBB node power cap resolved via dlsym on npm APIs, skipped gracefully on older GIM runtime libs; ubb_power left unset where unsupported
  • gpuagent_gim_mock build target with mock amdsmi_get_gpu_metrics, node_handle/npm_info and bad_page_info stubs

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@bhatturu bhatturu force-pushed the feat/gpuop-880-sriov-gim-coverage branch from eb9df44 to 5266a98 Compare July 7, 2026 22:46
std::unique_ptr<amdsmi_metric_t[]> *heap,
amdsmi_metric_t **out_buf, uint32_t *out_count)
{
amdsmi_status_t amdsmi_ret;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow ascending len declaration uint32_t count = 0; to the top

amdsmi_metric_t buf_stack[kStackMax];
std::unique_ptr<amdsmi_metric_t[]> buf_heap;
amdsmi_metric_t *buf = nullptr;
uint32_t count = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@bhatturu bhatturu force-pushed the feat/gpuop-880-sriov-gim-coverage branch from 5266a98 to bf8969a Compare July 7, 2026 23:18
amdsmi_gpu_metrics_t metrics_info = {};
amdsmi_gpu_metrics_t cached_metrics = {};
amdsmi_power_info_t power_info = {};
amdsmi_node_handle node_handle = {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variables should be in increasing order of line width

@bhatturu bhatturu force-pushed the feat/gpuop-880-sriov-gim-coverage branch 5 times, most recently from a37eaa1 to f1a906a Compare July 10, 2026 17:02
@bhatturu bhatturu force-pushed the feat/gpuop-880-sriov-gim-coverage branch from f1a906a to e0e461f Compare July 10, 2026 21:35
amdsmi_power_info_t power_info = {};
amdsmi_engine_usage_t usage_info = {};
amdsmi_node_handle node_handle = {};
amdsmi_npm_info_t npm_info = {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable ordering is incorrect

gpu_handle, amdsmi_ret);
return amdsmi_ret_to_sdk_ret(amdsmi_ret);
}
if (count > AGA_GIM_MAX_METRICS) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this check again? Does the count get set when metrics list is not null?

idx = m.res_instance;

if (unlikely(debug)) {
AGA_TRACE_ERR("gim_metrics GPU {} name {} val {} flags {} inst {}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a DEBUG log

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need an env variable? Can't we make it a VERBOSE log?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants