The delay phenomenon is serious in 'External display mode' during the 'On-demand' mode working

Bug #1940247 reported by Bin Li
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NVIDIA Drivers Ubuntu
Fix Committed
Undecided
Alberto Milone
OEM Priority Project
Fix Committed
Critical
Bin Li

Bug Description

[Summary]
The delay phenomenon is serious in 'External display mode' during the 'On-demand' mode working.

[Steps to reproduce]
1. Install the 20.04.2 image on ThinkPad-P17-Gen-1
2. Install Nvidia driver 460.91.03-0ubuntu0.20.04.1 or 460.91.03-0ubuntu0.20.04.1
3. Make sure the system working on 'On-demand' mode
4. Connect a HDMI cable with a monitor
5. Switch the display mode to 'External'
6. Try to drag a window or type something in a terminal
7. Verify the result

[Expected result]
Every execution is smooth.

[Actual result]
The delay phenomenon is serious in 'External display mode' during the 'On-demand' mode working.

[Failure rate]
100%

[Note]
The issue can not reproduce during the 'Performance' mode working

[Additional information]
CPU: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (12x)
GPU: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:9bc4] (rev 05)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1fb9] (rev a1)
kernel-version: 5.11.0-25-generic or 5.10.0-1038-oem

Bin Li (binli)
tags: added: oem-priority originate-from-1918868 sutton
tags: added: originate-from-1919118
Revision history for this message
Bin Li (binli) wrote (last edit ):

@Alberto,

 Now I used 'ubuntu-drivers install' to install nvidia driver, it set 'on-demand' by default, but it won't work for 'External display mode', it works fine when I changed 'on-demand' to 'Perfomance' mode. Could you help check if it's the nvidia's bug. Thanks!

Changed in nvidia-drivers-ubuntu:
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Alberto Milone (albertomilone) wrote :

Did you restart the system after installing the driver and setting it to on-demand?

Revision history for this message
Shengyao Xue (xueshengyao) wrote :

I tested on a ThinkPad P1 Gen 4, GPU is RTX A5000, with nvidia driver 470, this issue exists after restarting the system.

Revision history for this message
Bin Li (binli) wrote :

When I switched the mode, it will take effects after reboot.

Revision history for this message
jeremyszu (os369510) wrote :

IIRC, this issue could be reproduced when
1) 5.10 + nvidia 460
2) 5.10 + nvidia 470
3) 5.13 + nvidia 460
4) 5.13 + nvidia 470

For (1), this case is a common case in each OEM project.

The one of difference between OEM projects on external ports is MUX, before dig with ACPI. Could we please try.

1) Remove "/usr/share/X11/xorg.conf.d/11-nvidia-offload.conf"
1.1) after 1), check issue exist or not.
1.2) after 1), add /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
```
# Test for LP: #1940247
Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
    ModulePath "/lib/%s/nvidia/xorg"
EndSection
```
If all (1) could reproduce this issue, then
2) comment out the content of `/lib/modprobe.d/nvidia-runtimepm.conf` and then re-generated initramfs.

To clarify it's nvidia or X related?

Changed in oem-priority:
assignee: nobody → Bin Li (binli)
Revision history for this message
Bin Li (binli) wrote :

@jeremyszu,

 Thanks for your idea, but all (1) and (2) could not work.

Changed in oem-priority:
status: New → Triaged
Revision history for this message
Bin Li (binli) wrote :

I tried to install NVIDIA-Linux-x86_64-470.57.02.run on system, it will use 'on-demand' mode by default, and I still could reproduce this issue.

Revision history for this message
jeremyszu (os369510) wrote :

@Bin,

Sorry about typo of comment#6.
Could you please help to try

# Test for LP: #1940247
Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
    ModulePath "/lib/x86_64-linux-gnu/nvidia/xorg/"
EndSection

Alex Tu (alextu)
tags: added: hwe-graphic
tags: removed: hwe-graphic
Revision history for this message
Bin Li (binli) wrote (last edit ):

@jeremyszu,

 I tried the #9 again, it didn't help, thanks!

 1) removed "/usr/share/X11/xorg.conf.d/11-nvidia-offload.conf"
 2) add new /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf

Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :

@alberto,

 Do you have any idea about this issue? Thanks!

Rex Tsai (chihchun)
Changed in oem-priority:
importance: Undecided → Critical
Revision history for this message
Bin Li (binli) wrote :

On ThinkPad P1 Gen 3, I installed NVIDIA-Linux-x86_64-470.63.01.run, when I switch to external only, I could reproduce this issue.

It used Intel for redener, and nvidia for output by default.

$ glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = Mesa Intel(R) UHD Graphics P630 (CML GT2)
GL_VERSION = 4.6 (Compatibility Profile) Mesa 21.0.3
GL_VENDOR = Intel

Revision history for this message
Hao-Sheng Lu (haosheng.lu) wrote :

Nvidia bug #3374575 has been submitted.

Revision history for this message
Hao-Sheng Lu (haosheng.lu) wrote :

NV update for NV#3374575:
Hi Kevin - This is an expected issue for all drivers with the currently shipping X server (1.20.9 in the bug report): https://gitlab.freedesktop.org/xorg/xserver/-/issues/1028 . https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1875015 .

The issue is that X Present doesn't support synchronizing to PRIME heads. When the external display (via Reverse PRIME) is the only head left, X Present vsync apps have nothing to sync to and throttle to 1 FPS by default. The only solution right now is to disable vsync, try adding a .sh script in /etc/profile.d with the following contents:
export CLUTTER_VBLANK=none
export vblank_mode=0

That should fix the 1 FPS issue but obviously you won't have vsync. If the system is muxed such that external displays are connected to the iGPU in this configuration, you won't have the problem.

Thanks and hope this helps, THX

Revision history for this message
Hao-Sheng Lu (haosheng.lu) wrote :

NV update:
we will process your engineer's comment accordingly but to unblock current situation is to go with the recommended WAR (vsync disablement) as short term solution. THX

Revision history for this message
Bin Li (binli) wrote :

@haosheng.lu,

 Thanks for your updates. I will confirm with Lenovo if we need the workaround or just wait updates.

Revision history for this message
Bin Li (binli) wrote :

Currently we used 5.14.0-oem kernel with 495.46, this issue is fixed.

Changed in oem-priority:
status: Triaged → Fix Committed
Changed in nvidia-drivers-ubuntu:
status: New → Fix Committed
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.