Search Unity

  1. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  2. Curious about what's going to be in 2021.1? Have a look at the 2021.1 beta blog post.
    Dismiss Notice

VR (Vive) performance problems. Regular VR.WaitForGPU spikes

Discussion in '5.5 Beta' started by sgower, Oct 2, 2016.

  1. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    315
    I'm running 5.5b5.
    I believe this is an issue that started (or became worse) with the 5.5 beta versions, but for my Vive (SteamVR) unity project, I get regular VR.WaitForGPU spikes and these happen even if I disable every game object (including the camera) in my scene. For every spike the Vive drops a frame which looks terrible.

    Even the Vive demo scene does this. Have others experiences this? Is there any trick for getting around this?


     
    plmx likes this.
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,407
    Hi Spanky11,
    Could you please file a bug report for this issue together with a minimal reproduction case and reply with the report # in this thread?
     
  3. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    315
    Hi, I opened Case 837606 for this. I see this same issue even when running the SteamVR example.unity scene which I have attached to the case.
     
  4. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    315
    FYI, I thought that perhaps something about my project was causing the issue, so I created a new project, imported the SteamVR plugin, and ran the sea of cubes example project. I'm seeing the same issue, so hopefully you can do the same in order to reproduce this issue on your end. thanks.


     
  5. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    288
    Can you try clicking the "Profile Editor" button in the profiler. My guess is that the spike you are seeing is the editor redrawing the profiler window which is putting you above 11 ms and VR.WaitForGPU is waiting for the frame to present.

    There's a little text about this here: https://docs.unity3d.com/Manual/VROverview.html

    The Unity Profiler is a helpful tool to get an idea of what your performance will be like when running outside of the Editor. However, the profiler itself also has overhead.
    If you can reproduce this in an actual windows standalone build, let us know.
     
  6. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    265
    It's not 5.5. Occurs in 5.4 as well. I've written about this here: https://forum.unity3d.com/threads/vive-vr-spikes-how-to-interpret-vr-waitforgpu.427175/ Effectively, the spikes go away in the build version.

    @thep3000: Even though there are no spikes in the build version, would it be possible for you to look into this issue? As I've written in the other thread, "VR.WaitForGPU" takes up all the time which means we don't really see where the time is actually spent, which makes the profiler kind of useless.
     
    MrEsquire likes this.
  7. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    288
    I tried to replicate this on a 5.5.0b8 build today and here's what my profiler looks like in the steamvr plugin's sea of cubes example scene:

    Screen Shot 2016-10-11 at 1.56.14 PM.png

    Nothing looks too out of the ordinary here. On 5.4, it's a bit different:

    Screen Shot 2016-10-11 at 2.00.01 PM.png

    Here we see some unaccounted for time. Next I enabled "Profile Editor" and GPU profiler:

    Screen Shot 2016-10-11 at 2.02.04 PM.png

    Here you can see the frame before the spike, the GPU thread spent time collecting profiler samples. Then the next CPU frame had to end up waiting because CPU wasn't done yet, so we got a spike in VR.WaitForGPU.

    If the GPU thread doesn't submit in time, the CPU needs to wait or else it will get ahead of the GPU and introduce latency. That is what is happening in the above example.

    Can you see if you're seeing similar patters with profile editor and GPU profiler?
     
  8. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    315
    Hi, thanks for checking this. Your explanation makes sense. I'm also switched to using Unity 5.5b8 and it seems that this issue has gone away.
     
    thep3000 likes this.
unityunity