[X11][Optimus][Hybrid GPU] Choppiness with multiple monitors divided over two GPUs
Hello
Since about a year ago I received a new laptop that has an Optimus setup with an Intel iGPU and an NVIDIA dGPU and am using an ultra-wide external monitor (detailed specs below). With this setup, I'm having a rather poor experience on Xorg where everything desktop-related is extremely choppy on both monitors. Looking at top
, Xorg is constantly at around 40% in the %CPU
column, no matter if the desktop is idle or not.
Running glxgears to get a rough idea of performance shows that it can make 220 FPS, but it's obvious it's not swapping that amount of frames consistently, on either monitor. The mouse cursor however is usually very smooth, as expected on the refresh rates I have (see below), but when other animations happen they slow down as well.
I'm not familiar with the code and display stack, but this sounds a bit like excessive copying is happening on the CPU due to the dual GPU setup.
Setup Details
- Intel iGPU with modesetting driver (10th Gen Intel Core i9).
- NVIDIA RTX 2070 Super dGPU with proprietary driver.
- KMS is enabled for PRIME synchronization, but disabling it makes no difference.
- Two screens:
- Laptop screen is connected to the Intel iGPU, resolution is 1920x1080@300Hz.
- External screen is connected over DisplayPort and USB-C to the NVIDIA dGPU directly, resolution is 3440x1440@144Hz.
- Running on:
- Arch Linux x64
- Kernel 5.15
- GNOME 41.1.
- X11 21.1.1
Other Interesting Information
- Disabling the external monitor improves the situation slightly, but it's still choppy. glxgears still renders at ~220 FPS in that case, so nothing really starts rendering "faster" in a way, though it still feels less choppy.
- Disabling the internal monitor is impossible to test since it suffers from rendering at 1 FPS (#948).
- The NVIDIA GPU is usually at its lowest clock level or the first (of four), which is fine.
- Enabling "Prefer Maximum Performance" in the NVIDIA configuration utility doesn't improve the situation, but the CPU usage lowers to about 15% to 20%.
- I can disable Optimus in my BIOS, this is what I've done up until now due to the poor experience - with just the NVIDIA card everything in GNOME is very smooth on both monitors and Xorg CPU usage is near 0% when the desktop is idle.
- I've briefly tested Wayland on GBM with NVIDIA 495 as well, for comparison's sake:
- Disabling the external monitor, Optimus works with PRIME offloading, and it's noticeably smoother than X11 in this setup. This is certainly promising for dual-GPU setups.
- Using the external monitor cannot be tested (yet) as, even though GNOME recognized a second monitor, the monitor is never turned on, likely due to the NVIDIA driver not configuring it on Wayland yet because it is not the main GPU.
I never bothered reporting this because NVIDIA Wayland support is on the way, but I thought it might be good to have a report on this anyway, if only to share information or confirm that this is a problem as long as we cannot move to Wayland.