Registered User mNo edit summary |
Registered User mNo edit summary Tag: 2017 source edit |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | |||
{{ApplicableFor | {{ApplicableFor | ||
|MPUs list=STM32MP15x, STM32MP25x | |MPUs list=STM32MP15x, STM32MP23x, STM32MP25x | ||
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP25x | |MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | ||
}} | }} | ||
</noinclude> | |||
==Basic usage== | ==Basic usage== | ||
When a GPU-based animation is running on the display, the related GCNANO estimated GPU load can be monitored from the GCNANO driver level, by using the following command: | When a GPU-based animation is running on the display, the related GCNANO estimated GPU load can be monitored from the GCNANO driver level, by using the following command: | ||
{{ | {{board$}}(while true; do \ | ||
gpu1=$(cat /sys/kernel/debug/gc/idle); \ | gpu1=$(cat /sys/kernel/debug/gc/idle); \ | ||
sleep 4; \ | sleep 4; \ | ||
Line 20: | Line 22: | ||
== Tips == | == Tips == | ||
* Stop monitoring the GPU load with the command | * Stop monitoring the GPU load with the command <code>kill -9 `ps -o ppid= -C sleep`</code>. This command may not work depending on your system configuration (busybox ps features, sh shell configuration...). Alternative method is to use the command <code>fg</code> followed by <code>CTRL+C</code> in your terminal. | ||
* {{Highlight|Debugfs<ref>[[Debugfs]]</ref> configuration needs to be enabled}} in order to be able to monitor the GPU load from the debug directory "/sys/kernel/debug/gc". | * {{Highlight|Debugfs<ref>[[Debugfs]]</ref> configuration needs to be enabled}} in order to be able to monitor the GPU load from the debug directory "/sys/kernel/debug/gc". | ||
* Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the above examples). | * Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the above examples). | ||
* Use the dmesg<ref>[[Dmesg and Linux kernel log]]</ref> command | * Use the dmesg<ref>[[Dmesg and Linux kernel log]]</ref> command <code>dmesg -n8</code> to mix both user and kernel console outputs. | ||
* The detailed calculation is: GPU load = (On-previous_On) / (Total-previous_Total) with Total=On+Off+Idle+Suspend, all variables coming from the command: | * The detailed calculation is: <code>GPU load = (On-previous_On) / (Total-previous_Total)</code> with <code>Total=On+Off+Idle+Suspend</code>, all variables coming from the command: | ||
{{ | {{board$}}cat /sys/kernel/debug/gc/idle | ||
On: 2,071,009,284,477 ns | On: 2,071,009,284,477 ns | ||
Off: 11,480,071,864,263 ns | Off: 11,480,071,864,263 ns |
Latest revision as of 09:59, 8 October 2024
1. Basic usage[edit | edit source]
When a GPU-based animation is running on the display, the related GCNANO estimated GPU load can be monitored from the GCNANO driver level, by using the following command:
(while true; do \
gpu1=$(cat /sys/kernel/debug/gc/idle); \
sleep 4; \
gpu2=$(cat /sys/kernel/debug/gc/idle); \
echo $gpu1 $gpu2 | tr -d '\n' | tr -d ',' | tr -d 'ns' | awk -F" " '{printf("gpu load %.0f%%\n", ($10-$2)*100/($10+$12+$14+$16-$2-$4-$6-$8))}'; \
done) &
The GCNANO estimated GPU load is then periodically output in the user console as a percentage "%":
gpu load 75%
gpu load 75%
gpu load 75%
2. Tips[edit | edit source]
- Stop monitoring the GPU load with the command
kill -9 `ps -o ppid= -C sleep`
. This command may not work depending on your system configuration (busybox ps features, sh shell configuration...). Alternative method is to use the commandfg
followed byCTRL+C
in your terminal. - Debugfs[1] configuration needs to be enabled in order to be able to monitor the GPU load from the debug directory "/sys/kernel/debug/gc".
- Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the above examples).
- Use the dmesg[2] command
dmesg -n8
to mix both user and kernel console outputs. - The detailed calculation is:
GPU load = (On-previous_On) / (Total-previous_Total)
withTotal=On+Off+Idle+Suspend
, all variables coming from the command:
cat /sys/kernel/debug/gc/idle
On: 2,071,009,284,477 ns
Off: 11,480,071,864,263 ns
Idle: 0 ns
Suspend: 1,242,043,838,898 ns
...
3. References[edit | edit source]