Conversation
Some GPUs (e.g. older Vega 20 / Instinct datacenter cards) expose an old gpu_metrics_v1 structure that is smaller than gpu_metrics_v1_3, which is the smallest version MangoHud can parse. Previously the AMDGPU monitor marked gpu_metrics as valid purely based on whether the sysfs file existed and was readable, then overwrote the good hwmon values (gpu_busy_percent and power1_input) with zeros because the metrics read returned early without populating the fields. Validate the metrics header (structure_size against the version we can read) in the constructor and mark gpu_metrics as invalid when it is not supported, so MangoHud correctly falls back to the hwmon sysfs nodes.
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.
Problem
On some AMD GPUs - notably older Vega 20 / datacenter (Instinct) cards such as the Radeon Instinct MI50 / Radeon Pro VII (device id
0x66a1) - MangoHud shows GPU load at 0% and power at 0W permanently.Root cause
These cards expose a
gpu_metricssysfs file in the old v1 format that is smaller thangpu_metrics_v1_3(the smallest version MangoHud knows how to parse). On this hardware:gpu_metricsfile existed and was readable to setgpu_metrics_is_valid = true.get_instant_metrics(src/amdgpu.cpp), reading a v1 file that is too small returns early without populating the fields, leavinggpu_load_percentandaverage_gfx_power_wat 0.gpu_metrics_is_validwas stilltrue,metrics_polling_threadthen overwrote the correct hwmon values (gpu_busy_percentandpower1_input) with those zeros.Fix
In the
AMDGPUconstructor, read the metrics header and validatestructure_sizeagainst the largest version we can actually parse. If the version is not supported (e.g. old v1 smaller than v1_3), markgpu_metrics_is_valid = falseso MangoHud falls back to the working hwmon sysfs nodes (gpu_busy_percentfor load andpower1_inputfor power).Verified on an Instinct MI50: GPU load and power now report real values instead of 0.
Notes
gpu_metricsversion).