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.
GPU Load Calculation and Trace Alignment
Posted: Mon, 2014-03-17 23:17
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
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
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).
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
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!
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
Hi Trepn Engr
Greetings to you .
Can you please let me know what are the values indicate in gpu_clock_stats