External HDMI monitor is laggy on NVIDIA-525 reverse PRIME system

Bug #2009767 reported by Kai-Chuan Hsieh
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
New
Critical
Unassigned
nvidia-graphics-drivers-525 (Ubuntu)
Fix Committed
Undecided
Unassigned
Bionic
Fix Committed
Undecided
Unassigned
Focal
Fix Committed
Undecided
Unassigned
Jammy
Fix Committed
Undecided
Unassigned
Kinetic
Fix Committed
Undecided
Unassigned
Lunar
Fix Committed
Undecided
Unassigned
xorg-server (Ubuntu)
Fix Released
High
Unassigned
Bionic
New
Undecided
Unassigned
Focal
New
Undecided
Unassigned
Jammy
Fix Released
High
Unassigned
Kinetic
Fix Released
Undecided
Unassigned
Lunar
Fix Released
High
Unassigned

Bug Description

[Impact]
NVIDIA driver has a hardcoded version check to see if a bug has been fixed in the xserver version. It does not help to backport the fix to the jammy xserver, as the driver has no way to check if the fix is there or not.

We need to backport xorg-server from kinetic to jammy.

[Test case]
install xserver update, check that lagginess is gone

[Regression potential]
This is a backport of kinetic xorg-server to jammy, with 34 new upstream commits of which three were already backported due to CVE's, and a bugfix. 18 commits only touch darwin/XQuartz and won't affect us. As such, there should be a low chance of things breaking. Here's a list of the remaining 12 commits with above filtered out:

6bf62381d0a1fb5 xserver 21.1.4
855b96a85bc0711 xfree86: Fix event data alignment in inputtest driver
b713e717c34d539 dix: Correctly save replayed event into GrabInfoRec
cd3d21d8c44a35c xkb: fix XkbSetMap when changing a keysym without changing a keytype
f575524314e9f20 Revert "os: Try to discover the current seat with the XDG_SEAT var first"
433f53a1a08390a tests: Fix build failure from missing micmap.c
3868f364728ae0c xf86-input-inputtest: Fix build on systems without SOCK_NONBLOCK
afcaaac96767d77 print_edid: Fix a format string error
663af2f17eec2cc X11Application: Ensure TIS operations are done on the main thread
bd3564cf377deac rootless: Dead code removal (ROOTLESS_REDISPLAY_DELAY is already defined)
53173fdab492f0f render: Fix build with gcc 12
69774044716039f present: Check for NULL to prevent crash

--- original info

[Summary]
When the graphic mode is on-demand mode and plug in the monitor to HDMI port, there are two issue occures:
1. External monitor's screen is very laggy in external monitor mode only.
2. External monitor's screen sometimes (~50%) will be black in join display mode.

[Steps to reproduce]
1. Boot in OS
2. Plug in the external monitor in HDMI port
3. Find the cursor moving in external monitor is laggy

[Workaround]
Downgrade to NVIDIA driver 515.

[Additional information]
Feedback from NV:

An NVIDIA driver built with the features needed to get rid of the laggy monitor problem causes Xorg 1.21.1.3 to crash. There's a patch for Xorg to fix the crash (https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275) and it was first included in the 1.21.1.4 release.
Since the older X servers crash, NVIDIA deliberately does a version check in the driver and enables these features for Xorg servers that are known to work, i.e. 1.21.1.4 or higher.

This unfortunately prevents backporting the fix to 1.21.1.3. Engineering has chosen this approach since a crash is worse than the low FPS lag and the user might lose work merely by plugging/unplugging displays. If it was about a performance degradation, slight corruption, or something non-fatal, we wouldn't need to check Xorg version

tags: added: oem-priority originate-from-2007556 somerville
jeremyszu (os369510)
tags: added: originate-from-2003066 stella
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If you experience this problem in Wayland sessions then that's bug 1970291.

