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

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

Open
theofficialgman opened this issue Dec 5, 2022 · 5 comments · May be fixed by #1322
Open

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

theofficialgman opened this issue Dec 5, 2022 · 5 comments · May be fixed by #1322

Comments

@theofficialgman
Copy link

building and installing the latest manughud from source ddbb4f5 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
Copy link
Author

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

@flightlessmango
Copy link
Owner

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?

@theofficialgman
Copy link
Author

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

@neofeo
Copy link

neofeo commented Jul 16, 2023

@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

@theofficialgman
Copy link
Author

@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
master...theofficialgman:MangoHud:master-l4t
PXL_20230416_002756886-edit

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