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.39k stars 282 forks source link

Offer a variable `nvme_temp` #848

Open subworx opened 1 year ago

subworx commented 1 year ago

Hi,

on the Steam Deck with the current updated fan curve, the NVMe SSD gets polled very often and heats up, leading to sudden fan spikes.

This temperature is only visible using sensors on the command line. It would be nice if MangoHud could add a variable like nvme_temp or ssd_temp that could be displayed in the maximum details view on the Deck.

Thanks.

H34dl3ss commented 1 year ago

You can use the existing settings to pull the sensors value. Some months ago, sensors could not read nvme temps. Even smartmontools didn't work. By that time I set up a script that parsed the output of nvme-cli and wrote the information to a temp file. Then I would cat the content with the exec function of mangohud.

legacy_layout=0 exec=cat nvmetemps.log

The issue here is that smartmontools as well as nvme-cli need elevated priviliges to run. sensorsdon't need afaik and therefore I will reworkmy script soon - just need some time to do so. I thought of exporting the information to a system variable and use something like exec=echo "$nvmetemp1"

Hopefully echo and system variables ar no problem with mangohud - need testing.

Since this kind of workaround exists already, I doubt that there will be specific variable available from mangohud side.

I will upload the script to my git once I have it running.

flightlessmango commented 1 year ago

on the Steam Deck with the current updated fan curve, the NVMe SSD gets polled very often and heats up, leading to sudden fan spikes.

This is true and by adding this to mangohud we'd be contributing to the problem. Which seems bad to me

H34dl3ss commented 1 year ago

@flightlessmango Do you really think that polling the temperatures will significantly increase the load on the drives?

@topic I tried to echo an environmental variable e.g. $HOSTNAME but it is not working. Mangohud is probably not using the user environment. Any advice how to pass a variable to the environment of mangohud?

But this simple line shows the composite temps of all NVMe drives without the need of elevated permission. exec=sensors | grep -E -o "Composite.{0,12}"

It's not fancy if one has multiple drives but building a human readable list with the disk names associated to each temp requires additional code and most likely elevated rights for some commands like fdisk.

H34dl3ss commented 1 year ago

For some reason the solution above stopped working. In a shell sensors | grep -E -o "Composite.{0,12}" is still working, but the HUD will not display the output.

Any advice how to trouble shoot this issue is very welcome.

benjamimgois commented 1 year ago

For some reason the solution above stopped working. In a shell sensors | grep -E -o "Composite.{0,12}" is still working, but the HUD will not display the output.

Any advice how to trouble shoot this issue is very welcome.

I could add this custom script in Goverlay. it might not be a big problem on desktops. I think...

Did some modifications to cleanup the end result:

custom_text=NVME:
exec=sensors | grep -E -o "Composite.{0,12}" | cut -c 15-22

image

H34dl3ss commented 1 year ago

Thanks for the cleanup @benjamimgois

I would really appreciate some help to get this to work again. I tried to get more info, but I have little knowledge how mangohud works: Running mangohud glxgears works as expected. 2022-12-03 15-05-07

But in steam, the overlay doesn't display the output of the exec= 2022-12-03 15-34-39

exec=echo "some text" is working. The sensors query is not.

VladimirMrzv commented 1 year ago

It is working on native linux games, but not in proton

flightlessmango commented 1 year ago

Probably because the steam runtime container doesn't have access to the sensors binary. Would need to write a script that find the hwmon sysfs node instead

H34dl3ss commented 1 year ago

Probably because the steam runtime container doesn't have access to the sensors binary. Would need to write a script that find the hwmon sysfs node instead

How can I test/confirm if that is the reason?

flightlessmango commented 1 year ago

How can I test/confirm if that is the reason?

If you add PRESSURE_VESSEL_SHELL=instead %command% to the launch options of game, it won't start the game and instead open up a terminal that's inside the container. This allows you to see what the container has access too

subworx commented 1 year ago

bash: sensors: command not found. echo $PATH /usr/bin:/bin:/home/deck/stl/prefix

H34dl3ss commented 1 year ago

Yes, I have the same: bash: sensors: command not found whereis sensors sensors: /etc/sensors3.conf /etc/sensors.d /usr/etc/sensors.d /usr/etc/sensors3.conf

The /usr/bin inside the container contains some binaries already. Is there a way to copy or symlink the hosts sensors into the container? (as a band aid)

flightlessmango commented 1 year ago

You can make an issue on the runtime repo and make a case for it's inclusion

maslomeister commented 2 months ago

I was searching how i can monitor my SSD temps and this issue led me to believe that i wouldn't be able to get the sensors reading inside of gamemode, i've tried it anyway and it works with steam os 3.5.19 and flatpak installed image

flightlessmango commented 2 months ago

It's possible this now works with a change in mangohud, but it might requires the host to have flatpak installed