[MUSIC PLAYING]
PASCAL MUETSCHARD: Welcome to the Android GPU Inspector
session.
Hello, my name is Pascal, and I'm a software engineer
in Android Games and Graphics.
Today I'd like to introduce you to Android GPU Inspector frame
profiler.
Android GPU Inspector, or AGI, for short,
is Android's graphics profiling tool we have been working on
for the past few years.
The frame profiler is a new feature of AGI
that allows you to conduct an in-depth analysis
of a single frame of your application
to see what's going on inside the GPU of your Android device
while rendering your game or 3D app.
I'm also excited to be joined by Krafton's Jaeho Choi, who
will give us a behind the scenes look at how they were
able to use AGI to improve the rendering performance of PUBG
"New State."
Android GPU Inspector is part of the Android Games Developer Kit
and falls within the Performance and Optimization
category of the kit.
The goal of AGI is to help developers such as yourselves
to optimize your game both pre- and post-launch.
Before we dive in with the frame profiler,
Let's take a quick recap look at AGI
for those of you who may not yet be familiar with the tool.
With AGI, our aim is to build a tool that
will help you profile and debug graphics
intensive applications on Android, regardless of device.
We know that this area is still a big pain point for many
of you who are watching.
With that in mind, we worked with Android GPU vendors
to get the GPU performance data into your hands
straight from the hardware.
In the fall of 2020, we launched AGI System Profiler
as an open beta.
AGI System Profiler shows you a timeline of events
similar to the old Systrace tool,
such as CPU activity, memory usage, and per process
information, along with high frequency GPU counters and GPU
activity.
In the GPU activity tracks, you can
see what the GPU was working on and how long each render
pass took to draw frames in your app.
This timeline view can give you great insights
into what is going on inside the GPU when rendering your game.
It can show you how much time the GPU spent on things
like bending, vertex and fragment shading, as well as
depth, color, memory, reads, and writes.
The GPU activity information is presented to you
along with the GPU counters that can
help you diagnose a wide range of GPU performance problems,
such as excessive geometry, overly complex shaders,
overdrawn texture memory bandwidth usage, tile read
and write bandwidth, and much, much more.
AGI System Profiler gives you a great overview
of how your application is behaving as part
of the whole device's system.
You can highlight bottlenecks and uncover potential resource
savings for your game.
However, it can often be hard to act on this information.
Say that, with the system profiler's help,
you've identified that the app is GPU bound, and even
determined that it's using too much vertex bandwidth.
It's still hard to find where to make changes in the app
to address the problem.
Which render pass needs improving?
Which draw calls are blowing the vertex budget?
Where do all these texture reads come from?
These are questions the system profiler cannot answer.
AGI's new frame profiler aims to answer these kinds of questions
by tying the profiling data back to your app's usage of GLES
or Vulkan.
AGI's frame profiler will trace your app's graphics
API calls and then replay them while recording profiling
data from the GPU driver.
This data is then matched up with the traced API calls,
and so AGI can help you find where
in your game to make changes to eliminate GPU bottlenecks
and performance issues.
With the frame profiler, you can now glean and act
on performance insights to improve your app's
usage of the graphics API.
We first introduced AGI frame profiler
at the last Google for Games Summit,
when we launched it as an experimental beta feature.
Since then, we've closely collaborated
with top studios and partners.
We've been busy fixing bugs and improving device support,
polishing the tool and improving the profiling features based
on extensive feedback from early adopters.
And now we are proud to announce that we are bringing AGI out
of beta with both the system and the frame profiler.
Let's now take a quick look at AGI's frame profiler
and how it can help you profile and debug your game.
Here, I have opened the trace I took
of a game I captured on my Pixel 6 in the new AGI frame
profiler.
At the top of the window, we can see the timeline
of the captured frame showing the GPU activity recorded
during the replay of the frame.
This gives us a quick overview over the structure of the frame
and can be used to find a slow render pass.
Below, I'm currently looking at the Performance
tab, which makes up the heart of the new frame profiler.
It shows me the captured graphics API calls
that went into rendering the frame in the tree
on the left, structured by submit,
command buffer, render pass, draw call, and debugging
labels emitted by the app.
On the right hand side, the frame profiler displays
summarized counter data associated
with each element of the frame.
The first few counters are from the draw calls of the frame
and come from AGI's static analysis of the trace.
The remaining counters are the hardware GPU counters
similar to those shown in the system profiler,
but now tied to each render pass in the frame.
Different GPUs expose different hardware counters,
and the Pixel 6 shows nearly 300 counters.
You can use the categories at the top to filter and navigate
these counters.
By default, here we show the high level
performance counters, which should help you quickly
identify whether a rendered pass is vertex or fragment heavy,
limited by texture or vertex memory
bandwidth, how well the cache is performing, and more.
The other categories either show additional details,
such as in the overview, or help drill down
into specific aspects of the GPU,
such as the texture or memory counters.
Of course, you can also see all counters
or customize which counters to display
by clicking the custom button and selecting or deselecting
specific counters.
As with System Profiler, understanding these GPU
counters will help you find rendering bottlenecks
and help improve the render performance of your game.
The hardware counters can help you identify expensive render
passes, and the draw call data can help you find hotspots
in your draw calls.
Tying the counter data to the actual graphics commands
of the app helps in identifying where in the game
to make changes to improve rendering performance.
The frame profiler also comes with a varied set
of debugging features that can be helpful in explaining
the performance numbers, as well as
in debugging rendering issues.
You can inspect the frame buffer at different points in a trace,
explore the render geometry per draw call,
as well as inspect the graphics pipeline state for the draw
calls, from the input assembly stage where
we can see the makeup of the vertices,
the vertex shading stage showing details
of the vertex shader and its uniforms,
through the fragment shading and alpha
blending stages of the pipeline.
There are multiple other tabs showing helpful
debugging information, such as the Texture tab, where
you can inspect all texture images used by the app,
the Shaders tab, where you can get information
about the shaders in your app, the State tab,
displaying the full Vulkan API state at the current point
in the trace, and more.
These debugging features, combined with the profiling
data, will give you a better insight
into how your application is using the GPU
and help you improve your game's rendering performance.
I hope this little demo has given you
a bit of a taste of what AGI's frame profiler can do.
The render pass level data can help
you find where in the frame GPU time is spent
and target the render pass as most needing improvements.
The large number of GPU counters can give you insights
into all aspects of the GPU, from shader course to memory
bandwidth, from vertex work to fragment work,
caching, blending, [? C ?] tests, and more.
The draw call level data can help you find that one pesky
object in the scene that is wasting precious GPU cycles.
Having this data associated with your game's GLES or Vulkan API
calls makes it possible to go in and make changes
to your app to optimize the GPU usage and rendering
performance.
I would like to now hand it over to Jaeho, who will tell us
how his team used AGI to improve the rendering performance
of PUBG "New State."
JAEHO CHOI: [SPEAKING KOREAN]
PASCAL MUETSCHARD: Thank you, Jaeho.
It's great to see how you were able to use AGI to improve
your game's performance.
We are still working on making AGI better and more
useful to game developers.
AGI is open source, and you can find more information about it
at gpuinspector.dev.
We are also excited about upcoming GPU power and memory
profiling features we are working on adding to AGI,
so please keep in touch.
We value your feedback, so please connect with us
on our GitHub page for bug reports and feature requests.
Now, please give AGI a try.
Profile your game and see what insights
you can gain on your app's GPU performance.
[AUDIO LOGO]