Screen sometimes freezes [modeset(0): Present-flip: queue async flip during flip on CRTC 0 failed: Invalid argument]

Bug #2016045 reported by Spiridon
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux-hwe-5.19 (Ubuntu)
Opinion
Undecided
Unassigned
xorg-server (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

1/3 times I tab in / out of a app/game, that is running using the nvidia dedicated gpu, the screen freezes forcing me to restart my laptop. The cursor is still "usable" and reboot using SysRq REISUB is possible.
This is not tied only to steam games, other apps/games like minecraft also cause this problem.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: xorg 1:7.7+23ubuntu2
ProcVersionSignature: Ubuntu 5.19.0-38.39~22.04.1-generic 5.19.17
Uname: Linux 5.19.0-38-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.02.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 525.105.17 Tue Mar 28 18:02:59 UTC 2023
 GCC version: gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Thu Apr 13 00:58:23 2023
DistUpgraded: Fresh install
DistroCodename: jammy
DistroVariant: ubuntu
DkmsStatus: nvidia/525.105.17, 5.19.0-38-generic, x86_64: installed
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
 Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] [8086:3ea0] (prog-if 00 [VGA controller])
   Subsystem: Hewlett-Packard Company WhiskeyLake-U GT2 [UHD Graphics 620] [103c:84c1]
   Subsystem: Hewlett-Packard Company GP108M [GeForce MX250] [103c:84c1]
InstallationDate: Installed on 2023-02-06 (65 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 003: ID 0408:5300 Quanta Computer, Inc. HP Wide Vision HD Camera
 Bus 001 Device 004: ID 0bda:b00a Realtek Semiconductor Corp. Realtek Bluetooth 4.2 Adapter
 Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: HP HP Pavilion Laptop 15-cs2xxx
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.19.0-38-generic root=UUID=bd5e3449-4d4f-4ebd-afef-1e4da7b9ec69 ro quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/25/2020
dmi.bios.release: 15.23
dmi.bios.vendor: Insyde
dmi.bios.version: F.23
dmi.board.asset.tag: Type2 - Board Asset Tag
dmi.board.name: 84C1
dmi.board.vendor: HP
dmi.board.version: 15.32
dmi.chassis.asset.tag: Chassis Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: HP
dmi.chassis.version: Chassis Version
dmi.ec.firmware.release: 15.32
dmi.modalias: dmi:bvnInsyde:bvrF.23:bd12/25/2020:br15.23:efr15.32:svnHP:pnHPPavilionLaptop15-cs2xxx:pvrType1ProductConfigId:rvnHP:rn84C1:rvr15.32:cvnHP:ct10:cvrChassisVersion:sku7EF01EA#AB7:
dmi.product.family: 103C_5335KV HP Pavilion
dmi.product.name: HP Pavilion Laptop 15-cs2xxx
dmi.product.sku: 7EF01EA#AB7
dmi.product.version: Type1ProductConfigId
dmi.sys.vendor: HP
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.113-2~ubuntu0.22.04.1
version.libgl1-mesa-dri: libgl1-mesa-dri 22.2.5-0ubuntu0.1~22.04.1
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:21.1.3-2ubuntu2.9
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20210115-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-2build1

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

Thank you for taking the time to report this bug and helping to make Ubuntu better. It sounds like some part of the system has crashed. To help us find the cause of the crash please follow these steps:

1. Look in /var/crash for crash files and if found run:
    ubuntu-bug YOURFILE.crash
Then tell us the ID of the newly-created bug.

2. If step 1 failed then look at https://errors.ubuntu.com/user/ID where ID is the content of file /var/lib/whoopsie/whoopsie-id on the machine. Do you find any links to recent problems on that page? If so then please send the links to us.

Please take care to avoid attaching .crash files to bugs as we are unable to process them as file attachments. It would also be a security risk for yourself.

affects: xorg (Ubuntu) → ubuntu
Changed in ubuntu:
status: New → Incomplete
Revision history for this message
Spiridon (stzagkarak) wrote :

Hello, thanks for taking the time to help me figure this out.
I checked both steps but the bugs that were found were not related to this problem. Is there anything else I can do to provide more information?
I can surely recreate the situation, maybe if I open another session during the freeze and then look into staff?

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

In that case, next time the problem happens, after rebooting please run:

  journalctl -b-1 > prevboot.txt

and attach the resulting text file here.

Revision history for this message
Spiridon (stzagkarak) wrote :

Recreated the situation. Attaching the text file.

summary: - Screen sometimes freezes when tabbing in-out of apps running using
- dedicated gpu.
+ Screen sometimes freezes [modeset(0): Present-flip: queue async flip
+ during flip on CRTC 0 failed: Invalid argument]
affects: ubuntu → xorg-server (Ubuntu)
Changed in xorg-server (Ubuntu):
status: Incomplete → New
Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Interesting, thanks!

This looks like the first example of Xorg getting stuck on the same Intel kernel issues as we see with Wayland. Could you try adding a kernel parameter 'drm.debug=0xff' and reproduce it again? That should tell us exactly what the "Invalid argument" is.

Possibly indirectly related:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1968040
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2933#note_1706156

Revision history for this message
Spiridon (stzagkarak) wrote :

Hello, sorry for the wait. Added the kernel parameter and reproduced the bug. Here is the new log ( full log was over 75mb so I tailed the last 10000 lines ). If older lines are needed, I can provide more.

Revision history for this message
Spiridon (stzagkarak) wrote :

Related issue fix ( MUTTER_DEBUG_ENABLE_ATOMIC_KMS=0 on /etc/environment ) did not fix the issue.

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

Thanks but that doesn't appear to be enough information. Please compress and attach the full system log.

Revision history for this message
Spiridon (stzagkarak) wrote :

Ok, sending the full log.
Also, I noticed that the issue does not exist when the app is in windowed mode. I can change focus without issues. Only when the app is full screen and I tab in/out.

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

Thanks. I think the error is originating from:

i915 0000:00:02.0: [drm:intel_async_flip_check_hw [i915]] [PLANE:31:plane 1A] Modifier does not support async flips
i915 0000:00:02.0: [drm:intel_dump_pipe_config [i915]] [CRTC:51:pipe A] enable: yes [failed]
...
i915 0000:00:02.0: [drm:drm_atomic_check_only [drm]] atomic driver check for 00000000f524c626 failed: -22

It seems that's a kernel bug which occurs with linear buffers (ie. secondary GPUs rendering to full screen). Intel has a fix on the way but it hasn't landed yet:

https://<email address hidden>/

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

Oops. The fix will only ever support Intel Gen12 GPUs (11th gen CPUs and later). So there won't be a kernel fix you can use. I wonder if Xorg can ever detect and avoid it before it happens...

tags: added: hybrid i915 multigpu nvidia
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Seems the only possible solution is to fix Xorg to not use DRM_MODE_PAGE_FLIP_ASYNC on single monitor systems.

Changed in linux-hwe-5.19 (Ubuntu):
status: New → Opinion
Changed in xorg-server (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I should have said "the only possible userspace solution". Strictly speaking it's the Intel kernel driver at fault for advertising DRM_CAP_ASYNC_PAGE_FLIP as supported and then rejecting it as invalid in some configurations. The driver has to do that because of hardware limitations, but still chooses to advertise the feature as supported because it's usually supported :S

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.