PowerVR Graphics SDK tools explained: Getting started with PVRScopeStats

Share on linkedin
Share on twitter
Share on facebook
Share on reddit
Share on digg
Share on email

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:

PVRScope

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!

Guillem Vinals Gangolells

Guillem Vinals Gangolells

I'm a Developer Technologies Engineer for the PowerVR division in Imagination Technologies, company in which I've been working since early 2011. My main task consists in the design of developer tools as well as in the integration of the PowerVR graphics in the Android ecosystem. Leaving the technical part aside, I also travel to some international events in order to collect feedback, give technical talks and meet with other companies

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!!
    Vinay

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

Please leave a comment below

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted. We respect your privacy and will not publish your personal details.

Blog Contact

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

United Kingdom

benny.har-even@imgtec.com
Tel: +44 (0)1923 260 511

Search by Tag

Search by Author

Related blog articles

Harry Potter: Wizards Unite on PowerVR review

Harry Potter Wizards Unite is the Augmented Reality game of the moment and, arguably, the best one available right now, and it’s looking great on Power VR-based phones.

Introducing our all new PowerVR Developer Documentation website

We’re really excited to announce some big news about our PowerVR developer documentation. We’ve taken our incredibly useful, and very extensive documentation set and turned it into something much more modern and accessible in the form of a new website.

Oddmar

Three of the Best: Android Platform Games

Want to game on the move? You no longer need a handheld gaming system. Even today’s budget phones will do the job. We’ve been trying out some of the latest and greatest Android games on a relatively affordable handset – the Honor 8A.

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.

Subscribe to our newsletter

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