Xorg has high CPU and GPU usage

This is from htop:
image

and this is from nvtop:
image

This happens right after logging in and holds at these levels.



inxi -CG
CPU:       Info: 8-Core model: AMD Ryzen 9 5900HS with Radeon Graphics bits: 64 type: MT MCP cache: L2: 4 MiB
           Speed: 3575 MHz min/max: 400/4680 MHz Core speeds (MHz): 1: 3575 2: 3428 3: 4454 4: 4464 5: 3564 6: 3559 7: 3551
           8: 3546 9: 3334 10: 3553 11: 3553 12: 3550 13: 3597 14: 3553 15: 3594 16: 3555
Graphics:  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] driver: nvidia v: 495.44
           Device-2: Advanced Micro Devices [AMD/ATI] Cezanne driver: amdgpu v: kernel
           Display: x11 server: X.Org 1.21.1.1 driver: loaded: amdgpu,ati,nvidia unloaded: fbdev,modesetting,vesa resolution:
           1: 2560x1440~165Hz 2: 3840x1600~60Hz 3: 5120x2160~60Hz 4: 5120x2160~60Hz
           Message: Unable to show advanced data. Required tool glxinfo missing.

I have search around quite a bit. There seem to be a lot of people with this same issue, but I haven’t been able to find a solution.

1 Like

What are you running on your desktop? For example, do you have a conky that’s constantly updating?

I am not using conky. Is there a way to see what is running on the desktop? As far as I know, everything is default. I am using I3 and installed last week.

I tried installing a compositor but everything ran so slow after, I had to get rid of it.

A stackoverflow page I found recommended using strace. This is the output:

sudo strace -c -p 685
strace: Process 685 attached
^Cstrace: Process 685 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 59.19    0.575489           1    437006    108321 futex
 34.95    0.339809           2    159178           ioctl
  2.43    0.023670           0     55812           epoll_wait
  1.36    0.013212           0     36064     14762 recvmsg
  1.00    0.009745           0     35294           writev
  0.54    0.005279           0     26744           setitimer
  0.19    0.001858           7       249           mmap
  0.15    0.001415           0      5037       214 rt_sigreturn
  0.09    0.000901           0      5255           read
  0.05    0.000465           3       133           munmap
  0.05    0.000443           0      2326           epoll_ctl
  0.00    0.000001           0         6           shmat
  0.00    0.000001           0         6           getsockopt
  0.00    0.000000           0         6           shmctl
  0.00    0.000000           0         6           shmdt
------ ----------- ----------- --------- --------- ----------------
100.00    0.972288           1    763122    123297 total

There was just a new release of Xorg today, have you tried to see if this latest update fixes this issue yet?

:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Package (4)               Old Version  New Version  Net Change  Download Size

core/libpipeline          1.5.3-1      1.5.4-1        0.00 MiB       0.04 MiB
core/libtasn1             4.17.0-1     4.18.0-1      -0.13 MiB       0.12 MiB
extra/xorg-server         21.1.1-2     21.1.1-3       0.00 MiB       1.41 MiB
extra/xorg-server-common  21.1.1-2     21.1.1-3       0.00 MiB       0.03 MiB

Just updated and rebooted. Still having the same issue

Are you saying a lot of people with the same hardware? Not seen it mentioned here.
What else is running that is causing those high values on cpu and graphics.

Not the same hardware, just a similar issues with Xorg using high cpu.

What else is running that is causing those high values on cpu and graphics.

I am not sure, it happens right after logging in before opening any applications

What is actually this process trying to do that uses so much CPU:

/usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

?

-nolisten tcp vt7

to what?

Sorry, I am not sure what that means

1 Like

Me neither. That is why I am wondering.

Removing xf86-video-amdgpu seems to have solved, or at least considerably lessened, the problem.

1 Like

Xorg using CPU can be caused by a huge number of things.

There are various log files you can check, e.g. $HOME/.xsession-errors, that might cast some light onto the specific cause.

You have a hybrid setup, so that effectively disabled the AMD GPU in favour of the Nvidia GPU.

Removing amdgpu then you have no graphics from Ryzen 5900HS. :thinking:

If I understand correctly, it just switches to the modesetting driver. I have four displays. 2 through USB-C, one hdmi, and the laptop screen. I believe the HDMI port is connected to the integrated graphics and all of the displays seem to be working fine.

I wouldn’t know, you’re making changes and not telling us much about the system state afterwards. Minimal information means it’s only possible to get minimal help… :man_shrugging:

Which doesn’t mean the Nvidia GPU isn’t running all of them. Or, none of them. Who knows?

Sorry, I am not sure what information what information would be helpful in diagnosing. Here is a bunch of stuff that might be useful:

uname -r
5.14.15-arch1-g14-1
inxi -CG
CPU:       Info: 8-Core model: AMD Ryzen 9 5900HS with Radeon Graphics bits: 64 type: MT MCP cache: L2: 4 MiB
           Speed: 3268 MHz min/max: 400/4680 MHz Core speeds (MHz): 1: 3268 2: 3267 3: 2622 4: 2656 5: 2862 6: 2613 7: 2615
           8: 2614 9: 2610 10: 2747 11: 3268 12: 3269 13: 2614 14: 2615 15: 2615 16: 2607
Graphics:  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] driver: nvidia v: 495.44
           Device-2: Advanced Micro Devices [AMD/ATI] Cezanne driver: amdgpu v: kernel
           Display: x11 server: X.Org 1.21.1.1 driver: loaded: ati,modesetting,nvidia unloaded: fbdev,vesa resolution:
           1: 2560x1440~165Hz 2: 3840x1600~60Hz 3: 5120x2160~60Hz 4: 5120x2160~60Hz
           OpenGL: renderer: AMD RENOIR (DRM 3.42.0 5.14.15-arch1-g14-1 LLVM 12.0.1) v: 4.6 Mesa 21.2.4
supergfxctl -g
Current graphics mode: hybrid
glxinfo | grep OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD RENOIR (DRM 3.42.0, 5.14.15-arch1-g14-1, LLVM 12.0.1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.2.4
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.2.4
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

I told the Endeavouros installer to install I3 and I followed this guide https://asus-linux.org/wiki/arch-guide/ after installation.

Other than removing xf86-video-amdgpu I think everything else is the default.

Great - so you installed some random third-party software like “Supergfxctl - graphics switching” that might be interfering with the base GPU setup?

I’d be inclined to start over and get EnOS itself in a working state before adding additional software.

Oh, now I see it:

That’s a custom kernel too.

Yeah - revert to Arch defaults and then see if there’s a problem. If not then it’s this additional customisation.

Effectively, you’re not running EnOS at the moment.

3 Likes

This software is what makes things work in the first place, the latest kernel does not yet have the fixes that are implemented in 5.14.15-arch1-g14-1 for my specific computer, the GA503QM.

I am going to mark this as solved, because uninstalling xf86-video-amdgpu fixed my issues and there are not noticeable issues. I will try reinstalling it every so often to see if the issue has been fixed.

Just a question - what was the package xf86-video-amdgpu dpong for you? Is there not enough driving support in the kernel? For instance, I run an All AMD system, and I do not have a separate driver installed for my RX580…

Makes me wonder if some ‘arm-wrestling’ was going on for AMD control? (As you can tell - no actual knowledge on my part is involved in this speculation)…

1 Like