Skip to content

Fix/nvml struct#637

Merged
markgalvan-intel merged 2 commits into
mainfrom
fix/nvml-struct
Jun 3, 2026
Merged

Fix/nvml struct#637
markgalvan-intel merged 2 commits into
mainfrom
fix/nvml-struct

Conversation

@planetchili
Copy link
Copy Markdown
Collaborator

Undo nvAPI mismatch workaround, make header dependency explicit/order independent (GHCP-suggested edits from granular telemetry PR).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes NVML memory reporting by removing a legacy workaround and making NVML struct layout consistent with the real NVML ABI, while also tightening up reflection helper header includes so they’re explicit and order-independent.

Changes:

  • Correct nvmlMemory_t field order to { total, free, used } and update generated dump output to match.
  • Remove the “legacy total memory” workaround and use memoryInfo.total consistently for PM_METRIC_GPU_MEM_SIZE / utilization calculations.
  • Add missing standard library includes to GeneratedReflectionHelpers.h to avoid relying on transitive includes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
IntelPresentMon/ControlLib/nvml/NvmlTelemetryProvider.h Renames helper to GetTotalMemoryBytes_() to reflect correct NVML semantics.
IntelPresentMon/ControlLib/nvml/NvmlTelemetryProvider.cpp Uses memoryInfo.total for total VRAM and updates all call sites accordingly.
IntelPresentMon/ControlLib/nvml/nvml.h Fixes nvmlMemory_t field order to match NVML ABI expectations.
IntelPresentMon/CommonUtilities/ref/GeneratedReflectionHelpers.h Adds explicit STL includes needed by the helpers (e.g., <format>, <sstream>, type traits).
IntelPresentMon/CommonUtilities/ref/gen/GeneratedReflection.h Updates nvmlMemory_t dumper output ordering to match the corrected struct layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@markgalvan-intel markgalvan-intel left a comment

Choose a reason for hiding this comment

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

Looks great!

@markgalvan-intel markgalvan-intel merged commit 5ade52e into main Jun 3, 2026
1 check passed
@markgalvan-intel markgalvan-intel deleted the fix/nvml-struct branch June 3, 2026 00:54
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