Fix/nvml struct#637
Merged
Merged
Conversation
There was a problem hiding this comment.
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_tfield order to{ total, free, used }and update generated dump output to match. - Remove the “legacy total memory” workaround and use
memoryInfo.totalconsistently forPM_METRIC_GPU_MEM_SIZE/ utilization calculations. - Add missing standard library includes to
GeneratedReflectionHelpers.hto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Undo nvAPI mismatch workaround, make header dependency explicit/order independent (GHCP-suggested edits from granular telemetry PR).