Odd starting (non-fifo, followed by lag, followed by fifo?) behavior when using FIFO present mode in Vulkan

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:

  1. What is this initial weird behavior and lag? Is this known behavior or something wrong with my vulkan setup?

  2. 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!


Actually disregard question 2). The fence is signaled once the rendering is complete. So the lag being in present kinda makes sense. I guess it would need to be there or during the next swap chain image acquisition, but that might be better for a different question.

Still puzzled by the seemingly odd start behavior in question 1) though