Reputation: 259
I wanted to calculate the GPU usage. Is there any file for GPU similar the way cpu stats are saved at /proc/stat ?
What could be the approach to get the GPU details like frequency etc
Thanks
Upvotes: 14
Views: 32328
Reputation: 1
In this video you can see some nice PC like performance overlay: https://www.youtube.com/watch?v=ViCA--Wi26s&t=892s
But im failing to find any details, maybe its device specific.
Update: App is named CPU float and could be donwloaded from Google Play store: https://play.google.com/store/apps/details?id=com.waterdaaan.cpufloat&hl=en&gl=US
Here is video how to make it run: https://www.youtube.com/watch?v=dAH9ywQQKD8 Download, start app, start game or app and look at stats.
Set of stats depends on your device and how is supported by app and app future updates. So far there is GPU stats only for some GPUs and there is not % CPU but only CPU cores frequency in MHz, but its still best Android OSD, which i found.
Upvotes: 0
Reputation:
If you want to optimise your GL pipeline code you may find Fencing a simple alternative or complementary tool. Here's an example in Kotlin:
override fun onDrawFrame(unused: GL10) {
if(glPipelineFence != null) { // if it's the first pass then ignore
// block until the GPU has reached the pipeline fence
val result = glClientWaitSync(glPipelineFence!!, 0, 1000000000)
if (result == GL_TIMEOUT_EXPIRED) Log.v("myinfo", "gl fence error: expired")
if (result == GL_WAIT_FAILED) Log.v("myinfo", "gl fence error: failed")
glDeleteSync(glPipelineFence!!)
}
// YOUR OPEN GL ES STUFF GOES HERE
glPipelineFence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0)
}
You can then use a delta on e.g. System.currentTimeMillis()
either side of glClientWaitSync
or for the whole function scope to see how long your pipeline is taking. The glClientWaitSync
will block until the OpenGL ES pipeline executes the fence command right at the end.
Upvotes: 0
Reputation: 487
For Arm Mali GPUs, you can use Streamline, a performance profiler that is part of Arm Mobile Studio: https://developer.arm.com/tools-and-software/graphics-and-gaming/arm-mobile-studio/components/streamline-performance-analyzer
Mobile Studio is free, and there are some good video tutorials for it.
Upvotes: 2
Reputation: 29008
AGI (Android GPU Inspector) by Google, is currently in Open Beta, and only supports the following devices:
DEVICE NAME GPU NAME
Google Pixel 4 (standard and XL) Qualcomm® Adreno™ 640
Google Pixel 5 Qualcomm® Adreno™ 620
Google Pixel 4a 5G Qualcomm® Adreno™ 620
These devices do not support AGI yet but will offer support in the future:
DEVICE NAME GPU NAME
Google Pixel 4a Qualcomm® Adreno™ 618
Samsung Galaxy S10 series Qualcomm® Adreno™ 640 and Arm® Mali™ G76
Samsung Galaxy S20 series Qualcomm® Adreno™ 650 and Arm® Mali™ G77
Samsung Galaxy Note 10 series Qualcomm® Adreno™ 640 and Arm® Mali™ G76
Samsung Galaxy Note 20 series Qualcomm® Adreno™ 650 and Arm® Mali™ G77
This will allow you to profile your app's GPU usage.
Upvotes: 1
Reputation: 1662
Since Android 4.3 (Jelly Bean) you can monitor this from a tool in Dev Options.
Seetings > More > Developer Options > Profile GPU Rendering.
You may need to enable Developer Options on Android 4.2 as it is hidden by default. Enable this by tapping 7 times on Settings > About phone > Build number.
Profile GPU Rendering has a few options, 'show on screen as bars' is quite a good way to get a fast visual look at what's going on.
Upvotes: 5
Reputation: 1723
GPUz will help you track GPU usage of any graphics application. It can display memory usage and GPU load briefly, and probably works with most hardwares.
Upvotes: -2