fix(amdgpu): force sysfs hwmon only for Vega20/MI50 metrics#2089
Open
johncoffee715 wants to merge 2 commits into
Open
fix(amdgpu): force sysfs hwmon only for Vega20/MI50 metrics#2089johncoffee715 wants to merge 2 commits into
johncoffee715 wants to merge 2 commits into
Conversation
The SMU gpu_metrics binary blob returns incorrect values (zeroed or exorbitant) on AMD Radeon Pro VII / MI50 (Vega 20, PCI ID 0x66A1). This forces gpu_metrics_is_valid=false so MangoHud reads exclusively from sysfs hwmon — the same data source amdgpu_top uses successfully. All GPU metrics remain available via sysfs: - gpu_busy_percent (load) - hwmon: freq1/2_input (clocks), temp1/2/3_input (edge/junction/mem) - hwmon: power1_input/cap (power), fan1_input (fan), in0_input (voltage) - mem_info_vram_total/used (VRAM) Only throttle status is lost (minor, gpu_metrics-only field). Tested on: AMD Radeon Pro VII (Vega 20), CachyOS Linux, kernel 6.x
f44d9be to
f3f1d45
Compare
On Intel CPUs, /sys/class/powercap/intel-rapl:0/energy_uj is 0400 root:root by default. MangoHud needs read access to this file to compute CPU power consumption via RAPL energy delta. This udev rule makes energy_uj readable by the video group (which most desktop Linux users belong to), fixing the missing CPU power watts in the MangoHud overlay. Install with: sudo contrib/install-rapl-fix.sh Tested on: Intel Xeon E5-2699 v3, CachyOS Linux
Author
Update: Added RAPL debug logging + powercap udev ruleTwo additional commits pushed: 1. RAPL debug logging (
|
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.
Bug
MangoHud 0.8.4 displays incorrect GPU metrics (zeroed or exorbitant values) on AMD Radeon Pro VII / MI50 (Vega 20, PCI ID 0x66A1).
Root cause
The SMU
gpu_metricsbinary blob (/sys/bus/pci/devices/0000:05:00.0/gpu_metrics) returns incorrect values on Vega 20 / gfx906. Thegpu_metricsfile exists and is readable, sogpu_metrics_is_validis set totrue, but the data inside (temperatures, clocks, power, fan speed) is unreliable.The code in
amdgpu.cppthen overrides the correct sysfs hwmon values with the incorrect gpu_metrics values:Fix
Force
gpu_metrics_is_valid = falseso MangoHud reads exclusively from sysfs hwmon — the same data sourceamdgpu_topuses successfully on this hardware.Verification
amdgpu_top0.11.5 reads all metrics correctly via DRM ioctl + sysfs hwmon on this GPU/sys/bus/pci/devices/0000:05:00.0/hwmon/hwmon0/)gpu_busy_percent,freq1/2_input,temp1/2/3_input,power1_input/cap,fan1_input,in0_input,mem_info_vram_total/usedTest environment
amdgpu_top0.11.5 confirms all sysfs hwmon sensors return correct valuesAlternative approach
Instead of hardcoding
false, a config option (amdgpu_sysfs_only) or a device ID allowlist could be added. I chose the simple approach because Vega 20 is the only known affected ASIC, and the sysfs hwmon path is strictly more reliable on this hardware.