$ show flightlessmango/MangoHud
MangoHud is a Linux-first, in-process performance monitoring overlay for Vulkan and OpenGL games. It injects a HUD that shows FPS, frame times, CPU/GPU load, temperatures, clocks, power, VRAM/RAM usage, I/O, network, battery, and media player metadata. The code implements this through multiple low-level integration paths: a Vulkan implicit layer, OpenGL/EGL/GLX swapchain hooks, LD_PRELOAD shims, a gamescope companion app (mangoapp), and a Windows DLL path that uses kiero to hook D3D11/D3D12 and DXGI. Hardware metrics are collected from Linux sysfs/proc interfaces, vendor libraries like NVML and XNVCtrl, and vendor-specific DRM/hwmon backends for AMD, Intel, NVIDIA, Panfrost/Panthor, and Qualcomm GPUs.
The LLM identified 4 files worth highlighting for reuse:
Generic Linux hwmon sensor enumeration and polling via an HwmonBase class. It discovers sensor labels, inputs, and critical thresholds from /sys/class/hwmon, handles missing entries, and can be extracted for any Linux hardware-monitoring tool. Demonstrates robust sysfs parsing and fallback behavior.
Reads per-process /proc/<pid>/fdinfo DRM entries to compute GPU engine utilization and VRAM usage for individual processes. This is a reusable pattern for lightweight per-process GPU accounting on Linux without privileged APIs, and the module is isolated around proc-file parsing.
Self-contained ELF symbol resolution and PLT/GOT hooking using dl_iterate_phdr, GNU_HASH/DT_HASH traversal, and relocation patching. It can be lifted into any userspace interposition or tracing project and shows non-obvious low-level ELF craftsmanship. The same pattern is duplicated in src/elfhacks.c, which is a sign of drift but also of proven utility.
Python utilities for parsing the Vulkan XML registry and generating extension metadata and enum-to-string tables. The XML parsing is cleanly separated from code generation and supports API-version filtering, making it reusable by any Vulkan tooling or layer project that needs generated dispatch/extension code.