Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pleas make lm-sensors available in runtime environment #557

Open
2 tasks done
H34dl3ss opened this issue Jan 24, 2023 · 5 comments
Open
2 tasks done

Pleas make lm-sensors available in runtime environment #557

H34dl3ss opened this issue Jan 24, 2023 · 5 comments

Comments

@H34dl3ss
Copy link

Feature Request

I confirm:

  • that I haven't found another request for this feature.
  • that I have checked whether there are updates for my system available that
    contain this feature already.

Description

Please include the lm-sensors binary so we are able to display additional sensor information in MangoHud.

References [optional]

flightlessmango/MangoHud#848

@kisak-valve kisak-valve transferred this issue from ValveSoftware/Proton Jan 24, 2023
@smcv
Copy link
Contributor

smcv commented Jan 25, 2023

Where does lm-sensors get its information from? Adding executables to the container doesn't add value unless they have everything they need to do their job. In the case of lm-sensors, does that mean /sys, or /dev, or somewhere else? Does it have/need configuration?

Running a command-line program with human-readable output, and screen-scraping its output with grep or similar, is an inefficient and fragile way to get information, particularly if it's being done every few frames in something like MangoHud: launching an executable (or multiple executables for a shell pipeline) involves a lot more syscalls and I/O than calling a function, and small changes to the formatting of human-readable text can easily break field extraction.

In general I'd prefer it if tools like MangoHud were using a programmatic interface like libsensors - although the ABI of libsensors changes periodically (it's currently at libsensors.so.5) so to be reliable, a known-compatible SONAME would have to be loaded with dlopen. libsensors.so.5 is available in the soldier and sniper runtimes already, in fact (it gets pulled in as a dependency of Mesa).

If using the command-line tool is unavoidable, it would be more reliable to use sensors -j and parse JSON, instead of screen-scraping human-readable text.

Alternatively, if the overlay that shows sensor results doesn't need to be in-process with the actual game, having it be a separate process that is composited over the top of the actual game (perhaps integrated with Gamescope) would ensure it doesn't interfere with running the game itself, would ensure that it can update even if the game is frozen, and would let it run on the host system instead of inside the game's container.

@H34dl3ss
Copy link
Author

Thanks for taking your time to look into this!
I have a guilty conscience for forcing you into such a long explanation. :-(
Please consider, I'm far away from fully understanding what you wrote, but I get your point!
I'm sure the dev of MangoHud knows exactly what to do, but I everybody is short on ressources nowadays, aren't we?

Unfortunately I can't answer most of your technical questions - sorry!
I should have linked the repo with my last post lm-sensors.

This proposal was meant to be a band-aid as long as the feature is not available via MangoHud code.
In my very basic understanding it is an "apt install lm-sensors" into the runtime environment...XD

@smcv
Copy link
Contributor

smcv commented Jan 26, 2023

In my very basic understanding it is an "apt install lm-sensors" into the runtime environment...

Probably yes, but if we do that and games start relying on it being there, then we have to keep it working forever, even if it breaks because the information it needs to read from /sys has changed - so that's a bigger thing to ask for than you might first think.

@H34dl3ss
Copy link
Author

Understood.
Is there a way how we (users) can add that on our own, so you are not in charge of supporting it?

@smcv
Copy link
Contributor

smcv commented Feb 6, 2023

Is there a way how we (users) can add that on our own, so you are not in charge of supporting it?

Not easily. If you have Flatpak installed (which the Deck does), you could use /usr/libexec/flatpak-xdg-utils/flatpak-spawn --host sensors, which runs sensors outside the container and tunnels its output into the container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants