SteamVR Developer Hardware

SteamVR Developer Hardware

Aaron 2015 年 11 月 4 日 上午 10:39
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.
< >
目前顯示第 1-11 則留言,共 11
aaron.leiby  [開發人員] 2015 年 11 月 4 日 下午 2:38 
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  [開發人員] 2015 年 11 月 4 日 下午 2:41 
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
Aaron 2015 年 11 月 5 日 上午 8:59 
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.
最後修改者:Aaron; 2015 年 11 月 5 日 上午 9:04
aaron.leiby  [開發人員] 2015 年 11 月 5 日 上午 11:48 
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 2016 年 5 月 23 日 下午 1:01 
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 2016 年 5 月 23 日 下午 1:12 
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 2016 年 5 月 23 日 下午 2:56 
Been seeing this also and figured I should pipe up to show this is not an isolated case.
aaron.leiby  [開發人員] 2016 年 5 月 23 日 下午 6:25 
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
最後修改者:aaron.leiby; 2016 年 5 月 23 日 下午 6:25
aaron.leiby  [開發人員] 2016 年 5 月 23 日 下午 6:26 
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).
最後修改者:aaron.leiby; 2016 年 5 月 23 日 下午 6:27
76561198238357344 2016 年 5 月 29 日 上午 2:11 
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 2016 年 6 月 3 日 下午 6:12 
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.
< >
目前顯示第 1-11 則留言,共 11
每頁顯示: 1530 50

張貼日期: 2015 年 11 月 4 日 上午 10:39
回覆: 11