flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.28k stars 272 forks source link

MangoHud git is showing above 100% fan RPM in horizontal mode #1241

Closed mmbossoni closed 6 months ago

mmbossoni commented 6 months ago

Describe the bug Mangohud is showing fan rpm with a % symbol even though the value seems to be the actual RPM, not the percentage

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior:

  1. Add gpu_fan into config

Expected behavior Either show RPM without % or show the actual percentage value

mmbossoni commented 6 months ago

Screenshot_20240218_112027 MangoHud.conf.tar.gz

Contez commented 6 months ago

I'm not sure if it can be of help, but from a quick search it seems that in ./src/hud_elements.cpp, from line 250

       if (HUDElements.vendorID == 0x1002 || HUDElements.vendorID == 0x10de){
            if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_gpu_fan] && cpuStats.cpu_type != "APU"){
                ImguiNextColumnOrNewRow();
                right_aligned_text(text_color, HUDElements.ralign_width, "%i", gpu_info.fan_speed);
                ImGui::SameLine(0, 1.0f);
                if (gpu_info.fan_rpm) {
                    ImGui::PushFont(HUDElements.sw_stats->font1);
                    HUDElements.TextColored(HUDElements.colors.text, "RPM");
                } else if (HUDElements.vendorID == 0x1002) {
                    HUDElements.TextColored(HUDElements.colors.text, "%%");
                    ImGui::PushFont(HUDElements.sw_stats->font1);
                    ImGui::SameLine(0, 1.0f);
                    HUDElements.TextColored(HUDElements.colors.text, "FAN");
                }
                ImGui::PopFont();
            }
        }

So the value unit is set as percentage if the vendor ID is set to AMD (0x1002) or the variable gpu_info.fan_rpm is not set to true in file ./src/gpu.cpp, which for AMD GPUs would be this block below from line 123

    if (amdgpu.fan) {
        rewind(amdgpu.fan);
        fflush(amdgpu.fan);
        if (fscanf(amdgpu.fan, "%" PRId64, &value) != 1)
            value = 0;
        gpu_info.fan_speed = value;
        gpu_info.fan_rpm = true;
    }
flightlessmango commented 6 months ago

I had made a mistake when rewriting this, this should resolve it c80c2093cc20a574e55e815d23f0076c0c80b6a1

mmbossoni commented 6 months ago

Just tested new arch packages Fan still append % for RPM

Contez commented 6 months ago

Just tested new arch packages Fan still append % for RPM

@mmbossoni is the version you tested already compiled from HEAD, with the latest commit? From Arch repository I see that it is still the last release, uploaded on 8th of February.

mmbossoni commented 6 months ago

Yes, it is. I use mangohud-git package (from AUR)

Contez commented 6 months ago

Yes, it is. I use mangohud-git package (from AUR)

Unless I'm missing something (which is totally possible😉 ) mangohud-git is a bunch of commits behind, specifically, as of today, still at commit 48d8426 from Feb 7th, so not aligned with the lastest commit.

mmbossoni commented 6 months ago

-git packages on aur work a bit differently Every time you rebuild it, it will checkout the latest commit and build from there. So the commit you see on the package isn't actually the commit it will build Maintainers only update the commit when they need to change the spec (PKGBUILD) file due to some dependency change My mango built yesterday have version (mangohud-git 0.7.1.r12.gc80c209-1), that matches c80c209 commit

Contez commented 6 months ago

Understood, thank you for the explanation.I am not familiar with Arch and AUR, so I was not aware of that, good to know. 😉… and it seems the issue still persists then.On 20 Feb 2024, at 17.56, mmbossoni @.***> wrote: -git packages on aur work a bit differently Every time you rebuild it, it will checkout the latest commit and build from there. So the commit you see on the package isn't actually the commit it will build Maintainers only update the commit when they need to change the spec (PKGBUILD) file due to some dependency change

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

flightlessmango commented 6 months ago

does this resolve it ? 98e442ba7f860de493a1b48460ef5398715bde2a

mmbossoni commented 6 months ago

Yes, that fixes it