I think there is a problem between using PRIME Synchronization (I use a laptop) and the v-sync mode of Vulkan (by using VK_PRESENT_MODE_FIFO_KHR as far as I understand: https://github.com/SaschaWillems/Vulkan/blob/master/base/VulkanSwapChain.hpp#L279).
- Install the latest NVIDIA driver on a Intel+NVIDIA (Optimus) laptop.
- Enable DRM KMS support (eg. with "nvidia-drm.modeset=1" kernel boot parameter).
- Make sure that PRIME Synchronization is enabled (eg. "xrandr –-output --set "PRIME Synchronization" 1")
- Launch a Vulkan-based demo or game with v-sync enabled. You can use a very simple demo from this repo: https://github.com/SaschaWillems/Vulkan Just use the "-vsync" option.
Here are two little benchmarks.
One without v-sync:
leeo master ~ git Vulkan bin 130 __GL_SHOW_GRAPHICS_OSD=1 ./gears -b Benchmark finished device : GeForce GTX 1050 (driver version: 1740931072) runtime: 10.000 frames : 32517 fps : 3251.653
And one with v-sync:
leeo master ~ git Vulkan bin __GL_SHOW_GRAPHICS_OSD=1 ./gears -b -vsync Benchmark finished device : GeForce GTX 1050 (driver version: 1740931072) runtime: 10.193 frames : 2 fps : 0.196
As you can see, a lot of frame are skipped when v-sync is enabled. In fact, the display freezes a lot when I launch a game or a simple demo like this with v-sync enabled.
This happens only when PRIME Synchronization is enabled. I have also tried to use other distribution like Ubuntu, and there is no difference.
The problem is here since several versions of the driver, and I don’t know when it started.
Here is a nvidia-bug-report.log.gz file generated few seconds after the last benchmark: https://framadrop.org/r/Y0TtjckOos#wBH4KYl3i2k32e26oPraFjRiVUk/SFiVqvYThD5vpBE=
nvidia-bug-report.log.gz (1.03 MB)