[AUTO] Add GPUUtilization fallback for iGPU telemetry key - #37390
[AUTO] Add GPUUtilization fallback for iGPU telemetry key#37390wgzintel wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a fallback so integrated GPU utilization isn’t dropped when platforms report it under an alternate telemetry key.
Changes:
- Introduces a
GPUUtilizationmetric constant to use as a fallback for iGPU utilization. - Updates telemetry parsing to look up
IGPUUtilization, then fall back toGPUUtilizationwhen absent.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/plugins/auto/src/utils/device_telemetry.hpp | Adds a fallback metric key constant for iGPU utilization. |
| src/plugins/auto/src/utils/device_telemetry.cpp | Implements fallback lookup logic when parsing the Performance section. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/plugins/auto/src/utils/device_telemetry.cpp:90
metric_keyis always the originally requested key (e.g.,"IGPUUtilization"), so if the fallback key ("GPUUtilization") is used successfully, the “not a number” warning will incorrectly report the primary key. Consider logging the actual resolved JSON key (e.g.,metric_it.key()) in these warnings (and any downstream logs that include the key), so troubleshooting reflects what was actually read.
if (!metric_it->is_number()) {
LOG_WARNING_TAG("TelemetryClient: Performance value for key %s is not a number", metric_key.c_str());
return std::nullopt;
}
float value = metric_it->get<float>();
src/plugins/auto/src/utils/device_telemetry.cpp:74
- The function-local
static const std::stringis a bit unexpected here and can obscure intent (and introduces a one-time initialization path). A simpler approach is to construct a localstd::string(or, if supported by your JSON library version, pass astd::string_viewdirectly) when the fallback branch is taken. This keeps the lookup logic straightforward and avoids retaining an extra static object for the process lifetime.
if (igpu_fallback_attempted) {
static const std::string igpu_fallback_key{k_igpu_utilization_fallback_metric};
metric_it = performance.find(igpu_fallback_key);
}
Details:
The integrated GPU utilization may be reported under either "IGPUUtilization" or "GPUUtilization" depending on the platform.
Fall back to "GPUUtilization" when "IGPUUtilization" is absent, so iGPU utilization is not silently dropped.