NVIDIA BUG, KDE Wayland Games are Force Vsynced

Hello,

First of all happy holidays to everyone.
This has been an issue for quite some time now, it has been reported all the way back in february and there hasn’t been any solution to it.
Under KDE Wayland session when you run a game or an application in fullscreen(or borderless windowed/fullscreen), it has both very weird frame timing(making the picture look not so smooth especially if gpu is above 95% usage) and the frame rate being limited to your monitor’s refresh rate.
While yes under wayland(until recently) everything is force vsync’ed anyways, the frame rate itself isn’t capped(which doesn’t increase the latency as it is seen on this issue, and additionally affect the performance) under both Intel and AMD.
It was confirmed that it is an nvidia driver related bug, due to how nvidia handles the buffers compared to MESA and some workaround fixes were mentioned by Erik Kurzinger on the bug report of KDE.
However it has been almost 4 months and no fix came in the drivers that followed since…

https://bugs.kde.org/show_bug.cgi?id=450914

3 Likes

@ekurzinger Hello, can we get information about this issue? And also i wonder when gamma_lut support will be added. I assume a lot of people use the night light feature. It would be great if we could get information about the latest situation. Thanks.

1 Like

Hi, I’m currently working on a driver-side change that should resolve the forced vsync issue, as well as enable direct scan-out for eligible Xwayland applications.

Work on Gamma LUT support is also in progress. The implementation is currently under internal code-review.

9 Likes

Additional information on the state of tearing in Wayland: The tearing protocol got merged last month. The KWin implementation of this protocol was also merged (platforms/drm: tearing (!927) · Merge requests · Plasma / KWin · GitLab) and will be available in Plasma 5.27 (next February I think). There is ongoing work in Kernel and XWayland side from what I read last.

1 Like

Fantastic, thank you! Will this work also allow for G-Sync in games on Wayland?

After the 525.xx drivers in the proprietary the vrr_capable seems to be present as the option to allow G-Sync under kde wayland is there, but it doesn’t work(as in nothing happens). Once the direct scanout is applied + the forced vsync is fixed, in theory it should work.

G-Sync should be working with native Wayland applications. With Xwayland applications I suspect the main issue is the lack of direct scan-out support. In that case the display refresh rate would match the frame-rate of kwin, not the frame-rate of the game. The “forced vsync” thing is a separate problem. If you’re using G-Sync, you want the frame-rate capped to the max display refresh rate anyway, right?

3 Likes

In Windows there was the practice of capping the frame rate just under the refresh rate when using G-Sync to avoid the vsync delay, not sure if that was ever true or if it still applies (specially without a G-Sync module). But yes, generally speaking, when using G-Sync you’d want the cap. If you’re disabling v-sync you’re probably shooting for much higher fps than the refresh rate, CS:GO for example.

I installed sway-git and wlroots-git from AUR today just to make sure I’m on the latest code and enabled “adaptive sync”. Games running in Xwayland (through Proton, DXVK, and VKD3D) are definitely broken and I’m really looking forward to the direct scan-out support, looks like Sway added DMA-BUF in 1.7 if that helps at all.

Also happy to test in KDE Plasma, whatever gets me G-Sync and multiple monitors sooner. Thanks!

Ooooh correct, I just thought it could also affect G-Sync from working. Yes that is indeed the case capping the framerate to the monitor’s max display refresh rate. Apologies.

EDIT: Tested on CS GO via SDL2 to make it run as native wayland and G-Sync didn’t kick in. Could it be that it is affected by the same problem witnessed in Xwayland applications ?

Didn’t allow me to edit again, so I’ll go ahead here:
I tried to see if G-Sync would kick in with a native wayland application such as RetroArch, set to fullscreen/borderless fullscreen still doesn’t make G-Sync work even if I set it to Always to be used on the display settings instead of Automatic.

Additionally the native wayland applications are also force vsync’ed with strange frame timings.

Apologies for the 4th post… it just doesn’t allow me to edit the previous post.
I was able to toy around and even though SDL2 runs “native wayland” it still seems like it treats it as xwayland application in the sense that the same Glamour bug is present(visible when I move the mouse and focus to a window on 2nd monitor while the game is running, lots of de-sync artifacts very similar to what is observed with the Glamour bug).
However I wasn’t able to understand why Retroarch which is a completely native wayland app(doesn’t run on xwayland even if you try to force gamescope) doesn’t do g-sync… Not sure if it’s useful information or not, but just wanted to leave it if it helps out on debugs, etc

No option to edit …
Just wanted to update real quick: since plasma 5.27 beta is out now and has the option to allow tearing, with it at least only the forced vsync is present which smooths it out and doesn’t cause weird frame timings, however the bug itself is still present.
As for G-Sync, I wasn’t able to see any bug logs in regards to why g-sync hasn’t kicked in for native wayland apps(even gamescope doesn’t allow it to run at all if it’s relevant info).
Apologies once again for another post, if I could I would edit and would love to help out on the devs whom are probably too busy with a lot of bugs/issues.

Sorry to bother you, but can we get any update on the forced vsync issue?

1 Like

On GNOME 43 and NVIDIA 525 driver, I was experiencing the same issue (forced VSync in full-screen apps), however, on GNOME 44 and NVIDIA 530, the issue no longer happens.

I’m not 100% sure whether it was the GNOME update or the NVIDIA driver update which fixed the issue, since I had VSync enabled in games when I updated to GNOME 44, and only retested this issue after the NVIDIA driver update. Also note, I’m on a hybrid graphics laptop with PRIME and no mux switch.

Hi, come here to report that this bug is still present on KDE Plasma 5.27.4, NVIDIA 530.41.03. NVIDIA GeForce RTX 3070 Laptop GPU.

I’m also still experiencing this problem, with KDE Plasma 5.27.4 and nvidia-dkms 530.41.03.

On Arch, I recently tried using Gnome 44 through the FCGU Repo, as @retrixe suggested, but the issue still occured.

This problem is known for almost half a year and is apparently one of the last roadblocks for Wayland, now that the tearing protocol is mostly merged, hopefully there’s an update soon.

Any update on this? And any updates on complete wayland drivers? It would be nice to have feature parity with amd on both servers and desktops

sorry for replying to the old thread @ekurzinger does the change required to run games in wayland without vsync been merged yet?

The vsync issue will be fixed in the 545 driver release. Unfortunately I wasn’t able to get it in in time for the 535 release which will go public in a few days, sorry. But 545 will be the next release after that (we’re skipping 540 for whatever reason).

10 Likes