Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

VR.WaitForGPU killing performance in Unity3D. Very difficult to profile other issues. Video Example

RaveTZRaveTZ Posts: 168
Hiro Protagonist
Here is a video showing what the issue is
https://youtu.be/n5ngEzZSKH0

I'm trying to release an update to Vanguard V but perforance has become a real issue.  The game runs at 150fps on my laptop but the framerate tanks when I touch the Oculus headset.  I get these nasty yellow spikes and the FPS tanks to the 50s, even on my desktop (980 GTX TI).  I then created a new scene with nothing but a camera and the default Directional Light.  The framerate goes into the 800s until I touch the headset.  It then tanks again to 90-100fps.  This is an empty scene.

Now, if this is by "design" it has made it very difficult to isolate any real issues in the profiler.  Any help would be great.

Unity 5.5.1f1 and observed in Unity 5.5.2 as well
Windows 10 x64




ProjectBanner.jpg

Comments

  • RaveTZRaveTZ Posts: 168
    Hiro Protagonist
    I believe this is caused by Asynchronous Space Warp locking the framerate to 45 if it dips below 90.  This is problematic because ASW stays on for a duration and causes the game to slow down for a notable period.  Is there any way to disable ASW?  This all or nothing approach is not working well for us.



    ProjectBanner.jpg
  • delphinius81delphinius81 Posts: 297
    Nexus 6
    edited March 2017
    VR.WaitForGPU basically means that your frames are taking too long to render. To maintain 90fps, you need to be < or about equal to 11.1 ms per frame (1000ms/s / 90 frames/s = 11.11111). Both your CPU and GPU values are above that. So VR.WaitForGPU is not killing performance - that function is actually the CPU saying that it needs to wait some amount of time for rendering to finish before it can send new data to the GPU. If you want to address this, you need to look at how much you are trying to render each frame and reduce/optimize where possible. 
  • RaveTZRaveTZ Posts: 168
    Hiro Protagonist
    VR.WaitForGPU basically means that your frames are taking too long to render. To maintain 90fps, you need to be < or about equal to 12ms per frame (1000ms/s / 90 frames/s = 11.11111). Both your CPU and GPU values are above that. So VR.WaitForGPU is not killing performance - that function is actually the CPU saying that it needs to wait some amount of time for rendering to finish before it can send new data to the GPU. If you want to address this, you need to look at how much you are trying to render each frame and reduce/optimize where possible. 
    Then why is it still there in an empty scene with nothing to render at all?
    ProjectBanner.jpg
  • RaveTZRaveTZ Posts: 168
    Hiro Protagonist
    Here is a video of the title in action with the issue at hand
    https://youtu.be/wMvn_KTPfb8
    ProjectBanner.jpg
  • delphinius81delphinius81 Posts: 297
    Nexus 6
    When the headset is active, frame-rate is being locked/synched to 90fps, even if your cpu/gpu could push further. It's a similar principle to having v-sync enabled on a monitor.
  • RaveTZRaveTZ Posts: 168
    Hiro Protagonist
    When the headset is active, frame-rate is being locked/synched to 90fps, even if your cpu/gpu could push further. It's a similar principle to having v-sync enabled on a monitor.
    And there is the problem.  ASW is locking it to 45 for a duration every time it has a slight dip below 90.
    ProjectBanner.jpg
  • bali33bali33 Posts: 1
    NerveGear
    Hi guys,

    I'm experiencing the same issue here. I have a scene in which nothing is happening, the FPS is something like 160 FPS. As soons as I wear the Oculus headset the FPS drop to 45 FPS. Nothing has changed in the scene, no events have been triggered, no animations have been played, nothing. Just wearing the Oculus headset make the FPS drop.

    Any idea why ?

    Thanks
  • blackantblackant Posts: 20 Oculus Start Member
    same problem for me, this is locking me the possibility to pass check test on the store.
    any answer is welcome !
  • FlorianVR13FlorianVR13 Posts: 14 Oculus Start Member
    edited October 2017
    RaveTZ said:
    Then why is it still there in an empty scene with nothing to render at all?
    And why are builds so much faster as well (~40% increase) ?
     
    Same problem here with a Vive/Unity 2017.2.
    Fixing that issue would make my daily routine much much more enjoyable...

  • deftwaredeftware Posts: 83
    Hiro Protagonist
    RaveTZ said:
    When the headset is active, frame-rate is being locked/synched to 90fps, even if your cpu/gpu could push further. It's a similar principle to having v-sync enabled on a monitor.
    And there is the problem.  ASW is locking it to 45 for a duration every time it has a slight dip below 90.
    If it dips below 90 it is by design going to halve the locked FPS rate, to 45, because the goal is to avoid any frame tearing on the display. This is similar to how consoles will dance between 60/30 FPS to prevent frame tearing.

    Do you get drops to 45 in an empty scene?
  • Spoon420Spoon420 Posts: 2
    NerveGear
    I seem to be having a similar issue. No matter how empty a scene is, I can't seem to get more than 60fps almost like it is syncing with my monitor, instead of my headset. This Thread was 2 years ago.
Sign In or Register to comment.