Xorg process slows down UI while sharing screen

Hello.

I’ve noticed when Xorg process starts to load cpu ~5% (KSysGuard info) UI starts freeze: slow mouse cursor, slow scroll in browser.
Usually it happens while I share my screen with Discord, Zoom.
My HW:

  Kernel: 5.11.6-1-MANJARO x86_64 bits: 64 Desktop: KDE Plasma 5.21.3 
  Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: Micro-Star model: B450 TOMAHAWK MAX (MS-7C02) v: 1.0 
  serial: <filter> UEFI: American Megatrends v: 3.70 date: 06/09/2020 
CPU:
  Info: 8-Core model: AMD Ryzen 7 PRO 3700 bits: 64 type: MT MCP cache: 
  L2: 4 MiB 
  Speed: 3011 MHz min/max: 2200/3600 MHz Core speeds (MHz): 1: 3011 2: 2115 
  3: 1932 4: 2134 5: 2200 6: 2199 7: 2196 8: 2141 9: 2197 10: 2200 11: 2200 
  12: 2200 13: 2188 14: 4335 15: 3162 16: 2177 
Graphics:
  Device-1: NVIDIA GK208B [GeForce GT 710 1GB] driver: nvidia v: 460.56 
  Display: x11 server: X.Org 1.20.10 driver: loaded: nvidia resolution: 
  1: 1920x1080~60Hz 2: 2560x1440 
  OpenGL: renderer: GeForce GT 710/PCIe/SSE2 v: 4.6.0 NVIDIA 460.56 
Audio:
  Device-1: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel 
  Device-2: AMD Starship/Matisse HD Audio driver: snd_hda_intel 
  Sound Server-1: ALSA v: k5.11.6-1-MANJARO running: yes 
  Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:
  Device-1: Realtek RTL8812AE 802.11ac PCIe Wireless Network Adapter 
  driver: rtl8821ae 
  IF: wlo1 state: down mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  driver: r8169 
  IF: enp34s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
  IF-ID-1: br-4ef831da16ae state: down mac: <filter> 
  IF-ID-2: docker0 state: down mac: <filter> 
  IF-ID-3: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:
  Local Storage: total: 2.05 TiB used: 516.81 GiB (24.6%) 
  ID-1: /dev/nvme0n1 vendor: HP model: SSD EX920 256GB size: 238.47 GiB 
  ID-2: /dev/sda vendor: Seagate model: ST2000DM008-2FR102 size: 1.82 TiB 
Partition:
  ID-1: / size: 76.4 GiB used: 15.91 GiB (20.8%) fs: ext4 dev: /dev/nvme0n1p6 
  uuid: a05b0788-cb1c-4062-982c-0a21af4d6f41 
  ID-2: /boot/efi size: 511 MiB used: 332 KiB (0.1%) fs: vfat 
  dev: /dev/nvme0n1p8 uuid: DF6D-CB57 
  ID-3: /home size: 56.16 GiB used: 3.66 GiB (6.5%) fs: ext4 
  dev: /dev/nvme0n1p7 uuid: 2d0172f1-7bf2-4036-b001-a7f58277dd99 
Swap:
  ID-1: swap-1 type: partition size: 39.06 GiB used: 0 KiB (0.0%) 
  dev: /dev/nvme0n1p5 uuid: bbd1991e-a421-4e41-871d-491f57630a2e 
Sensors:
  System Temperatures: cpu: 52.4 C mobo: 31.0 C gpu: nvidia temp: 44 C 
  Fan Speeds (RPM): fan-1: 0 fan-2: 869 fan-3: 0 fan-4: 0 fan-5: 920 fan-6: 0 
  gpu: nvidia fan: 40% 
Info:
  Processes: 397 Uptime: 9h 21m Memory: 31.37 GiB used: 8.23 GiB (26.2%) 
  Shell: Bash inxi: 3.3.03 

I have two monitors: FullHD and 2K.

