Forums - GPU Load Calculation and Trace Alignment

8 posts / 0 new
Last post
GPU Load Calculation and Trace Alignment
matthalp
Join Date: 5 Jun 13
Posts: 6
Posted: Mon, 2014-03-17 23:17
 

How are GPU load and GPU frequency calculated? Also, how are the utilization and frequencies traces aligned with the scheduler? I can't rationalize the traces I'm seeing for my application.

  • Up1
  • Down0
TrepnEng
Profile picture
Join Date: 31 Jan 13
Posts: 60
Posted: Tue, 2014-03-18 08:46

Hi Matt,

The GPU load and frequency are measured using gpubusy/gpuclk sysfs entries in the "/sys/class/kgsl/kgsl-3d0/" directory. I believe they are measured similar to the CPU load and frequency, although it's different since the GPU load is a direct number rather than the amount of time spent in each state.

The "CPU Frequency" and "CPU Load" data points are not aligned with the scheduler in any way and do not distinctly represent the load and frequency of any one application. If you'd like to measure the CPU load of specific applications, you can go to Settings -> General and enable the "Show Per-Application Statistics" option. With that option enabled, you can go to Profile System -> Stats -> App List and that will give you a list of running applications along with the CPU load of each application.

- Eugene

  • Up0
  • Down0
TrepnEng
Profile picture
Join Date: 31 Jan 13
Posts: 60
Posted: Tue, 2014-03-18 08:49

To add to the answer above, the interface we use for reading per-application statistics is /proc/[pid]/stat where the pid corresponds to the process id of the application.

- Eugene

  • Up0
  • Down0
matthalp
Join Date: 5 Jun 13
Posts: 6
Posted: Tue, 2014-03-18 09:08

Thank you Eugene. 

/sys/class/kgsl/kgsl-3d0/gpubusy provides two values (examples: 667051 1007167, 531575 1002262). Do you know what each value corresponds to and how they'e waited in the GPU load calculation? This is on the Galaxy S4 i9505 (APQ8064T).

 

  • Up0
  • Down0
TrepnEng
Profile picture
Join Date: 31 Jan 13
Posts: 60
Posted: Tue, 2014-03-18 09:50

The first number represents the number of cycles the GPU was busy and the second number indicates the total number of cycles. The GPU Load is calculated as the (first number) / (second number) converted to percentage.

- Eugene

  • Up0
  • Down0
648179967
Join Date: 12 Dec 13
Posts: 4
Posted: Thu, 2014-03-27 00:37

Hi TrepnEng

i read the file sys/class/kgsl/kgsl-3d0/gpubusy, and calculate GPUBUSY =  (first number) / (second number) ,but the GPUBUSY always equal 1.0.However,i use Adreno Profiler ,the Metrics %busy is around 40%。i would know how to calculate the Metrics %busy, and other Metrics。

Best Regard!

  • Up0
  • Down0
TrepnEng
Profile picture
Join Date: 31 Jan 13
Posts: 60
Posted: Thu, 2014-03-27 14:53

Hi,

Adreno Profiler may be using a different API for accessing the GPU load or a different algorithm for calculating the busy time. I'd recommend posting a question in the Adreno Profiler forums (https://developer.qualcomm.com/forums/qdevnet-forums/mobile-gaming-graph...). The Adreno team can provide a more detailed answer regarding how Adreno Profiler calculates the busy time and other metrics.

- Eugene

  • Up0
  • Down0
nikhil1035
Join Date: 19 Apr 18
Posts: 1
Posted: Thu, 2018-04-19 23:21

Hi Trepn Engr

Greetings to you .

 

Can you please let me know what are the values indicate in gpu_clock_stats

/sys/class/kgsl/kgsl-3d0 # cat gpu_clock_stats                                                                                                                     
179424 238182 2515495 11886866 34864328 9039576
 
Thanks
Nikhil 
  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.