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

Hello,

I see a constant 30% CPU usage in this particular xorg process:

/usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3

With some perf I have found that most of the time is spent on:

- 32,91% 32,65% [vdso] [.] 0000000000000755
- 32,65% clock_gettime

This only happens when the external monitor is plugged in. Since this a laptop with hybrid graphics, the external monitor is connected directly to the Nvidia card.

How I can solve this problem? Because of this, the fans are always on and I can also see that the desktop lags a bit.

I have attached the support script output. nvidia-bug-report.log.gz (461.5 KB)

Thank you!

2 Likes

The monitor gets detected over and over again, please check/replace cable.
Please also check if this is also happening in nvidia prime output mode.

Hello Generix,

Thank you for your answer.

I changed the cable and the problem is the same.

I also changed the configuration from hybrid to Nvidia only, and high CPU problem is gone. Is there anything I can do to be able to use the hybrid mode?

Thank you!

1 Like

There seems to be a hidpi-daemon hammering nvidia-settings at time. Can you kill it to test if that’s responsible for the monitor-requeries?

Hello,

I have disabled, then killed the daemon. But the 30% CPU usage is still there. I also tried connecting the screen with HDMI and USB-C, makes no difference.

I am attaching the new outputs in case they help. nvidia-bug-report.log.gz (334.8 KB)

Regards.

Do you see any other process in top that’s eating an unusual amount of cpu? The logs look like something is calling “xrandr” in a loop.

Hello,

No, all the CPU usage goes to that xorg process, that internally are all clock_gettime syscalls. Every other process is mostly idle. Once I disable hybrid mode and only use Nvidia, the problem is gone. The desktop is more responsive, the CPU usage goes back to normal, but of course battery usage increases.

If I can collect any data that could help in the analysis of the issue, let me know and I will be happy to do it.

In any case, thank you for the time spent helping me!

1 Like

The monitors get requeried in fast succession, which gets written to the log, which is why clock_gettime is called. No idea what initiates the query, though.

I have the same issue as OP.

Hybrid graphics. Nvidia and Intel.

NVIDIA GeForce GTX 1070 Mobile

Running Pop OS 20.10

Driver installed:
xserver-xorg-video-nvidia-460 460.39-1pop0~1611882295~20.10~5279175

Kernel: 5.8.0-7642-generic

$ system76-power graphics
hybrid

nvidia-bug-report.log.gz (632.5 KB)

I get the feeling this is popos specific. It has its own means of switching graphics, there should be some system76-powerdaemon and a gnome plugin, please check if disabling both stops the requeries.

I also have the same issue as OP on Manjaro Linux.

Hybrid graphis - Intel + Nvidia.

Nvidia GeForce GTX 1650 Mobile

Running Manjaro
Kernel: 5.9.16-1-MANJARO

I have exactly the same problem on Fedora 33 on Lenovo P51 (Intel and Nvidia). Xorg cpu usage is always over 30% . I suspect the periodic Zoom hangs (over 300% cpu usage for a few minutes) are related.
Changing the configuration in BIOS from “Hybrid” to “Discrete”(Nvidia only) fixes the problem, but one has to remember to change BIOS settings every time the laptop is taken out of the dock :)

Nvidia packages are 3:460.67-1.fc33, kernel is 5.11.10 . From the lspci -k :

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
Subsystem: Lenovo Device 224d
Kernel driver in use: i915
Kernel modules: i915

01:00.0 3D controller: NVIDIA Corporation GM206GLM [Quadro M2200 Mobile] (rev a1)
Subsystem: Lenovo Device 224d
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
01:00.1 Audio device: NVIDIA Corporation GM206 High Definition Audio Controller (rev a1)
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel

I’m experiencing the same problem on a X1 extreme gen 2 running pop os.
The CPU load of the same exact process “/usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3” is always very high especially when I connect my external monitors.
I’m desperately trying to fix this problem since the summer is coming and the laptop’s cpu temperatures are getting out of control.

I too have this problem. I need to investigate and characterise it more fully (tomorrow) but in the mean time, is there any further activity on this thread?

I have the same problem in an Acer Predator Helios 300 laptop, with a 1660 gtx gpu. I would also add that when I turn off the laptop display, everything but the mouse becomes super slow in the display connected to the hdmi output.

Could this have anything to do with the issue? DisplayLink displays runs at 1FPS when laptop lid is closed. (#1028) · Issues · xorg / xserver

The same problem on Lenovo Legion 5 Ryzen 4800H GTX1650ti in hybrid graphics mode with external monitor (via HDMI). Ubuntu 21.04, kernel: 5.13.5-051305-generic, nvidia driver: 470.57.02
Happy to help with logs or experiments if required!

Same problem here, not with hybrid graphics but with an actual graphics card (RTX 3080), I have provided an exhaustive list of the troubleshooting steps I took while trying to fix this problem as well as a bug-report log in this thread : Very High Xorg CPU usage using latest Drivers with an RTX 3080

i also have this problem running:
popos 21.04
nvidia driver 470.57.02
gtx 1070ti (3monitors)
i5 8600k