Why does VR.WaitForGPU take up so much CPU time?
I am working with SteamVR to make a game for the HTC Vive, and I have noticed some spikes in CPU time that, according to the profiler, are due primarily to VR.WaitForGPU. I am confused as to why this function is even necessary since GPU operations are asynchronous with CPU operations. This is currently a major roadblock in development since it is cutting my framerate roughly in half (~110 down to ~50). Since this performance hit is unacceptable, especially for for VR games, I was wondering if there is a way to get around this.
Thanks in advance!
I am using Unity 5.4.0b17
Answer by SmartCarrion · Jun 07, 2016 at 08:27 AM
@vdwtanner I'm getting the same issue, i'm pretty sure it is related to the similar Oculus function. See this thread: http://forum.unity3d.com/threads/major-vr-performance-issue-oculuswaitforgpu-running-on-cpu.328442/
As I understand, it is artificial CPU overhead inserted to synchronize with the next GPU frame. So we should be looking at how we are loading the GPU to figure out what we can do to return earlier there.
Thanks for the reply! Pointed me in the right direction, and I think I have a decent understanding of what is going on now.
Answer by 8bitgoose · Mar 14, 2018 at 04:51 PM
Could also be related to this issue with the anti-malware system hanging up Unity.
Your answer
Follow this Question
Related Questions
vSync for gameplay in monitor and VR headset in Unity not being consistent? 0 Answers
Unity 5.5 editor performance - "Unaccounted" 1 Answer
Strange framerate differance in game & profiler on GearVR. 0 Answers
Unity 5.6.0b9 bad performance 1 Answer
Why would render textures lag the oculus and not the editor? 2 Answers