PowerVR Graphics SDK tools explained: Getting started with PVRScopeStats

For this blog post I will assume that you are somewhat familiar with the PowerVR architecture and even played a bit with PVRTune, our GPU profiler.

PVRScopeDeveloper is included in our public PowerVR Graphics SDK. It is distributed as a set of headers (.h) and a static library (.a) for every major architecture.

PVRScope overview

PVRScope: HWperfPVRScopeDeveloper is a utility library which has twofold functionality, illustrated below:

  1. PVRScopeStats – Access the hardware performance counters in PowerVR hardware via a driver library called PVRScopeServices.
  2. PVRScopeComms – Send user defined information to PVRTune via PVRPerfServer as counters, timing data, and marks, or editable data that can be passed back to the application.

In this blog post I will focus only on PVRScopeStats, while I’ll tackle PVRScopeComms in an upcoming article.

PVRScopeServices, the man behind the curtain

PVRScopeServices is part of our user-space driver. We actively encourage all our Android and Linux customers to include PVRScopeServices in their release devices as it enables PVRTune graphics performance analysis. This means that we can assume pretty safely that any Android/Linux PowerVR device will also have PVRScopeServices built-in.

It lives along with the rest of our user space driver (i.e. /system/vendor/lib/libPVRScopeServices.so).

A closer look to the data:

PVRScopeDeveloper exposes the PowerVR hardware performance data (“HWPerf data” from now on) to any user-space application. Let’s look at the data closely:


Where does the HWPerf data come from?

PowerVR, due to its unique TBDR architecture featuring a MicroKernel, dumps all the performance counter values into a circular buffer in the kernel memory space (we call it the HWPerf CB).

That data is read by the kernel driver and pushed to the user-space when requested by PVRScopeServices.

Note: Once that data is read, it gets “consumed” so is no longer available in the kernel. This prevents more than one “PVRScope enabled” applications (including PVRPerfServer) to run at the same time.

What stats are we exposing in PVRScopeDeveloper?

The full counter list depends on the device but most counters are common to all devices. An exhaustive list can be found in the PVRTune user manual.

For example, the counters on the Active Group 0 (for SGX540 running the 1.8 DDK) are:

  • Frame time
  • Frames per second (FPS)
  • GPU task load: 2D core
  • GPU task load: 3D core
  • GPU task load: CDM core
  • GPU task load: TA core
  • TA load
  • Texture unit(s) load
  • USSE clock cycles per pixel
  • USSE clock cycles per vertex
  • USSE load: Pixel
  • USSE load: Vertex
  • Vertices per frame
  • Vertices per second

What can you do with this data?

There are many reasons to include PVRScopeDeveloper on any application you are profiling. For example you could graph the data to find any performance spikes, generate reports to plot them afterwards or simply feed that data to any other custom tool.

PVRScope: example

The PowerVR SDK includes two PVRScopeDeveloper examples:

  • PVRScopeExample (uses PVRScopeStats) – Demonstrates the use of pvrscope and the example graphing code that allows an application to return performance statistics from the GPU in real time.
  • PVRScopeRemote (uses PVRScopeComms) – Demonstrates the use of PVRScope’s remote communication features, this example shows how to use the editable data and custom mark functionality. PVRTune must be running and connected to an instance of PVRPerfServer running on the target device for this demo to function.

Don’t forget to check our PVRScopeDeveloper examples included in the PowerVR SDK and follow us on Twitter (@ImaginationTech and @PowerVRInsider) for the latest news and announcements for PowerVR developers!

  • Hi,
    Thanks for such nice article. I have some queries and would really appreciate if you could help me with answering them:
    1. What is active group? In PVRScopeSetGroup() api also we need to pass some group number, what is this group number?
    2. If I have 2 different OS running on 2 different CPU cores using hypervisor, then how can I get the GPU performance counters for them separately?
    3. Does PVRScopeStats also give me CPU load and System memory load information?
    Thanks in advance!!

    • Hi Vinay
      Sorry for the delay replying. some answers and follow up questions below:
      1. When you query the counters (PVRScopeGetCounters) they each state exactly which group they are in.
      2. Which platform are using?
      3. No, it does not.

  • Search by Tag

    Search for posts by tag.

    Search by Author

    Search for posts by one of our authors.

    Featured posts
    Popular posts

    Blog Contact

    If you have any enquiries regarding any of our blog posts, please contact:

    United Kingdom

    Tel: +44 (0)1923 260 511

    Related blog articles

    British Engineering Excellence Award

    PowerVR Vision & AI design team collect another award

    We’re delighted that the design team for our PowerVR Series2NX Neural Network Accelerator (NNA) has been honoured with a prestigious British Engineering Excellence Award (BEEA). The BEEAs were established in 2009 to demonstrate the high calibre of engineering design and innovation in the

    Series8XT AR/VR Banner

    Imagination Technologies: the ray tracing pioneers

    After a period out of the spotlight, ray tracing technology has recently come back into focus, taking up a lot of column inches in the tech press. The primary reason is because graphics cards for the PC gaming market have

    Amazon Fire Stick 4K pic

    Amazon Lights up its Fire TV Stick 4K with PowerVR

    Amazon, the internet shopping giant, announced earlier this week the latest version of its media streaming device, the Fire TV Stick 4K. First released in 2016, the Fire TV stick brings catch-up streaming services to any TV with an HDMI

    Stay up-to-date with Imagination

    Sign up to receive the latest news and product updates from Imagination straight to your inbox.

    • This field is for validation purposes and should be left unchanged.
    Contact Us

    Contact Us