Glitches with nvidia driver 470 (optimus render offload) on xwayland with vulkan games

There is a problem while playing VULKAN (or dxvk) games with nvidia optimus render offload on xwayland.
When playing a game, if framerate does not keep up with vsync rate (60fps in my case), screen starts glitching by momentarily showing some frames that were rendered a little earlier.

Driver: 470.57.02
OS: Manjaro [testing branch]
Kernel: Linux 5.10.54-xanmod1-1-lts
Hardware: HP dc0019ur (Omen 15) Laptop with Intel UHD630 + Nvidia GTX1050 2GB
Relevant bleeding-edge packages installed (from AUR): xorg-xwayland-git, libdrm-git lib32-libdrm-git, xf86-video-intel-git. Installed these thinking it may resolve the issue. but it didn’t.

I can confirm this bug too.

1 Like

in sway, change workspace(maybe also changed focus?), fix tear for me.
but need more test, to watch what happend

Cross-DE (and OS?) issue then. I use KDE Plasma 5.22.4, with vanilla KWin, not KwinFT (which is sway-based). Happy and sad at the same time that you confirmed the issue. What’s your OS, kernel and hardware?

The fix was temporary and the game started tearing again.
I think this is a bug in Xwayland or nvidia-driver.

I use Xwayland from xorg-master-branch (d83c84bd9dc7fbd3588ce70b0c8bf0f63ed29ff3).
and load nvidia module by:

    sudo modprobe nvidia
    sudo modprobe nvidia_drm modeset=1
    sudo modprobe nvidia_modeset
    sudo modprobe nvidia_uvm

Currently on driver version 470.63.01, issue still persists.

I can confirm this bug on ubuntu, pop os, manjaro, arch (basically every distro I have tested). The games work fine when launched in xorg.

Driver: 470.57 - 470.63
Hardware: Intel 1065G7 + Nvidia MX330

Nvidia driver 470.74, issue still persists.