Bug 504086 - Tearing when refresh rate is over 120hz
Summary: Tearing when refresh rate is over 120hz
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.3.4
Platform: Arch Linux Other
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-12 06:12 UTC by Johan
Modified: 2025-05-14 15:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The wallpaper that most often causes the tearing. (2.11 MB, image/png)
2025-05-14 14:39 UTC, Johan
Details
Causes some tearing at some times, but not nearly as often-wallpaper (1.93 MB, image/jpeg)
2025-05-14 14:39 UTC, Johan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan 2025-05-12 06:12:03 UTC
So I am currently running KDE Plasma 6.3.4 on CachyOS and I have noticed a weird flickering/tearing bug whenever I am on the desktop, as some apps (including KDE Panels like the taskbar) will start to tear a lot before suddenly stopping. After some investigating it seems related to the refresh rate, as I am using 4k 240hz. If I lower the refresh rate to 120hz, it stops. 

The video can be found here: https://www.reddit.com/r/kde/comments/1khl54f/comment/mr8axrw/

STEPS TO REPRODUCE
1. Own a 4k+high refresh rate monitor
2. Set the resolution to 4k, the refresh rate to at least 144Hz, and the global scaling factor to 150%.
3. Drag som windows up and down.

OBSERVED RESULT
Crazy tearing/rectangular holes on the window being dragged, and flickering on the taskbar.

EXPECTED RESULT
Smooth dragging with no artifacts


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.3.4
Graphics Platform: Wayland
Graphics Card: Nvidia RTX 4090, driver is 570.144
Monitor: Alienware AW3225QF QD-OLED 240hz monitor

ADDITIONAL INFORMATION
What is interesting is that this bug does not happen in Gnome at all, so I suspect that this is somehow related to KDE/Kwin. Perhaps it is related to DSC as well?
Comment 1 Zamundaaa 2025-05-13 16:17:21 UTC
That video never loads, can you upload it somewhere else? My hunch here would be that it's a driver synchronization bug though.
Comment 2 TraceyC 2025-05-13 16:49:38 UTC
I was able to view the video with DeGoogled Chromium, but it's best to upload it somewhere else or ideally attach a video to this bug report.

Based on the tearing I saw in the Steam window, the graphical glitches look exactly like bug 494547, which involves the nouveau drivers
Comment 3 TraceyC 2025-05-13 16:55:37 UTC
I'm not able to reproduce this on git-master Wayland, on a monitor with the refresh rate set to 144Hz and 150% scaling
nVidia GPU, proprietary drivers v 570.144
The monitor is 1440p so this likely only presents with 4k
Comment 4 Johan 2025-05-13 23:42:23 UTC
Hi there!

Absolutely, can you try this link: https://drive.proton.me/urls/63Y64J70ZM#YIlJNGwTOuZk

I also recently found someone else with this issue (he also has a 4K 240hz monitor) on the CachyOS subreddit: https://www.reddit.com/r/cachyos/comments/1kii9t4/why_does_cachyos_hate_my_monitor_screen/

I suspected at first it was related to DSC but as my monitor uses that regardless of resolution and refresh rate, it isn't related to that. It's worth to note that I am not using the nouveau drivers, instead I use the "open" drivers from Nvidia.

What should the next step be? Anything I can provide or should I create a bug report somewhere else?
Comment 5 Zamundaaa 2025-05-14 12:07:39 UTC
Ok, that definitely looks like a synchronization issue. I also found https://www.reddit.com/r/linux_gaming/comments/1kk04vg/screen_tearing_when_i_using_anything_above_60_fps/, about the same thing happening on hyprland, so it's at least very likely to be a bug in the driver.

You can report this at https://forums.developer.nvidia.com/c/gpu-graphics/linux
Comment 6 Johan 2025-05-14 14:37:45 UTC
Hi @Zamundaaa,

thanks for the investigation, but I wanted to understand why you think it is a driver synchronization issue? I could understand if it was due to that if we had multiple monitors enabled, but I see this issue with only one monitor enabled, so then the compositor shouldn't be confused due to multiple various refresh rates (if I'm not mistaken of course).

Another thing I noticed regarding this error is that it seems to be somewhat affected by the wallpaper I'm using. In this video, you can see that when I switch to the black wallpaper, the issue start to appear, but as soon as I switch back to my colored wallpaper, it stops happening. This is really bizarre so let me add the video here: https://drive.proton.me/urls/CYQQKSHD9R#yHdPLBFlzEHl

I have also attached the wallpapers in question so that you can try for yourself if you can make it happen (I suspect not but worth a shot).
Comment 7 Johan 2025-05-14 14:39:14 UTC
Created attachment 181293 [details]
The wallpaper that most often causes the tearing.
Comment 8 Johan 2025-05-14 14:39:48 UTC
Created attachment 181294 [details]
Causes some tearing at some times, but not nearly as often-wallpaper
Comment 9 Zamundaaa 2025-05-14 15:03:18 UTC
What you're seeing is not actually tearing, that looks different and never shows anything below the current window.

What you're seeing is almost certainly that the driver doesn't report correctly when compositing is complete, which makes KWin send it to the screen while it's still rendering. If the image is shown too early, when it's not done rendering yet, then parts of the screen can have windows be see-through like in your videos. Because this is a race between rendering speeds and sending the image to the display, a lot of random-ish things can make it better or worse.