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:
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.
I tried with other present modes listed here: [url]Swapchains | Vulkan API - Companion Guide
And the hangs/freezes only occur with the two FIFO modes, namely: VK_PRESENT_MODE_FIFO_KHR and VK_PRESENT_MODE_FIFO_RELAXED_KHR.
Also happening for me. I’m using my own demo for testing. https://github.com/turol/smaaDemo
It works fine on desktop GPUs (GTX 960, GTX 1060 and AMD RADV) which don’t use PRIME sync.
With PRIME sync enabled trying to move the window, resize it, switch vsync mode (recreating the swap chain) or switch to fullscreen results in temporary system hang. After 20 or so seconds it recovers because a wait for a submit fence times out and my program throws an exception and quits.
Does not happen if using non-FIFO present mode (–novsync option to my program).
Does not happen with PRIME sync disabled.
Any updates on this bug? I’m experiencing constant GPU hangs (freeze for 5-10 seconds, working for a second, rinse and repeat) with many Vulkan applications.
During a hang I am unable to move the mouse, switch TTYs, nor use SysRq functions. Sound sometimes works, but tends to freeze as well.
After disabling PRIME synchronization the issue is no longer present, but this introduces heavy screen tearing. Disabling vsync also helps, but not every application/game lets you do this.
Applications confirmed to cause the issue:
vkcube from the vulkan-tools package
Battle.net Launcher (works fine without DXVK, as expected, as then Vulkan isn't being used)
Crash Bandicoot N-Sane Trilogy (works fine without DXVK, just disabling Vsync within the game helps, but then it still hangs for a few seconds when minimizing/Alt-tabbing/changing workspaces)
same problem here, but only 430.xx and earlier drivers dont seem to have this issue which for me started with the introduction of the 435.xx series and still happening on 440.xx
prime sync + vulkan = 5 seconds frozen, 1 second not frozen, on a constant loop (not just the app/game but everything is unresponsive)
Depending on the vsync level set in EveOnline (interval 1 through to 4 available) with vulkan/dxvk + prime sync + DX11, the higher the internal I set the lower the FPS is limited (good for limiting the impact on gaming laptops and running multiple instances of the game)
However makes the freezing persist for longer depending on the interval level, especially bad when Alt+Tabbing out of the game or switching workspaces in Gnome.
Current setup:
Arch Linux
nvidia-dkms 440.31-3
nvidia-drm.modeset=1 kernel setting added to bootctl
wine-staging
vulkan
dx11
dxvk
prime sync on
eveonline with 64bit client enabled and dx11
Only really became an issue when I purchased this current setup with a 144hz screen:
Without vsync the FPS goes to over 300 and heats the laptop up to very high temps with only one game client running (not really an option)
With vsync but vulkan disabled the FPS limits to 144 to match the panel but still too much for multiple clients running all at 144 FPS in a laptop environment
With vsync + vulkan the FPS limits down depending on interval correctly (1=>144, 2=>~70, 3=>~35, 4=>~19) however long freezing without any response from the system, no TTY switching, everything frozen when switching
I’ve got multiple wine prefixes setup with DX11/DX9 with and without DXVK/Vulkan so please let me know if there is anything I can test or help with.
This is still a problem in the 440 series. Fortunately most DXVK applications can have this issue mitigated by forcing vsync off with a config file, and letting a compositor like picom do vsync. But any pure Vulkan applications that force vsync on are going to cause a bad time.
The main reason for me to use a setup with PRIME driving the entire X server is because outputs wired to the nvidia card are inaccessible using a PRIME Offload configuration. If that were fixed, this issue might not be as important.
I’m seeing this as well when I’m running anything with wine. Is there any movement on this? Is there a known driver version I can downgrade to or something?