I’ve tried to do these actions on my laptop (i5 + GeForce 1050 4GB). There Xorg tends to load ~7% and no freezes happen.

Also I turned off compositor and use OpenGL backend. Tried to use XRender but I got the same behaviour.

This PC on Windows 10 works without any freezes.

What can I do to resolve these freezes?

Hi @hound,

  1. I don’t think that’s freezes. AFAIK freezes doesn’t just slow down your computer, but completely hangs it while it still looks fine. According to how I understand it, that’s just sluggishness,

  2. I see that you’re using kernel 5.11. Have you tried something else? Like 5.10 or 5.4? Both of which are LTS kernels. If not, I’d suggest it.

Hope it helps!

2 Likes

There’s the cause. And I see that you’re using the proprietary Nvidia driver, which is more than likely the source of the problem. Unfortunately, when it comes to that driver, you are at the mercy of Nvidia, given that the driver code is closed-source. :man_shrugging:

1 Like

Try to use 5.10 got the same :frowning:

I use proprietary driver on laptop too and there is no issues.
I thought that my video card is too weak, but on Windows it works fine.

In Nvidia tools I noticed that system uses about 800mb of video ram (my card has only 1gb).

something heavy for 800mb

only on 1920x1080 screen with 970 nvidia card

nvidia-smi
Sun Mar 21 09:39:41 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.56       Driver Version: 460.56       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 970     Off  | 00000000:07:00.0  On |                  N/A |
|  0%   50C    P0    46W / 201W |    180MiB /  4034MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       550      G   /usr/lib/Xorg                     147MiB |
|    0   N/A  N/A       804      G   xfwm4                               2MiB |
|    0   N/A  N/A      2008      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      2123      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      2219      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      2247      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      2302      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      3453      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      4452      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      4526      G   /usr/lib/firefox/firefox            2MiB |
+-----------------------------------------------------------------------------+

Strange…this can be cause of my issue?

If your graphics adapter isn’t powerful enough, then yes.

But on Windows all works fine…
That’s confused me

The Nvidia driver you use in Windows is not the same as the one you use in GNU/Linux. It’s a different operating system, and the way the driver interfaces with the underlying kernel is different too. :man_shrugging:

I see…
More powerful video card can help?

Possibly. Or a better driver. But I’m afraid this is outside of my sphere of knowledge. All I can tell you is that I’ll never buy a computer with Nvidia again if I can help it. AMD and Intel both offer open-source, GPL-licensed drivers for their GPUs, while with Nvidia, you must either use the crippled reverse-engineered nouveau driver or a proprietary, closed-source driver of which nobody knows what it does.

:man_shrugging:

Oh…why it’s complicated on Linux :frowning:

But anyway I’d want to be sure that these issues happened due to video card and only due to video card

Strange. I got smth like this. Why there are no processes?

Sun Mar 21 20:40:54 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.56       Driver Version: 460.56       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GT 710      Off  | 00000000:26:00.0 N/A |                  N/A |
| 38%   42C    P8    N/A /  N/A |    749MiB /   973MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                              
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

The nvidia-smi documentation writes:

Reporting for Graphics processes is limited to the supported products starting with Kepler architecture.

so this could be the reason why processes are not shown.

I’ve had this before with Xorg and it’s a bug in an application you’re using.

So basically what is happening is that xorg is using 100% of 1 core on your 8-core machine.

File a bug with the application developer (I’ve had it with VLC and qBittorrent and their bugs have been fixed in the mean time and you seem to have this with Discord and Zoom, which I don’t use.)

:+1:

But on another PC there is no such bug.
I have two laptops:

  1. Ryzen 5 + Vega 8 - works fine
  2. i5 + GTX1050 - also works fine (this laptop use GeForce instead intel by default)

And also I noticed that browser (Chrome) works more smoothly in laptop with Ryzen5 + Vega8.
Smoothly in some heavy web apps (maps, lucidchart etc)