Search Unity

Question Sudden development of intermittent lag in play-mode and builds with no change to project (Solved?)

Discussion in 'VR' started by Charlicopter, Mar 31, 2023.

  1. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
    I've been working on a PCVR title for a few years now (OpenXR + 2021.3.18f1 and an experimental port to 2021.3.22f1 for diagnostics on this problem) - Performance has been butter smooth on 1070's, 2060's, and 3080's, and on every processor I could get my hands on, up til a few days ago.

    The other day, I opened the project (no prior changes to settings, code, or version) and it just randomly started having lag issues which persist to this day. The lag comes in random waves every 30 - 120 seconds (ish) that halve the framerate for ~0.2 second pulses.

    The profiler doesn't indicate any cause for the lag - it just shows the spike in render performance through Semaphore.WaitForSignal (which is useless)

    I updated all my drivers to no avail.

    My fear is that it is some kind of black-box anomaly with Unity, but am also considering the possibility that it could be SteamVR or something.

    Has anyone else experienced this problem?
     
  2. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
  3. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
    Digging into this deeper, it looks like SteamVR is throttling its output unnecessarily. My testers have independently verified the problem remotely, so it's not just my machine.

    Has anyone else experienced this?

    SteamVR Throttling Bug - Detailed - Small.png SteamVR Throttling Bug - Small.png
     
  4. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
    Likely answer for anyone running into this issue:

    After a few days of testing and research, I've more or less come to the conclusion that this is indeed a problem stemming from SteamVR. The issue is that it is unnecessarily "Throttling" frames - cutting the framerate in half and injecting synthetic frames between actual frames to keep it smooth and to create the illusion that it is still running at the intended framerate. Normally this would be triggered if the application was outstripping the GPU and dropping frames. In my case (and in the case of everyone using my application) SteamVR is doing this randomly and inappropriately, when the application is running perfectly smooth otherwise. This can be seen in the graphs I posted above. The Application load is almost totally flat, with about 200% overhead idle time available to render per-frame. But there is a spike in throttling that cuts the framerate in half for around half a second. This throttling spike occurs in random intervals during runtime and just kind of...does that sometimes.

    I was able to verify this by disabling the Throttling Behavior in the Advanced Settings of the Video settings inside SteamVR. I simply disabled throttling and the application became butter smooth.

    This issue became apparent after the 1.25.7 SteamVR update.
     
  5. NotQuiteSmith

    NotQuiteSmith

    Joined:
    Oct 27, 2013
    Posts:
    92
    I think I'm seeing something similar. Also getting weird 5ms blocks of time allocated to "QualitySettings.set_maxQueuedFrames" (possibly something to do with the Unity SteamVR code running "QualitySettings.maxQueuedFrames = -1;" in SteamVR_Render.Update()?

    Any idea why I can't see any "throttling" setting in Advanced/Video in SteamVR? Would love to see if that makes a difference.
     
  6. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I'm seeing this too with 2022.3.10f1. Any new info?
     
  7. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    I'm also suffering from SteamVR + openXR + Dx11 issues. What helps in editor is to load renderDoc (don't use it just load it). I have no idea why this would help (and it does not solve the real issue), but maybe smarter people can link this to something specific.
    I also don't have a 'throttling setting', but I guess the settings are different wired/wireless and maybe even headset dependent.
    Dx12/Vulkan were also better (with late starts), but its so unstable it crashes in minutes. I just gave up and accepted losing 1 frame of latency. I've made some bug reports, but since I could not reproduce the issue in a small sample project they were not successful.

    https://forum.unity.com/threads/steamvr-always-late-start-even-at-80hz-with-enough-cpu.1455055/
     
  8. VR_Unity_Account

    VR_Unity_Account

    Joined:
    Aug 17, 2017
    Posts:
    22
    I know that this is an old thread, but the issue persists.
    Editor 2022.3.21 LTS + OpenXR + SteamVR = editor lag spikes.

    SteamVR does not have a "Throttling Behavior" setting for Unity because it does not consider it to be a VR application.

    This issue is making my developers sick. Literally sick.