14

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

1
  • From what I gather here: code.google.com/p/android/issues/detail?id=6914 Android does not use GPU acceleration on every device - so there might not be much to calculate, depending on the device. As for your actual question, I am afraid, I don't know. Commented May 9, 2012 at 9:26

6 Answers 6

6

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.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

My device (a Mlais MX28 running 4.2.2, with a Mali 400 GPU) doesn't show any options under the "Profile GPU Rendering" entry; just a checkbox, with the text "Measure rendering time in adb shell dumpsys gfxinfo" below the main label. Any suggestions? (Or is the ability to pick choices the actual new addition made in 4.3?)
2

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.

Comments

2

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.

5 Comments

Thanks Ben. Will this work for Apple ARM CPUs? How about M1? 😄
Streamline is only Android & Linux sorry. But I understand Apple has some good profiling tools, certainly for iOS (which is why Streamline has never been extended to it), and I'm sure they will for M1 too.
I guess this will also not work for Qualcomm processors? I have the EMEA version of the Samsung S9, so this should work for me.
Still gets all the CPU data for Qualcomm, but yes, very minimal GPU counters. S9 should be fine though with Mali GPU.
FYI - Arm's "Mobile Studio" is now called "Performance Studio"
0

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.

Comments

0

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.

Show case

2 Comments

If the video in your link contains useful information, please try to summarise this in your answer.
Yeah i tested it in video is name of app CPU float which could be loaded from Google Play and its working.
-2

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.

3 Comments

@Robust asked for GPU Usage for Android device and GPUz is for Windows Platform not Android.
there is now gpu-z for android. you can find it at google play.
This is link to GPUz Android app: play.google.com/store/apps/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.