Bug 496941 - Compositor performance slow with Nvidia GPU, AMD iGPU
Summary: Compositor performance slow with Nvidia GPU, AMD iGPU
Status: RESOLVED DUPLICATE of bug 452219
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: 6.2.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-02 17:16 UTC by Lorant Viktor Gerber
Modified: 2024-12-04 13:50 UTC (History)
1 user (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 Lorant Viktor Gerber 2024-12-02 17:16:03 UTC
SUMMARY
Hello!
I have a laptop with an Nvidia GPU, and an AMD iGPU. The setup is as follows: for the internal display, and HDMI port, the Nvidia GPU's output is passed through the iGPU, and when using a USB-C DisplayPort, the output is directly connected to the Nvidia GPU.

When connecting to the DisplayPort, to the dGPU, the performance of KWin degrades severely, and can't maintain a smooth refresh rate (I know the performance overlay isn't supposed to be used for debugging; it reports a quite low ~40fps though, which feels about right for what I'm seeing). The monitor connected in this case is a 1440p 165Hz display. HDR and VRR do not make any difference.

Connecting this display through the HDMI port, which passes through the iGPU, everything fine. Higher resolution displays also do work smoothly when they are connected to the HDMI port. The only difference I found in that case, is that the kwin_wayland process uses the iGPU for compositing, and when connected directly to the dGPU, it uses that Nvidia card for compositing.

I'm not sure how to go about troubleshooting this issue, if anything is needed from the system, do ask. Thanks!

STEPS TO REPRODUCE
1. Have a laptop with an AMD iGPU and Nvidia dGPU
2. Connect directly to Nvidia dGPU
3. Observe

OBSERVED RESULT
Performance of the compositor is degraded when rendered with the dGPU.

EXPECTED RESULT
Performance of the compositor is on par with, or better than the iGPU, when using the more powerful dGPU.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.12.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800HS with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
Nvidia driver version: 565.57.01
dGPU: NVIDIA GeForce RTX 3050 Laptop GPU
Comment 1 Lorant Viktor Gerber 2024-12-02 17:37:09 UTC
Can't seem to screenshot the FPS overlay that I turned on, so I'll just comment the numbers. Monitor target refresh rate is 165Hz.
Connected to Nvidia GPU (Wayland):
 - Empty desktop: 142 fps
 - 1 Konsole window visible: 55 fps
 - Firefox visible fullscreen, typing this report: 110 fps
 - 1 bloatware (Discord): 55 fps

Connected to AMD iGPU (Through HDMI):
 - Target 144Hz reached in all cases (144Hz due to HDMI limitations)

Connected to Nvidia GPU (X11):
 - Target 165Hz reached in all cases
Comment 2 Zamundaaa 2024-12-04 13:50:21 UTC
Multi GPU copies are known to be very slow in the NVidia driver. There's nothing we can do about this unfortunately, but NVidia is investigating it.

*** This bug has been marked as a duplicate of bug 452219 ***