Unity 5 has been working okay for me. The last few weeks though it started falling apart. Playing the scene has high loss of frame rate. I checked it out with the profiler and Gfx.WaitForPresent seems to be the culprit:
I read some threads and they had the same problem. No solution for them though. V-Sync is disabled in both AMD and Unity. If anyone could help me out that would be amazing. Thanks
Thanks for the reply. It is strange. The only thing I did differently in Unity lately is baking of occlusion culling in a scene. Since then this problem persist in all the scenes. Do not really think that would do something like this though.
I enabled Vsync and there was no change.
By the way I am using 5.0.0 64bit on Windows 7 64bit.
Ok. If possible, try unity 5.0.1, it had several bugfixes. It might fix your issue.
Failing that, maybe the occlusion culling’s doing something, since you only just added it. Try removing your setup (Make a backup first!!! ) and see what happens!
Trying to wait till 5.1 because of download limit.
There is only one scene with occlusion culling setup. The other scene was were I took the screenshot. Will try disabling the bake in that scene and see if it makes a difference.
Click Add Profiler at the top left and add GPU. You will most likely see that your GPU is taking longer to run each frame than the CPU. Gfx.WaitForPresent just means that the CPU is waiting for the GPU - it’s not a thing that takes up time in itself.
You can then click on the GPU profiler to see where the performance issues are actually occurring.
VSync can cause it to show up as well, but that’s just because the limited framerate is also causing the CPU to have some time to wait.
That makes sense. Checked out the GPU and it is not too bad. Definitely not as slow as the CPU. The GPU is high running at about 10ms and the CPU high at 33ms. I am new to this so not the best at reading it. What you said makes sense though. Could it show this when waiting for memory (RAM) or just GPU. I do have issues with RAM.
Before when tracking the GPU in the profiler Unity started consuming all the RAM and then my computer crashed. Well froze and needed a hard reset. Now whenever I add GPU to the profiler Unity freezes. Without disturbing my computer fortunately. So basically the pic above is the best I can get.
Yup. It is late for me now but tomorrow after a restart I will check if it is working. Will try another project too. Thanks for your help man. Will get back to you tomorrow.
No graphic emulation is selected. I think @Nition is right about the CPU waiting for the GPU. The GPU profiler is completely broken on my pc for some reason so I can not confirm anything.
I have not checked in a while so I ran the profiler and the CPU is showing more camera.render than the Gfx.WaitForPresent. While it is still there it is not jumpy like it was before walking through the scene. It is the same scene too. Maybe an update.
If you guys are still having issues, I noticed this happened when I had a plug-in that was taking a lot of time on the render thread. E.g. a GL.IssuePluginEvent calling into the C++ side was spending too much time.
I’ve been experiencing a problem almost identical to Baldinoboy’s for a few days now, and this thread gave me a solution of sorts.
Gfx.WaitForPresent was eating up 80-90% of the CPU in the profiler, and the framerate was dragging at 20-30 fps. After adding the GPU to the profiler, Gfx.WaitForPresent immediately vanished, replaced by an item called Profiler.FinalizeAndSendFrame, (which uses the same amount of resources according to the profiler), and the framerate shot up to 150-200 fps. Removing the GPU instantly reduces the frame rate and brings back Gfx.WaitForPresent.
From time to time the problem returns, removing and re-adding the GPU profiler fixes it, for now. While I’m certainly glad to have the smooth editor back, it’d be nice to know why this happens, and whether there is a more permanent solution.