presentKHR still blocks on windows even when using VK_KHR_present_wait

NVidia Vulkan drivers have had a long standing technical debt where presentKHR blocks until the image is presented, which can be for a very long time in FIFO mode.
Even if that is a valid implementation, that’s a though pill to swallow since the spec doesn’t even allow a timeout parameter for that call.

The VK_KHR_present_wait extension is supposed to provide a vkWaitForPresentKHR function which can be used to wait for presentation.

The NVidia Windows Vulkan drivers claim to implement that extension, but according to my tests, the blocking behavior on presentKHR is still there, which makes the utility of this extension a bit dubious.

Is this behavior as intended, or is that a problem on my end?

I attach the demo which I used for my tests, which is just vkcube.cpp extended to support the extension.

First patch is the main implementation, second patch adds printing of some metrics, and I also attach the full source code for convenience.

The diff is against the demo in SDK version 1.3.243.0.

FWIW the same demo works as expected when tested on a WINE Linux setup with Intel graphics.

On NVidia windows it prints metrics which suggest all waiting is happening on presentKHR:
present:13.488300ms waitForPresent:0.059500ms
On Linux Wine intel it prints metrics which suggest no blocking on presentKHR, all the waiting is happening on waitForPresent:
present:0.151900ms waitForPresent:30.070200ms.

The affected setup is Windows 11 machine with a RTX 3060 connected to a PHL 499P9 monitor.

Thanks.
commit-420063b (8.2 KB)
commit-678d8b8 (1.7 KB)
cube.cpp (138.0 KB)

Hello @mizvekov, thanks for pulling the issue from Discord! And welcome to the NVIDIA developer forums.

Let’s see if we can get some feedback.

Ping, in case this was forgotten about.

Thanks.