Difference between revisions of "How to monitor the GCNANO GPU load"

[unchecked revision] [quality revision]
m
m
 

When a GPU 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); \
sleep 4; \
gpu2=$(cat tr -d '\n' < /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)$6*100/($10+$12+$14+$16$4-$2-$4-$6-$8));}'); \sleep 4; 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%

Notes:

  • Stop monitoring the GPU load with the command "kill -9 `ps -o ppid= -C sleep`".
  • Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the example).
  • Use the command "dmesg -n8" to mix both user and kernel console outputs.
  • Debugfs configuration needs to be enabled.
  • The detailed calculation is: GPU load = ( On-previous_On) /(TotalEnd-previous_TotalStart) with Total=On+Off+Idle+Suspend, all variables "On, End & Start" coming from the command:
Board $> cat /sys/kernel/debug/gc/idle
OnStart:                2,071,009,284,477 ns
Off3488941301162 ns
End:              11,480,071,864,263 ns
Idle3549591148649 ns
On:                              0 ns
Suspend26672154276 ns
Off:           1,242,043,838,898 0 ns
...




When a GPU animation is running on the display, the related GCNANO estimated GPU load can be monitored from the [[Vivante GCNANO GPU overview | GCNANO driver]] level, by using the following command:
 {{Board$}} (while true; do 

 gpu1=$(cat /sys/kernel/debug/gc/idle); \
 sleep 4; \
 gpu2=$(cat (tr -d '\n' < /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)$6*100/($10+$12+$14+$16-$2-$4-$6-$8))}'; \$4-$2));}'); sleep 4; done) &

The GCNANO estimated GPU load is then periodically output in the user console as a percentage "%":<pre>
gpu load 75%
gpu load 75%
gpu load 75%</pre>


Notes:
* Stop monitoring the GPU load with the command "'''kill -9 `ps -o ppid= -C sleep`'''".
* Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the example).
* Use the command "dmesg -n8" to mix both user and kernel console outputs.
* [[Debugfs]] configuration needs to be enabled.
* The detailed calculation is: GPU load = (On-previous_On) / (Total-previous_Total) with Total=On+Off+Idle+Suspend, all variables /(End-Start) with "On, End & Start" coming from the command:
 {{Board$}} cat /sys/kernel/debug/gc/idleOn:                2,071,009,284,477 ns
 Off:              11,480,071,864,263 ns
 Idle:                              0 ns
 Suspend:           1,242,043,838,898 ns
 ...Start:   3488941301162 ns
 End:     3549591148649 ns
 On:      26672154276 ns
 Off:     0 ns
 ...

{{ReviewsComments|-- [[User:Antonio Borneo|Antonio Borneo]] ([[User talk:Antonio Borneo|talk]]) 17:20, 29 August 2020 (CEST)<br />The format of the content of this file has changed from driver 6.2.4 to 6.4.0, so the command result here is not aligned anymore.<br />This also breaks the command on top of this page to get GPU load.}}

<noinclude>

{{PublicationRequestId | 10256 | 2019-01-15 | PhilipS}}

[[Category:GPU]]
[[Category:How to trace and debug]]</noinclude>
Line 1: Line 1:
 
When a GPU animation is running on the display, the related GCNANO estimated GPU load can be monitored from the [[Vivante GCNANO GPU overview | GCNANO driver]] level, by using the following command:
 
When a GPU animation is running on the display, the related GCNANO estimated GPU load can be monitored from the [[Vivante GCNANO GPU overview | GCNANO driver]] level, by using the following command:
  {{Board$}} (while true; do (tr -d '\n' < /sys/kernel/debug/gc/idle | awk -F" " '{printf("gpu load %.0f%%\n", $6*100/($4-$2));}'); sleep 4; done) &
+
  {{Board$}} (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 "%":
 
The GCNANO estimated GPU load is then periodically output in the user console as a percentage "%":
Line 10: Line 15:
   
 
Notes:
 
Notes:
* Stop monitoring the GPU load with the command "kill -9 `ps -o ppid= -C sleep`".
+
* Stop monitoring the GPU load with the command "'''kill -9 `ps -o ppid= -C sleep`'''".
 
* Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the example).
 
* Adjust the GPU load update period by modifying the "sleep" value (4 seconds in the example).
 
* Use the command "dmesg -n8" to mix both user and kernel console outputs.
 
* Use the command "dmesg -n8" to mix both user and kernel console outputs.
 
* [[Debugfs]] configuration needs to be enabled.
 
* [[Debugfs]] configuration needs to be enabled.
* The detailed calculation is: GPU load = On/(End-Start) with "On, End & Start" coming from the command:
+
* The detailed calculation is: GPU load = (On-previous_On) / (Total-previous_Total) with Total=On+Off+Idle+Suspend, all variables coming from the command:
 
  {{Board$}} cat /sys/kernel/debug/gc/idle
 
  {{Board$}} cat /sys/kernel/debug/gc/idle
  Start:   3488941301162 ns
+
  On:               2,071,009,284,477 ns
  End:     3549591148649 ns
+
  Off:             11,480,071,864,263 ns
  On:     26672154276 ns
+
  Idle:                             0 ns
  Off:     0 ns
+
  Suspend:           1,242,043,838,898 ns
 
  ...
 
  ...
 
{{ReviewsComments|-- [[User:Antonio Borneo|Antonio Borneo]] ([[User talk:Antonio Borneo|talk]]) 17:20, 29 August 2020 (CEST)<br />The format of the content of this file has changed from driver 6.2.4 to 6.4.0, so the command result here is not aligned anymore.<br />This also breaks the command on top of this page to get GPU load.}}
 
   
 
<noinclude>
 
<noinclude>