cancel
Showing results for 
Search instead for 
Did you mean: 

Please help me understand Unity Profiler and RenderDoc output for my simple app

GameSe7en
Explorer

I have a simple scene that is performant on PCVR, but struggles to make a reasonable frame rate when run natively on Quest.  After stripping out about half the scene geometry and some of the shadow overhead, it is still failing to  run smoothly so I've run the Unity Profiler (Standalone) and RenderDoc to try to understand where my bottlenecks are.

This development is currently running in Unity 2021.2.14f1, GLES, with up-to-date Oculus XR Plugin and Oculus Integration packages. 

 

Please look at the following and let me know if anything jumps out that I should look for.

 

First, Unity profiler:

Unity Profiler OutputUnity Profiler Output

The profiler suggests nearly 32ms of my 43ms PlayerLoop is waiting in EarlyUpdate.XRUpdate->OculusRuntime.WaitToBeginFrame.

 

I've seen discussion online that suggests this is most likely related to "Vsync" like timing and missing a frame budget could cause excess time waiting on the next available frame.  But I don't understand why it should appear to be almost 33 ms.  At 13ms per frame @72Hzthat's almost 2.5 frame budgets every frame cycle.

 

Because I can't get accurate timings of the GPU in the profiler, I can only see the Batches (20) and Tris count(~27K) and these should both be well-within recommended limits.

I've highlighted what I *think* illustrates the RenderLoop timing as best I can and it seems to imply some 4-5 ms where the RenderThread is not in WaitForGfxCommands...

Trying to dig deeper into the GPU, I've captured a frame under RenderDoc.  Two quick up-front questions about RenderDoc and "Gather Timings", if anyone knows the answer...

  1. You must capture the frame under "Quest Mode", but can Replay it under "Quest Mode" or "Quest Profiling Mode"  I get ~42ms under the former and 12ms under the latter.  Which one is more trustworthy here?
  2. Should Gather Timings report times for each stage in the series, because I can only get it to report for the entire frame.  I'd love deeper information for timing, but I can't seem to get at it.

Finally, RenderDoc echoes the 20 Draw Calls, but I can't tell whether I'm doing anything else here which should be causing such poor performance.

 

My overall framerate is around 27, but I can't understand why.

 

Please advise if I've got something obvious going on, but I'm at a loss to explain the behavior I'm seeing.

 

RenderDoc OutputRenderDoc Output

 

TIA,

G7

5 REPLIES 5

isigui
Honored Guest

Hello GameSe7en,

Did you get any update about this problem. I encounter exactly the same issue. I'm losing 37 ms in EarlyUpdate.XrUpte>OculusRuntim.WaitToBeginFrame. My scene is really small, 20 batches max, 7 set pass call.

I can't figure out what is wrong neither how to investigate deeper.

Please advice if you have anything new. Thanks !

 

metarunner87
Honored Guest

This is a huge problem on my end as well. I'm well within the limits of the quest two running at nearly 500fps in the unity editor, version 2021.3.11f1 and URP 12.1.7.  But in builds I cant get over 60 fps for a sustained period of time. It seems like I should be able to get a stable 72FPS but the oculus Vsync is killing the frame rate. This is a huge roadblock for everyone trying to build quality games for the quest platform. Please, Help us Help you Meta... 

metarunner87_0-1666749249225.png

 

metarunner87
Honored Guest

I cant believe more people aren't talking about this on here. Seems like a fix would be HUUUUGEE for the dev community...

Giinsen
Honored Guest

Hello, same problem on my side, i just builded a simple scene with only a skybox and a cube ...

Did someone have a clue on this ?

Thanks

floky001
Honored Guest

Apparently it's a known issue in Unity for quite some time and it's under investigation.


https://issuetracker.unity3d.com/issues/editor-performance-drops-as-oculusruntime-dot-waittobeginfra...

The issue seems to appear only when the scene view is opened while MSAA is enabled even when profiling on the device. Try closing Scene View in Unity and re-profile.