High CPU usage on xorg when the external monitor is plugged in

I have 4 monitors with mixed refresh rates running on KDE and used to have high GPU usage plus high usage on one cpu core. The settings I found that seemed to fix it were Allow Flipping in nvidia-settings, and using Option “UseNvKmsCompositionPipeline” “false” in xorg conf. Turning off Allow Flipping got rid of the high cpu usage, and the xorg option got rid of the high gpu usage. Now on idle desktop, cpu is at 0% and gpu is at 0-2%. May or may not help in your case, but maybe worth a try.

Okay i had this problem, you need to switch your rending back-end to Xrender, some things may not work properly, like video playback on your external monitor may drop some frames, and things like games may tear a little, but you wont have 1 of your cores tied up by the compositor catching one of NVIDIA™s bugs over and over, im not even sure why it works, nothing in the log indicates it should but my knowledge is limited, im not gonna question it tho

Same problem for me on a Lenovo P1 Gen2 (NVIDIA Corporation TU117GLM [Quadro T2000 Mobile / Max-Q] / Mesa Intel® UHD Graphics 630 (CFL GT2)) and Ubuntu 21.04.

Not sure about it, but I think it doesn’t start happening until I call xrandr to set the displays.

Can confirm it doesn’t happen on prime-select nvidia and “Perform Maximum Performance”.

This is also happening to me when connected to an external display. In hybrid mode GPU usage is at 30-40% and CPU usage on xorg is ~50%. This is idle and they never drop below that. Switching to Performance Mode i.e. fully discrete GPU fixes the issue. The solution isn’t ideal, because when not connected to external display, I’d like to use integrated gpu for better battery life. Now I need to restart every time to switch between the modes.

I have Lenovo ThinkBook 16p Gen 2 which has AMD integrated GPU and NVidia 3060 RTX. Running latest Ubuntu 21.04 and nvidia drivers 470.63.01.