MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

GPU % load is always 0 (nintendo switch, nvidia jetson)

Open theofficialgman opened this issue 1 year ago • 5 comments

building and installing the latest manughud from source https://github.com/flightlessmango/MangoHud/commit/ddbb4f5be1dba235ebfd770f622c5fe8be46987e the GPU usage percentage now shows up. when I last built in February there was no percentage.

However, the percentage is always at 0. This device does not use nvctrl (it is also disabled at buildtime for mangohud).

The gpu usage for this GPU can be obtained at /sys/devices/gpu.0/load which has a value of example 150 meaning 15.0% load

theofficialgman avatar Dec 05 '22 01:12 theofficialgman

I suggest referring to system-monitoring-center for how to obtain these statistics for more devices in a semi-uniform way

https://github.com/hakandundar34coding/system-monitoring-center/blob/e0c6246d38af487a378adf486eed61485eea7566/src/Gpu.py#L432-L711

theofficialgman avatar Dec 05 '22 01:12 theofficialgman

Doesn't look like system-monitoring-center uses that path either, but just wraps nvidia-smi instead. If nvidia-smi works then mangohud should also work as they both use the nvml library. Do you have nvml enabled in your mangohud build?

flightlessmango avatar Dec 05 '22 04:12 flightlessmango

Nvml and Nvidia smi don't exist on the Jetsons. I helped write system monitoring center so can guarantee it does use the /load path for this system. Read my linked code again and scroll to the bottom because you missed it. It is the last case

theofficialgman avatar Dec 05 '22 12:12 theofficialgman

@theofficialgman hi german, salvador here. you had it easier then. on my sbc, load also shows both freq and load. I used this config to show it.

### Display custom text
custom_text=Mali-G610
### Display output of Bash command in next column
exec=awk '{split($1,a,"@"); printf "GPU usage: %d%%, frequency: %.2f MHz\n", a[1], a[2]/1000000}' /sys/class/devfreq/fb000000.gpu/load

it's a decent workaround

neofeo avatar Jul 16 '23 15:07 neofeo

@neofeo I personally just forked mangohud a long time ago since making this issue and implemented it and lots of other tegra specific clocks/loading myself. Ram bandwidth, clocks, gpu load, gpu frequency, VIC/NVDEC/NVENC frequencies, cpu temp https://github.com/flightlessmango/MangoHud/compare/master...theofficialgman:MangoHud:master-l4t PXL_20230416_002756886-edit

theofficialgman avatar Jul 19 '23 14:07 theofficialgman