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.35k stars 281 forks source link

hck variable invisible #1211

Closed weter11 closed 8 months ago

weter11 commented 8 months ago

Describe the bug When using variables with hck instead of cut they not shown in MangoHud

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior: Insert to MangoHud conf

custom_text=NVME:
exec=sensors | grep -E -o "Composite.{0,12}" | hck -f 2

or

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

Output in terminal in both situations +41.9°C

Expected behavior visible variable

Additional context Because cut create a lot of microstutters and more variables = more stutters, I decide to switch to hck, but sadly code is not working. Is there a limit that MangoHud work only with cut and tail? Or the problem is in used language (Rust)? For Nvidia stats I switched to exec=nvidia-smi --query-gpu=memory.used --format=csv,noheader, but I can't use query-gpu for voltage, because NV didn't add that to query-gpu.

weter11 commented 8 months ago

Nevermind, but it's really strange that there any problems with cut. I switched to much slower mawk. I did some simple tests, results similar:

time sensors | grep temp1 | cut -c 15-22
+49.0°C

real    0m0,075s
user    0m0,010s
sys 0m0,000s
time sensors | grep temp1 |  mawk '{print $2}'
+49.0°C

real    0m0,081s
user    0m0,007s
sys 0m0,005s

Issue somewhat similar to #1052, but in another way. Update: the problem wasn't because of cut, but sensors working faster with an option -A, but time variance is huge (looks like sensors utility update data continuosly), accordingly nvidia-smi should be used with -d if possible.