SteamVR Developer Hardware

SteamVR Developer Hardware

View Stats:
~~booooooo~~ Nov 4, 2015 @ 10:39am
18 ms latency on SteamVR_Render.RenderLoop()[Coroutine: MoveNext]
This spike happens even in an empty scene in an empty project, and causes a visible frame drop every time.

Here is a screenshot of the profiler:
http://imgur.com/tm2bNde

the dark green spike that happens later on is Gfx.WaitForPresent

Tried reimporting SteamVR, restarting the whole system, reimporting project.

Anyone know whats going on here?
Im in Unity 5.2.2f1
Windows 10

Also vrmonitor is telling me to update the firmware on my controllers, not sure if that could be part of it as well.
< >
Showing 1-11 of 11 comments
aaron.leiby  [developer] Nov 4, 2015 @ 2:38pm 
You can click the "Deep Profile" button, which will recompile your scripts and give you some more details to dig further. That render loop function is where all the rendering happens for the left and right eyes, and is also where the app waits for running start so it doesn't ever get ahead.

Gfx.WaitForPresent is the game window (a.k.a. companion window) waiting for vsync on your main monitor, which likely runs at 60hz. You don't want Unity applying vsync to its game window. The SteamVR plugin should be disabling this for you automatically in SteamVR_Render.Update, but it's possible that something else is re-enabling it later?

aaron.leiby  [developer] Nov 4, 2015 @ 2:41pm 
I responded before looking at your profile screenshot.

My guess those hitches are coming from the gpu running over budget and WaitGetPoses blocking until the start of the next frame. Maybe bring up SteamVR's Frame Timing and see if there is a corresponding spike there.

https://developer.valvesoftware.com/wiki/SteamVR/Frame_Timing
~~booooooo~~ Nov 5, 2015 @ 8:59am 
OK Here is Frame Timing and profiler running together.
http://imgur.com/xKNyfD8
http://imgur.com/baUQDUD

Looks like the spikes sometimes correspond on the gpu, but consistently corresponds with cpu. In raw mode it shows spikes on cpu Application and cpu Frame, with downward spikes on cpu Prediction.
Last edited by ~~booooooo~~; Nov 5, 2015 @ 9:04am
aaron.leiby  [developer] Nov 5, 2015 @ 11:48am 
I wonder if maybe those hitches are from garbage collection.

If you want to capture a gpuview trace and send it my way, I can take a deeper look to see if I can spot what's going on.

https://developer.valvesoftware.com/wiki/SteamVR/Installing_GPUView

Lord Fix May 23, 2016 @ 1:01pm 
Was this issue resolved? Still happening on unity 5.3 with an empty scene. And it is getting worse, when a Scene is full of objects.
Lord Fix May 23, 2016 @ 1:12pm 
FYI: I did some more profiling with an empty scene (save for the SteamVR Camera Rig and a plane) and activated "deep profile". It showed that calls to Texture.GetNativeTexturePtr() seem to be the culprit. The unity manual has this to say on the matter: "Note that calling this function when using multi-threaded rendering will synchronize with the rendering thread (a slow operation), so best practice is to set up needed texture pointers only at initialization time." (Source: http://docs.unity3d.com/ScriptReference/Texture.GetNativeTexturePtr.html) I wonder if this is related?
Hannibal May 23, 2016 @ 2:56pm 
Been seeing this also and figured I should pipe up to show this is not an isolated case.
aaron.leiby  [developer] May 23, 2016 @ 6:25pm 
Yes, we use GetNativeTexturePtr to synchronize Unity's main thread with the render thread. All the relevant work happens on the render thread - specifically WaitGetPoses, which synchronizes with the headset vsync. If you feed too much gpu work for a given frame, it'll miss vsync and wait until the next. This ensures your predicted poses are not too old.

Here's the relevant bit from SteamVR_Render.cs:
// Hack to flush render event that was queued in Update (this ensures WaitGetPoses has returned before we grab the new values). SteamVR.Unity.EventWriteString("[UnityMain] GetNativeTexturePtr - Begin"); SteamVR_Camera.GetSceneTexture(cameras[0].GetComponent<Camera>().hdr).GetNativeTexturePtr(); SteamVR.Unity.EventWriteString("[UnityMain] GetNativeTexturePtr - End");
https://github.com/ValveSoftware/openvr/blob/master/unity_package/Assets/SteamVR/Scripts/SteamVR_Render.cs
Last edited by aaron.leiby; May 23, 2016 @ 6:25pm
aaron.leiby  [developer] May 23, 2016 @ 6:26pm 
Also, you may want to give the native integration in Unity 5.4 beta a try (the above only applies in the earlier versions that did everything in script).
Last edited by aaron.leiby; May 23, 2016 @ 6:27pm
Ben@AtomicVR May 29, 2016 @ 2:11am 
Seeing this as well with latest plugin and 5.3.4p5. If I turn off everything in my scene it still occurs. If I use the sample scene (sea of cubes), still occurs. GTX 980 Ti, NVIDIA Driver 368.22, Windows 10.
pleribus Jun 3, 2016 @ 6:12pm 
Also seeing this. Any resolution as I'm unable to use 5.4 beta due to OpenVR using an off center asymmetric projection matrix and breaking required image effect.
< >
Showing 1-11 of 11 comments
Per page: 15 30 50

Date Posted: Nov 4, 2015 @ 10:39am
Posts: 11