-
Notifications
You must be signed in to change notification settings - Fork 63
Profiling tools for Meta Quest 2
This document contains a list of tools to do CPU and GPU profiling on the Quest 2. For each tool you'll find steps for how to install them and how to use them.
- VrApi Stats: Great for getting generic CPU/GPU stats with just looking at the log.
- OVR Metrics app: Great for seeing generic CPU/GPU stats of your choice in a HUD inside your app.
- Oculus Developer Hub (ODH): Great for getting lots of CPU/GPU stats live while your app is running with a simple click of a button.
- Perfetto: Great for capturing and analyzing CPU data in great depth, check where the CPU time is going, see threads running on specific cores and see your app's threads.
Steps to build and run OpenXR gems in O3DE for Quest 2 can be found here: Build and Run OpenXR in O3DE
NOTE
To capture more accurate profiling data, run your app on Quest 2 using a profile build and run with rhi-device-validation disabled (which it's disabled by default on profile).
Meta Quest apps always logs to logcat VrApi stats with basic performance statistics once per second.
Run adb logcat -s VrApi
to filter the stats while a meta quest app is running. Example:
VrApi: FPS=72,Prd=46ms,Tear=0,Early=72,Stale=0,VSnc=1,Lat=1,Fov=0,CPU4/GPU=2/4,1651/670MHz,OC=FF,TA=0/E0/0,SP=N/F/N,Mem=1804MHz,Free=1642MB,PSM=0,PLS=0,Temp=31.0C/0.0C,TW=3.40ms,App=0.69ms,GD=0.97ms,CPU&GPU=3.86ms,LCnt=3,GPU%=0.37,CPU%=0.08(W0.10)
Details of what each stat mean can be found in the following link: VrApi Stats Definition Guide
Tool that runs on Quest 2 to provide various performance metrics. Much of the information is similar to that provided by VrApi
logcat logs. It can also report GPU stats (ovrgpuprofiler real-time metrics) if enabled.
Installation:
- Easiest way to install OVR Metrics app into Quest 2 is using Oculus Developer Hub (ODH). Download and install ODH in your PC: Meta Quest Developer Hub for Windows
- Open ODH
- Connect Quest 2 to PC
- Inside ODH go to Device Manager tab, in the Device Actions area click on "Install" button beside OVR Metrics option.
- To enable GPU stats, inside ODH, go to Device Manager tab, in the Device Actions area enable the "GPU Profiling Service" option.
OVR Metrics app has 2 modes: Performance HUD Mode (show stats on screen in real time) and Report Mode (records stats and later show it in OVR Metrics app).
How to use Performance HUD Mode (recommended):
- Open OVR Metrics app on Quest 2.
- Click on "Enable persistent overlay" option.
- Enable all the stats and graphs you want. Recommended to use the scale option to make stat text size bigger.
- Press X to minimize the app.
- Open your app. The overlay will keep updating the stats.
- Tip: you can use ODH to take a screenshot at any time.
NOTE: The button "Metrics HUD" in ODH can also be used to control the HUD, but I found it behaves erratically sometimes.
How to use Report Mode:
- Open OVR Metrics app on Quest 2.
- Click on "Record all captured metrics to csv files" option.
- Enable all the stats and graphs you want.
- Press X to minimize the app.
- Open your app, it will start recording stats, close you app.
- Open OVR Metrics app.
- Click on the 3 dots button on the top right corner and select "View Recorded Sessions" option.
- Click on your app's session.
- It will show the stats recorded.
NOTE: The button "Metrics Recording" in ODH can also be used, but I didn't get it to record the stats when I tried it, it's more reliable to use the app directly.
You can uninstall OVR Metrics app from your Quest 2 at any time either via ODH (under Device Manager tab > Apps section > click "..." in com.oculus.ovrmonitormetricsservice > uninstall)
Useful Links:
- Monitor Performance with OVR Metrics Tool
- OVR Metrics Tool Stats Definition Guide
- OVR Metrics Tool + VrApi: What Do These Metrics Mean?
ODH is a tool running on PC which can communicate with the Quest 2 to do many development actions (install apps, launch/stop apps, profile apps, app logs, record videos, cast device, install tools, etc.)
Installation:
- Download ODH installer from this link: Meta Quest Developer Hub for Windows
- Run the installer
- To enable GPU stats, inside ODH, go to Device Manager tab, in the Device Actions area enable the "GPU Profiling Service" option.
The Performance Analyzer tab bundles several tools such as OVR Metrics, Perfetto, and logs from Logcat to closely monitor and analyze the performance-specific metrics.
How to use Performance Analyzer:
- Open ODH
- Connect Quest 2 to PC
- Open your app
- In ODH, go to Performance Analyzer tab
- Click on the play button to start profiling live and gather stats.
Useful Links:
Perfetto is the platform-wide tracing tool introduced in Android 10. It is a sophisticated open-source tracing project for Android, Linux, and Chrome. It offers a superset of data sources compared to Systrace and allows you to record arbitrarily long traces in a protocol buffer binary stream. You can open these traces in the Perfetto UI.
NOTE
O3DE does not have instrumentation for Perfetto yet.
In order for events from your app to show up in a Perfetto trace, your app must be annotated either with Perfetto TrackEvents or with ATrace.
Installation:
- Easiest way to do Perfetto captures in Quest 2 is via Oculus Developer Hub (ODH). Download and install ODH in your PC: Meta Quest Developer Hub for Windows
- To enable GPU stats, inside ODH, go to Device Manager tab, in the Device Actions area enable the "GPU Profiling Service" option.
How to do trace analysis in Perfetto from ODH:
-
Open ODH
-
Connect Quest 2 to PC
-
Open your app
-
In ODH, go to either Device Manager or Performance Analyzertab.
-
In the section "Trace Analysis by Perfetto" clicking on "..." > Perfetto settings, you can configure what's going to be captured when recording.
NOTE: O3DE doesn't emit Perfetto's ATrace or TrackEvents data yet. But when it does, then use "ATrace Apps" or "TrackEvent" fields to track O3DE with more detailed information.
-
Click on the "Record" button. If Trace duration setting was fixed duration it will stopped automatically, otherwise press the stopped button when desired to stop recording.
-
When it stops recording, if the "Auto open trace" was enabled, it will automatically open Chrome showing all the info captured. The following picture summarizes the stats found in Perfetto
-
You can managed the recorded traces clicking on "..." > Recorded Traces button.
Useful Links: