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.13k stars 262 forks source link

[DRAFT]: add support for some Tegra NVDEC/NVENC/VIC monitoring, generic GPU usage, and EMC usage #1322

Open theofficialgman opened 2 months ago

theofficialgman commented 2 months ago

I am opening this as a draft as it is not mergeable in its current state.

This PR adds support for some of the Nvidia Tegra system of chips that have NVDEC/NVENC/VIC stats available via /sys/kernel/debug interfaces. These are the same stats as used in tegrastats. They require that the current user be able to read from this directory (not the default) so I am looking for advise on implementing some sort of functionality that would allow for mangohud to read these files without needing to modify permissions on every reboot of that directory.

This PR also adds generic support for reading the CPU-therm temperature sensors (also as used on the Tegra chips and potentially other SOCs)

Finally, this PR also adds support for reading the GPU load from /sys/devices/gpu.0/load and a hardware specific frequency from /sys/devices/gpu.0/devfreq/57000000.gpu/cur_freq (a loop could be added to find the required folder, similar to https://github.com/hakandundar34coding/system-monitoring-center/blob/e0c6246d38af487a378adf486eed61485eea7566/src/Gpu.py#L657-L663).

As previously explained, this PR is not mergeable in its current state and I am looking for feedback on its contents and where each of these functionality can be best placed. I can split up the PR into separate PRs if desired based on feedback.

closes https://github.com/flightlessmango/MangoHud/issues/864