High CPU usage in Xorg with NVIDIA reverse prime external monitor

Bug #1944667 reported by Rocko
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-470 (Ubuntu)
Expired
Undecided
Unassigned
xserver-xorg-video-amdgpu (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

With my Legion Slim 7 in hybrid graphics mode (using amdgpu to drive the laptop display) and an external monitor connected via the nvidia card on a USB-C/HDMI connection, Xorg consistently uses around 40% CPU even with no apps running.

If I put the laptop in discrete graphics mode so the nvidia card drives both the laptop display and the external monitor Xorg uses close to 0% CPU, which is what I would expect it to be in hybrid mode.

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: xserver-xorg-core 2:1.20.13-1ubuntu1
ProcVersionSignature: Ubuntu 5.13.0-16.16-generic 5.13.13
Uname: Linux 5.13.0-16-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
.proc.driver.nvidia.capabilities.gpu0: Error: path was not a regular file.
.proc.driver.nvidia.capabilities.mig: Error: path was not a regular file.
.proc.driver.nvidia.gpus.0000.01.00.0: Error: path was not a regular file.
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.suspend: suspend hibernate resume
.proc.driver.nvidia.suspend_depth: default modeset uvm
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 470.63.01 Tue Aug 3 20:44:16 UTC 2021
 GCC version: gcc version 11.2.0 (Ubuntu 11.2.0-5ubuntu1)
ApportVersion: 2.20.11-0ubuntu69
Architecture: amd64
CasperMD5CheckResult: pass
CompositorRunning: None
Date: Thu Sep 23 11:48:15 2021
DistUpgraded: Fresh install
DistroCodename: impish
DistroVariant: ubuntu
DkmsStatus:
 nvidia, 470.63.01, 5.13.0-16-generic, x86_64: installed
 nvidia, 470.63.01, 5.14.5-051405-generic, x86_64: installed
 nvidia, 470.63.01, 5.15.0-051500rc2-generic, x86_64: installed
ExtraDebuggingInterest: Yes
GraphicsCard:
 NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] [10de:2560] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Lenovo GA106M [GeForce RTX 3060 Mobile / Max-Q] [17aa:3801]
 Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c5) (prog-if 00 [VGA controller])
   Subsystem: Lenovo Cezanne [17aa:380c]
InstallationDate: Installed on 2021-09-15 (8 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Alpha amd64 (20210910)
MachineType: LENOVO 82K8
ProcEnviron:
 LANGUAGE=en_AU:en
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-5.13.0-16-generic root=UUID=99f436de-d37c-4b3e-adb2-612443efc197 ro rootflags=subvol=@ quiet splash amdgpu.backlight=0 vt.handoff=7
SourcePackage: xorg-server
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/02/2021
dmi.bios.release: 1.27
dmi.bios.vendor: LENOVO
dmi.bios.version: HACN27WW
dmi.board.asset.tag: No Asset Tag
dmi.board.name: LNVNB161216
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697WIN
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Legion S7 15ACH6
dmi.ec.firmware.release: 1.27
dmi.modalias: dmi:bvnLENOVO:bvrHACN27WW:bd08/02/2021:br1.27:efr1.27:svnLENOVO:pn82K8:pvrLegionS715ACH6:skuLENOVO_MT_82K8_BU_idea_FM_LegionS715ACH6:rvnLENOVO:rnLNVNB161216:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrLegionS715ACH6:
dmi.product.family: Legion S7 15ACH6
dmi.product.name: 82K8
dmi.product.sku: LENOVO_MT_82K8_BU_idea_FM_Legion S7 15ACH6
dmi.product.version: Legion S7 15ACH6
dmi.sys.vendor: LENOVO
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.107-1
version.libgl1-mesa-dri: libgl1-mesa-dri 21.2.1-2ubuntu2
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.20.13-1ubuntu1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20200714-1ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-1

Revision history for this message
Rocko (rockorequin) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

High CPU usage has always been a problem for the Nvidia driver. Although high CPU when no apps are running is new... Do you have any non-Ubuntu GNOME extensions running that might be updating the screen in ways you're not noticing? Xorg itself does idle to zero CPU very well so *something* external is probably triggering it.

affects: xorg-server (Ubuntu) → nvidia-graphics-drivers-470 (Ubuntu)
Changed in nvidia-graphics-drivers-470 (Ubuntu):
status: New → Incomplete
Changed in xserver-xorg-video-amdgpu (Ubuntu):
status: New → Incomplete
tags: added: amdgpu nvidia
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also your kernel log shows repeated crashes in the Nvidia driver:

WARNING: CPU: 10 PID: 2860 at /var/lib/dkms/nvidia/470.63.01/build/nvidia-drm/nvidia-drm-drv.c:574 nv_drm_master_set+0x27/0x30 [nvidia_drm]

I would recommend trying uninstalling the Nvidia driver for a brief while to see if the problems go away.

Revision history for this message
Rocko (rockorequin) wrote :

Thanks for looking so quickly. I'm almost certain the problem will go away without the nvidia driver because the nouveau driver didn't recognise the hardware when I booted off the USB installer, so reverse prime won't work and there will be no external monitor, which is a completely new problem.

I was logged into a clean profile with no non-standard gnome-shell extensions running, and 'top' showed Xorg (40%) and irq/93-nvidia (1%) and nvidia-modeset/ (0.3%) as the top three CPU hogs, so it's unlikely to be extensions causing it.

FYI, when I checked the journal log for those nv_drm_master_set errors right now, I can see a bunch at 11:47 and another bunch at 11:54, but nothing since (it's now 12:43). But the CPU usage is still high.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nvidia-graphics-drivers-470 (Ubuntu) because there has been no activity for 60 days.]

Changed in nvidia-graphics-drivers-470 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for xserver-xorg-video-amdgpu (Ubuntu) because there has been no activity for 60 days.]

Changed in xserver-xorg-video-amdgpu (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Peter Bennett (pgbennett) wrote :

I have a very simple solution that solved it for me.

I have an Acer Nitro with NVIDIA GeForce GTX 1650. After installing Ubuntu 22.04, every time I attached an external monitor the Xorg CPU usage was 25% - 33% even when nothing is running. This happens with driver 470 and 510.

To fix it - run the NVidia X-server settings app. Under Prime Profiles, select
NVIDIA (Performance Mode).
Reboot. Now Xorg CPU usage is 0.3%.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.