Dirk Su (dirksu)
tags: added: originate-from-2008875
jeremyszu (os369510)
tags: added: originate-from-2009792
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg-server (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also seen in bug 2007079 and bug 2004349

tags: added: nvidia
Changed in xorg-server (Ubuntu):
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Mauro mentioned that downgrading from 525 to 515 was a workaround for him. Does that sound like the same issue?

Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

Can Mauro try the xorg-server in kinetic with NV 525 driver? if it fix the issue, we can know if they are the same issue.

Rex Tsai (chihchun)
Changed in oem-priority:
importance: Undecided → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

He already was using kinetic when the problem occurred (bug 2004349). Although has since upgraded to lunar.

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

Bug 2007079 also shows the problem is in kinetic.

Revision history for this message
jeremyszu (os369510) wrote :

Hi Daniel,

The fix for this issue not only requires xorg 1.21.1.4, but also a newer version of the Nvidia driver. We have confirmed that the combination that fixes this issue is (1) xorg 1.21.1.4 (from Kinetic) + (2) a development version of the Nvidia driver, which is under NDA.

To be honest, Nvidia is also a black box for us. We don't know the root cause of the lag or whether it affects only the Nvidia-525.

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

OK since a full fix will require a new driver I've added an Nvidia task to track that... So the Xorg task here either shouldn't exist or should be Fix Released??

Revision history for this message
jeremyszu (os369510) wrote :

Yes, a nvidia tracker is needed. There are some questions we need to sync with nvidia.

The Xorg task is needed (for jammy) because the nvidia driver will check the version of Xorg (need 1.21.1.4+) to turn-on some features.

Changed in xorg-server (Ubuntu):
status: Confirmed → Fix Released
Changed in xorg-server (Ubuntu Jammy):
status: New → Confirmed
importance: Undecided → High
no longer affects: nvidia-graphics-drivers (Ubuntu Jammy)
Changed in nvidia-graphics-drivers (Ubuntu):
importance: Undecided → High
status: New → Confirmed
tags: added: performance
tags: added: originate-from-2011401
Timo Aaltonen (tjaalton)
Changed in xorg-server (Ubuntu Kinetic):
status: New → Fix Released
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This might become a "Won't fix" for 525 but let's track it more accurately there for the time being.

summary: - external HDMI monitor is laggy on NV reverse PRIME system
+ External HDMI monitor is laggy on NVIDIA-525 reverse PRIME system
Changed in nvidia-graphics-drivers-525 (Ubuntu):
status: New → Confirmed
Changed in nvidia-graphics-drivers-525 (Ubuntu Kinetic):
status: New → Confirmed
no longer affects: nvidia-graphics-drivers (Ubuntu Kinetic)
no longer affects: nvidia-graphics-drivers (Ubuntu)
no longer affects: xorg-server (Ubuntu Jammy)
Changed in xorg-server (Ubuntu Jammy):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like a fix is in 525.105.17:

> Fixed an issue which could cause applications to run at 1 FPS
> when using an NVIDIA PRIME Display Offload sink as the only
> active display.

[https://www.nvidia.com/Download/driverResults.aspx/202351/en-us/]

Timo Aaltonen (tjaalton)
description: updated
Changed in xorg-server (Ubuntu Jammy):
status: Confirmed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in nvidia-graphics-drivers-525 (Ubuntu):
status: Confirmed → Fix Committed
Changed in nvidia-graphics-drivers-525 (Ubuntu Kinetic):
status: Confirmed → Fix Committed
Changed in nvidia-graphics-drivers-525 (Ubuntu Jammy):
status: New → Fix Committed
Changed in nvidia-graphics-drivers-525 (Ubuntu Focal):
status: New → Fix Committed
Changed in nvidia-graphics-drivers-525 (Ubuntu Bionic):
status: New → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Unfortunate that this can't be fixed with a targetted fix. The good part is that we anyway do xorg-server MRE's for HWE stack updates for LTSes - and if Timo feels comfortable enough to sponsor this backport for jammy, that's already a good clue for me.

Changed in xorg-server (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Kai-Chuan, or anyone else affected,

Accepted xorg-server into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xorg-server/2:21.1.4-2ubuntu1.7~22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (xorg-server/2:21.1.4-2ubuntu1.7~22.04.1)

All autopkgtests for the newly accepted xorg-server (2:21.1.4-2ubuntu1.7~22.04.1) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

aptdaemon/1.1.1+bzr982-0ubuntu39 (amd64)
gnudatalanguage/1.0.1-3build1 (amd64)
gscan2pdf/2.12.6-1 (amd64)
nvidia-graphics-drivers-390/390.157-0ubuntu0.22.04.1 (i386)
openmsx/17.0-1ubuntu3 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#xorg-server

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Ian Chang (ianchang1)
tags: added: verification-done-jammy
tags: added: verification-done
removed: verification-needed verification-needed-jammy
Revision history for this message
maxroby (maxroby) wrote :

Fixed in lunar with
nvidia-driver-525 525.105.17-0ubuntu1
xserver-xorg-video-nvidia-525 525.105.17-0ubuntu1

Thanks!

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

the only remaining failing test is just bad (nvidia 390 on i386), as it's failing always

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

This bug was fixed in the package xorg-server - 2:21.1.4-2ubuntu1.7~22.04.1

---------------
xorg-server (2:21.1.4-2ubuntu1.7~22.04.1) jammy; urgency=medium

  * Backport to jammy. (LP: #2009767)

 -- Timo Aaltonen <email address hidden> Tue, 04 Apr 2023 09:20:09 +0300

Changed in xorg-server (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Update Released

The verification of the Stable Release Update for xorg-server has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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