Skip to content

ROCM-26020: read render-node-opening GPU config once at create time; …#80

Merged
sarat-k merged 1 commit into
ROCm:mainfrom
bhatturu:fix/rocm-26020-skip-suspended-render-open
Jul 21, 2026
Merged

ROCM-26020: read render-node-opening GPU config once at create time; …#80
sarat-k merged 1 commit into
ROCm:mainfrom
bhatturu:fix/rocm-26020-skip-suspended-render-open

Conversation

@bhatturu

Copy link
Copy Markdown
Contributor

…drop UBB node power

On discrete RDNA/Navi GPUs with functional PCIe runtime PM, an idle GPU runtime-suspends to D3. Several amdsmi info APIs called per GpuGet open /dev/dri/renderD* (amdsmi_get_gpu_overdrive_level via the RSMI DRM path in smi_gpu_fill_spec, the voltage-curve / enumeration-id reads in smi_gpu_fill_status, and amdsmi_get_node_handle -> amdsmi_get_gpu_asic_info in smi_gpu_fill_stats). The amdgpu DRM .open fop runs pm_runtime_get_sync(), forcing a D3->D0 resume just to read static config; the SMU then reports a stale-high gfx_activity/clock for ~9-15s (the cold-read spike).

Move the render-node-opening static reads (overdrive/perf/power-cap, voltage curve, enumeration ids) out of the per-GpuGet path into smi_gpu_init_immutable_attrs (read once at create). The GPUUpdate handler writes a successful set back into the cached spec so config changes still surface without an agent restart. The per-query path now only issues amdsmi_get_gpu_metrics_info, which reads gpu_metrics sysfs and returns BUSY (no wake) on a suspended GPU.

Also drop the UBB node power / node-power-cap reads (amdsmi_get_power_info ubb_power, amdsmi_get_node_handle, amdsmi_get_npm_info) from both the baremetal (amdsmi) and SR-IOV (gimamdsmi) paths: amdsmi_get_node_handle opens the render node (another idle waker), and the UBB metrics were unreliable. The gimamdsmi power_info call is retained for package power and voltages.

No-op on Instinct MI2xx/MI3xx, which have no independent GPU runtime suspend.

Verified on Navi48 (8x R9700S, runpm=1): suspended GPUs now show 0 render-node opens and 0 wakes on a GpuGet (was 24 opens / 8 wakes), no cold-read spike (gfx 0-6, clock ~15-50MHz vs stale 60-77% / 1800MHz); active and under-load values unchanged; no ubb metrics emitted; no crash.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@bhatturu
bhatturu force-pushed the fix/rocm-26020-skip-suspended-render-open branch 4 times, most recently from cea5062 to d290b08 Compare July 21, 2026 15:11
g_gpu_metrics[gpu_handle] = metrics_info;
}
}
// overdrive/perf/power-cap read once at create (smi_gpu_fill_config_ via

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.

say that the cached value is updated whenever value is updated


// config read once at create; keeps the per-GpuGet path off the render node
static void
smi_gpu_fill_config_ (aga_gpu_handle_t gpu_handle, aga_gpu_spec_t *spec,

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.

init_config_. Also fix the comment format for the function. Mention clearly the values are cached and cached values are updated during updates

@bhatturu
bhatturu force-pushed the fix/rocm-26020-skip-suspended-render-open branch 3 times, most recently from 01d867c to e93a6fa Compare July 21, 2026 20:49
…drop UBB node power

On discrete RDNA/Navi GPUs with functional PCIe runtime PM, an idle GPU
runtime-suspends to D3. Several amdsmi info APIs called per GpuGet open
/dev/dri/renderD* (amdsmi_get_gpu_overdrive_level via the RSMI DRM path in
smi_gpu_fill_spec, the voltage-curve / enumeration-id reads in
smi_gpu_fill_status, and amdsmi_get_node_handle -> amdsmi_get_gpu_asic_info
in smi_gpu_fill_stats). The amdgpu DRM .open fop runs pm_runtime_get_sync(),
forcing a D3->D0 resume just to read static config; the SMU then reports a
stale-high gfx_activity/clock for ~9-15s (the cold-read spike).

Move the render-node-opening static reads (overdrive/perf/power-cap,
voltage curve, enumeration ids) out of the per-GpuGet path into
smi_gpu_init_immutable_attrs (read once at create). The GPUUpdate handler
writes a successful set back into the cached spec so config changes still
surface without an agent restart. The per-query path now only issues
amdsmi_get_gpu_metrics_info, which reads gpu_metrics sysfs and returns BUSY
(no wake) on a suspended GPU.

Also drop the UBB node power / node-power-cap reads (amdsmi_get_power_info
ubb_power, amdsmi_get_node_handle, amdsmi_get_npm_info) from both the
baremetal (amdsmi) and SR-IOV (gimamdsmi) paths: amdsmi_get_node_handle
opens the render node (another idle waker), and the UBB metrics were
unreliable. The gimamdsmi power_info call is retained for package power and
voltages.

No-op on Instinct MI2xx/MI3xx, which have no independent GPU runtime suspend.

Verified on Navi48 (8x R9700S, runpm=1): suspended GPUs now show 0
render-node opens and 0 wakes on a GpuGet (was 24 opens / 8 wakes), no
cold-read spike (gfx 0-6, clock ~15-50MHz vs stale 60-77% / 1800MHz);
active and under-load values unchanged; no ubb metrics emitted; no crash.
@bhatturu
bhatturu force-pushed the fix/rocm-26020-skip-suspended-render-open branch from e93a6fa to 653c975 Compare July 21, 2026 22:00

@rsrikanth86 rsrikanth86 left a comment

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.

lgtm

@sarat-k sarat-k left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@sarat-k
sarat-k merged commit 7e5057a into ROCm:main Jul 21, 2026
1 check passed
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