Search Unity

45fps in almost empty scene and other perfomance issues

Discussion in 'AR/VR (XR) Discussion' started by Stacklucker, May 26, 2020.

  1. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    82
    Unity 2019.3.13f1, standard render pipeline.

    For weeks now I've been having terrible perfomance in when running VR in the Unity editor. This issues don't persist when I am running a build version of the game. I have a tough stomach so I've been ignoring the issues developing for a while but its coming to a point where it is effecting gameplay and I would like to understand why my performance in the editor is so bad and how I can fix it.

    I remember a time (Feb 2020) where I was constantly hitting between 100-200fps using OVRManager. I don't know what happened but I am left with about 45fps nowadays with occasional spikes all the way down to 15fps. The EditorLoop is only adding about 3.5ms according to my profiler, so that's not the main issue.

    What is eating up all the resources are
    1.EarlyUpdate.XRUpdate
    2.OVRManager.Update()
    3.OVRManager.FixedUpdate()
    and somtimes OVRManager.LateUpdate()

    The PlayerLoop in the Profiler is because of that always sitting above 85% Total usage, with 25ms of CPU time.

    Am I missing something here or why is my perfomance so bad?


    upload_2020-5-26_21-35-50.png

    The occasional hiccups you are seeing are caused by the EditorLoop.

    By the way, disabling the OVRManager in the Hierarchy will give my fps of >100 but obviously OVRInput etc are not being called anymore.

    Any help would be much appreciated.
     
    Robin_Hayes and curtispelissier like this.
  2. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    82
    Update: The culprit was OVRPlugin it seems. Luckily it is fixed with the new OVRIntegration 17.0.

    Edit: Problems are back with Unity 2019.3.15f1
     
    Last edited: May 30, 2020
  3. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    Hey @Stacklucker , have you found a solution for this? Also on 2019.3, seeing the same issues you wrote about.
    Oculus Runtime 17.0.
     
  4. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    From the looks of it EarlyUpdate.XRUpdate is actually the culprit here taking 9.4 ms... OVRPlugin might be take unusually long, and it might have been fixed, but other are having this same issue without OVRPlugin as well...

    I created a thread about it a couple weeks ago here:
    https://forum.unity.com/threads/ear...of-main-thread-cpu-time-is-this-normal.920234

    I also just submitted a bug report about it today and will post the upvote link to the above link once I'm emailed it
     
    Last edited: Jul 12, 2020
  5. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    @colinleet was also looking at your thread a couple weeks ago. Bunch of people will upvote that link when you post it!
     
    ImpossibleRobert likes this.
  6. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    564
    Bug is still there.

    In 2024
     
  7. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    Turns out it wasn't really a bug, but a frame sync feature for XR input which waits too long for the GPU frame to be delivered. 97% of the time what's happening is that the GPU frame timing is exceeding the threshold for 1 frame's render time (11.1 ms at 90 HZ), causing the XR plugin to wait a full extra frame to get back onto the input/frame sync from the VR headset. This used to be really hard to debug in 2020 when the profiler didn't support GPU profiling, but it's improved a lot since then.
     
    MartinTilo and chilton like this.