When my application starts there’s a lag near the beginning. I used nvidia nsight systems to profile and noticed the attached.
What appears to be happening is:
1) in the beginning it looks like its running in non-fifo mode (maybe immediate?) and runs way faster than fifo should allow (my monitor is 50hz so I expect each frame to take 20ms in fifo mode) for like ~15 frames.
2) Then there is a really long 250ms pause in vkQueuePresentKHR, which is where the noticeable visible lag comes from.
3) After this pause it appears to run correctly in FIFO mode, with each frame taking 20ms, although most of the delay in in vkQueuePresentKHR instead of vkWaitForFences which is what I would have expected
My setup is using nvidia optimus I believe (hdmi cable plugged into mobo but discrete GPU used for rendering). Wondering two things, first:
-
What is this initial weird behavior and lag? Is this known behavior or something wrong with my vulkan setup?
-
Why is the delay occuring in vkQueuePresentKHR? My expectations were that this would submit/return somewhat immediately and delay should occur when the fence is being waited to signal.
Thanks!