Bug 488982 - [Presentation Time] Having proprietary NVIDIA drivers loaded breaks Chromium Vsync on wayland.
Summary: [Presentation Time] Having proprietary NVIDIA drivers loaded breaks Chromium ...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-22 14:22 UTC by David G.
Modified: 2024-07-09 17:27 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David G. 2024-06-22 14:22:54 UTC
SUMMARY
I have a laptop system with AMD Ryzen integrated graphics running Kwin, and a dedicated NVIDIA GPU I use with PRIME to run games.

Having the nvidia proprietary drivers loaded, despite Kwin running on my AMD integrated GPU, breaks Chromium's ability to vsync to my 240Hz screen. It vsyncs correctly to my 120Hz laptop screen, but not my 240Hz one.

STEPS TO REPRODUCE
0. Use hybrid system with AMD Integrated graphics running Kwin, with NVIDIA dedicated graphics on the side.
0. Alternatively, try this with a fully-NVIDIA system (I'm not sure if the issue is also present in this case. I don't have such a system)
1. Make sure nvidia drivers are loaded and system is connected to a 240Hz screen (and a lower refresh rate one? I'm also unsure if this bug happens only with multiple-monitor setups)
2. Launch Chromium with --ozone-platform-hint=auto
3. Go to https://vsynctester.com

OBSERVED RESULT
Chromium fails to vsync (spiky frametime graph), framerate hovers at ~160-190

EXPECTED RESULT
Chromium vsyncs to 240Hz. Smooth and stable frametime graph

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 15,0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS TUF Gaming A17 FA706IU_FA706IU
Comment 1 David G. 2024-06-22 14:24:00 UTC
This issue does not happen if I unload the nvidia drivers. Chromium vsyncs properly to 240Hz if they are not loaded.
Comment 2 David G. 2024-06-22 14:25:22 UTC
Excuse me, I keep leaving out information.

I'm using the beta nvidia driver 555.52.04, but this issue is present in the stable drivers as well.
Comment 3 David G. 2024-06-23 11:31:45 UTC
Okay, it looks like Chromium kept picking to run on my Nvidia GPU instead of the integrated AMD one, I don't know why. Using firejail to blacklist the process from accessing /sys/class/drm/card0 and /sys/class/drm/renderD128 (the files corresponding to my Nvidia GPU) forces Chromium to pick the AMD one. Fixing the issue. Systems with Nvidia graphics only might still be affected, but I can't test this.
Comment 4 Zamundaaa 2024-07-09 17:27:10 UTC
Cross-GPU copies not being particularly fast in the NVidia driver is a known issue, most likely in your case the copies just take too much time to reach 240Hz. I don't think there's anything we can do about it except wait for NVidia to optimize their driver