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!

2 thoughts on “PowerVR Graphics SDK tools explained: Getting started with PVRScopeStats”

  1. 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.

Leave a Comment

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

The ultimate embedded GPUs for the latest applications

Introducing PowerVR Series9XEP, Series9XMP, and Series9XTP As Benjamin Franklin once said, only three things in life are certain: death, taxes and the ongoing rapid advancement of GPUs for embedded applications*. Proving his point, this week, Imagination has once again pushed

Opinion: the balance between edge and cloud.

Simon Forrest explains how embedded chips can meet the challenge of delivering true local AI processing. GPUs and NNAs are rapidly becoming essential elements for AI on the edge. As companies begin to harness the potential of using neural networks

DJI Mavic 2 closed

Partner interview series: DJI – flying high

DJI is a name now synonymous with drones, thanks to an estimated 74% market share across consumer, professional and enterprise markets. In the second of our ‘quick chat’ interview series, we speak to we talk to Charlie Sun, R&D Director at DJI to find

PowerVR Series2NX collects another award at China tech summit

Following success at other award ceremonies this year, PowerVR’s Series2NX neural network accelerator has picked up another gong. This time, the panel of judges at the ASPENCORE Global Electronic Achievement Awards Annual EDA/IP award ceremony deemed it to be the most

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.