Workflows: The process flows you should follow
OCULUS RIFT DOCUMENTATION
This topic is about Oculus Rift development with PC SDK. To learn about performance optimization for Meta Quest apps, see one of the following topics based on your development platform: This section provides an overview of the workflows that you should follow when isolating and analyzing VR performance issues.
Follow these workflows:
Begin
- Choose a workload, such as a scene with judder in your application.
- View the scene while displaying the Oculus Performance HUD, or capture the scene in the Lost Frames Capture utility. Both of these tools are available within the Oculus Debug Tool. You can also use NVIDIA Frame Capture Analysis Tool for VR Games (FCAT VR).
- IF dropped_frame_rate > 1 frame per 5 seconds THEN * IF render_time > 8 ms THEN Analyze Rendering ELSE Analyze Call Hierarchy.
Analyze Rendering
IF rendering time is excessive THEN * Check if batches > 1000 * Check if triangles/vertices > 1,000,000 * Check if SetPass calls > 1000
IF the hierarchy view uses excessive time THEN* Look for a single object that takes 8 ms or more to render * Check to see if the CPU is stalled waiting on the GPU to complete tasks * Check if mesh rendering is too complex * Check to see if shadows are too complex * Check to see if VSync points arrive before the frames are fully rendered * Check the timeline view to see if there are scheduling bubbles
Analyze Call Hierarchy
- Capture an ETW trace file, using ovrlog or ovrlog_win10.
- Load the trace file into Windows Performance Analyzer (WPA).
- Expand to see which objects/calls take the most time.
- IF there are garbage collection spikes THEN don’t allocate memory for each frame. Note: If your scripts allocate and free memory during each frame cycle, this may result in fragmentation that eventually forces the garbage collection process to defragment the heap.
- Once you have identified the objects/calls that take the most time, analyze the corresponding source code and optimize it.
Analyze Queuing and System-Level Contention
- Capture the Event Tracing for Windows (ETW) output by running ovrlog or ovrlog_win10
- Analyze the resulting merged.etl file in GPUVIew.
- Highlight processes within your application.
- Show the VSyncs.
- Zoom in on the problem area.
- Examine the GPU packets, command packets, and fences.
- Analyze the dependencies between these packets and the processes they are implementing. You can bring up the Event Viewer, which displays detailed information about each packet.
Note: GPU packets represent indivisible units of GPU work. Command packets represent indivisible packets of CPU work. And fences represent barriers that cannot be passed until the previous work is completed.
The tutorial at the end of this guide provides detailed guidance for using WPA and GPUView.