Forcing Vulkan in Native Linux Unity games has severe mouse lag at 60hz, but only for Nvidia, not RADV

Asked around and everyone else says they don’t have this problem while I do. It happens if your display is 60hz and you engage Vsync with the -force-vulkan option enabled. This is extremely prominent in The Stanley Parable Ultra Deluxe and Getting Over It with Bennett Foddy.

Am I a special snowflake for once again having a bug nobody else has?

Nvidia Driver is 460.91.03, It’s Ubuntu 20.04.4 on KDE and Kernel 5.4 non HWE with composition off, the Xorg.conf was mostly generated by the nvidia-settings program.

as your using a kvm try switching your mouse to usb 1.1 or 2 in the vm software driver.(if available)
i know some vm setups can have trouble with the mouse if usb 3.0 or type c is used.
so plugging your mouse into a lower spec’d usb might be all thats needed.

No, i am not using a KVM, only the passthrough port on my keyboard.

And I’m not using QEMU-KVM because it says in the title “Native Linux.”

1 Like

Ethan Lee of FNA has the answer:

As Liam mentioned, -force-glcore may end up fixing it, but in addition to z-fighting on NVIDIA I’ve found that on AMD the lighting is just completely nonexistent - only in very specific scenarios will GL work, and only by complete accident. In short, do not use GL unless your hardware physically cannot use Vulkan.

As far as I know the Vulkan renderer presents using the standard FIFO presentation using a thread to submit commands, so I very very very strongly recommend filing reports with your desktop and graphics vendors so they can diagnose what’s unique about these setups.

EDIT: The input latency is not unique to this game or even the Unity engine, by the way… a couple similar reports:

vulkan input lag :: Tom Clancy's Rainbow Six Siege Player Support
Significant rendering lag when using Vulkan · Issue #2938 · ocornut/imgui · GitHub
An input lag investigation - General - Libretro Forums

EDIT 2: Some more digging… just about the only thing I can see as a possible modification is setting MESA_VK_WSI_PRESENT_MODE=mailbox if you’re on RADV/ANV. Not sure if NVIDIA has an equivalent for forcing mailbox vsync.

EDIT 3: Turns out MangoHud has a hack for this, setting vsync=2 in their config file forces that present mode: GitHub - flightlessmango/MangoHud: A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb

You can stop Googling now, but still doesn’t explain why Nvidia doesn’t use mailbox Vsync and it causes this severe input lag.

Should have honestly been fixed by now, but it seems RADV is having the last laugh since this isn’t an issue on RADV.

Just to be clear, since you mention Xorg is this an X11 desktop session, or Unity running via XWayland on a Wayland desktop session?

Also, which of those suggested flags actually fixed your issue? Or do those only work on RADV, and therefore you still have no resolution?

No, the Unity Game Engine, not Unity DE.

The MangoHUD Config vsync=2 solved it on Nvidia, but RADV doesn’t have the problem in the first place, hence why many RADV elitists will be saying there is no problem, when there is a problem on Nvidia with FIFO and not Mailbox Vsync.

The problem does NOT lie with the mouse polling rate like I originally thought, it’s to do with FIFO and Mailbox Vsync methods.

I understood; I was asking if your compositor/window-manager was using X11 or Wayland, since that could be an additional variable at play. However, you are running KDE on Nvidia’s drivers, which makes Wayland unlikely, though possible, albeit with newer drivers than yours it seems. It should be safe to assume that you are running KDE in X11 mode.

I had forgotten about Unity the desktop/compositor entirely, though it could be amusing to be running Unity on Unity, since you mention it.

Yeah, it’s an issue with FIFO vs Mailbox present mode. Ethan urged people to make bug reports to Nvidia about this but nothing has happened to fix this, as Unity games more often than not default to OpenGL. Superliminal defaults to Vulkan.