niri icon indicating copy to clipboard operation
niri copied to clipboard

Severe Freeze Upon Re-Entry

Open KoshulaDora opened this issue 1 year ago • 16 comments

Niri causes a freeze upon re-entry from display manager. The degree of freeze is so severe that none of tty can be called up on with alt+ctrl+f1-6. Nothing moves. Nothing shows. Nothing functions. You will have to force reboot the pc if you want to keep using it.

System Information

  • niri version: niri 0.1.9 (unknown commit)
  • Distro: ArchLinux
  • GPU: AMD rx 590
  • CPU: Amd Ryzen 5800x

Additional Info

  • Display manager: Lightdm

This issue doesn't happen with hyprland, sway, i3, or any other wm.

KoshulaDora avatar Sep 26 '24 13:09 KoshulaDora

Does it unfreeze after 20 or so seconds? Does it happen at initial niri startup?

I will need niri output during the freeze: journalctl --user-unit=niri

YaLTeR avatar Sep 26 '24 17:09 YaLTeR

Does it unfreeze after 20 or so seconds? Does it happen at initial niri startup?

Sometimes? Typically when I make a clean move from logging into my default x11 wm and try to move to niri it works, but after trying to get back to niri it tends to freeze. It never unfreezes after a while.

I will need niri output during the freeze: journalctl --user-unit=niri

I am sorry, the text is far too big so I created a gist and linked it. Will that be fine?

KoshulaDora avatar Sep 27 '24 16:09 KoshulaDora

That's quite weird. Seems that niri doesn't get the permission to the DRM device after the session is restored.

Could you check if the same issue happens in COSMIC with cosmic-comp?

YaLTeR avatar Sep 28 '24 15:09 YaLTeR

Could you check if the same issue happens in COSMIC with cosmic-comp?

Kind of? I can still use the tty in Cosmic, so it isn't the same kind of freeze, and the cursor actually shows and blinks. Here is the relevant but unsolved issue.

Here are the outputs of journalctl --user _EXE=/usr/bin/cosmic-comp and journalctl --user _EXE=/usr/bin/cosmic-session, respectively:

Sep 28 20:36:27 archlinux cosmic-comp[5559]: Failed to read config 'workspaces'
Sep 28 20:36:27 archlinux cosmic-comp[5559]: failed to read local shortcuts config 'system_actions': NoConfigDirectory
Sep 28 20:36:27 archlinux cosmic-comp[5559]: Key-Binding 'Period' only matched case insensitive for "period"
Sep 28 20:36:27 archlinux cosmic-comp[5559]: Key-Binding 'Comma' only matched case insensitive for "comma"
Sep 28 20:36:27 archlinux cosmic-comp[5559]: Key-Binding 'Period' only matched case insensitive for "period"
Sep 28 20:36:27 archlinux cosmic-comp[5559]: Key-Binding 'Comma' only matched case insensitive for "comma"
Sep 28 20:36:27 archlinux cosmic-comp[5559]: shortcuts custom config error: GetKey("custom", Os { code: 2, kind: NotFound, message: "No such file or directory" })
Sep 28 20:36:27 archlinux cosmic-comp[5559]: tiling exceptions custom config error: GetKey("tiling_exception_custom", Os { code: 2, kind: NotFound, message: "No such file or directory" })
sep 28 20:36:27 archlinux cosmic-session[5553]: starting cosmic-session
sep 28 20:36:27 archlinux cosmic-session[5553]: starting process ' cosmic_session_sock=12 cosmic-comp '
sep 28 20:36:27 archlinux cosmic-session[5553]: process ' cosmic_session_sock=12 cosmic-comp ' failed with code 1
sep 28 20:36:27 archlinux cosmic-session[5553]: cosmic-comp exited with error code 1
sep 28 20:36:27 archlinux cosmic-session[5553]: draining stdin receiver before restarting process
sep 28 20:36:27 archlinux cosmic-session[5553]: sleeping for 6ms before restarting process cosmic-comp (restart 0)
sep 28 20:36:27 archlinux cosmic-session[5553]: restarted process ' cosmic_session_sock=12 cosmic-comp ', now at 1 restarts
sep 28 20:36:27 archlinux cosmic-session[5553]: process 'processkey(1v1)' cancelled

Overall this issue seems to be very unrelated however, and I don't have anywhere near enough time or interest in trying to get cosmic run properly.

KoshulaDora avatar Sep 28 '24 17:09 KoshulaDora

I'd need help from someone more experienced with DRM for this one. Don't know what can cause this issue to happen. It's as if Lightdm doesn't release the DRM device for niri. It also for some reason leaves DISPLAY set, does it know that niri is a Wayland compositor?

YaLTeR avatar Sep 30 '24 06:09 YaLTeR

I'd need help from someone more experienced with DRM for this one. Don't know what can cause this issue to happen. It's as if Lightdm doesn't release the DRM device for niri. It also for some reason leaves DISPLAY set, does it know that niri is a Wayland compositor?

Oh you don't need to worry about that, the display is my config issue, I forgot to disable it after removing xwayland satelite from startup.

The bug is still reproduced with that config removed.

KoshulaDora avatar Sep 30 '24 08:09 KoshulaDora

I ran to the same problem - one startup worked (though I had some core dump type problems as well), but once exited the system was useless. I think this was what fixed it:

 environment {
 LIBVA_DRIVER_NAME "nvidia"
  __GLX_VENDOR_LIBRARY_NAME "nvidia"
  NVD_BACKEND "direct"
} 

edit: sorry, remembered wrong, this one fixed the core dumps but trying to restart the session still freezes the system.

TIAcode avatar Feb 27 '25 10:02 TIAcode

I was facing the same issue and switching from LightDM to GDM fixed it for me.

adidnair avatar Feb 28 '25 15:02 adidnair

I used to get this with my nvidia system and thought it was nvidia, but now I have system with Intel Core Ultra integrated graphics and I still get it.

But one weird thing I noticed: if I try to restart niri using sudo systemctl restart gdm, I get to gdm but is just goes crazy and unusable when it tries to start niri. But I managed to crash niri, which threw me to gdm login screen again, and through this route I could restart niri n times without any problems :p

TIAcode avatar Apr 25 '25 06:04 TIAcode

I mean, that is a strange way to restart niri, by crashing your display manager..

YaLTeR avatar Apr 25 '25 06:04 YaLTeR

Most likely this is LightDM issue: https://github.com/canonical/lightdm/issues/63

polyntsov avatar Jun 24 '25 10:06 polyntsov

It doesn't look like it's a display manager issue (at least not a specific one): I can reproduce this "freezing" with 100% chance both in GDM and SDDM. Steps to reproduce are also the same:

  1. Log in successfully
  2. Log out
  3. Try to log in again => Freeze

Logs contain some amount of this error, as were posted above too.

0.027748Z WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device Some("/dev/dri/card1") (Permission denied (os error 13))

dimsuz avatar Aug 31 '25 22:08 dimsuz

im still having this same issue. id like to help but i still havent found the root cause. for me, niri crashes every so often seemingly randomly. i might have my laptop open for 30 minutes, or maybe 10 hours, sometimes niri will completely freeze and make the tty entirely inacessible. the only solution at that point is to force restart my laptop completely, same as what the original poster of this bug mentioned

riogu avatar Nov 10 '25 17:11 riogu

Are there any logs from sudo dmesg or the journal for niri..?

Sempyos avatar Nov 10 '25 20:11 Sempyos

Are there any logs from sudo dmesg or the journal for niri..?

i looked through the journal and i can't tell what might be indicative or not. i think this mightve been the output from the crash? i can't really tell i've had this crash happen randomly for the last 8 months or so. hope its useful for something:

Nov 10 14:45:16 archlinux niri[1028]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: client bug: event processing lagging behind by 24ms, your system is too slow
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.911166Z  WARN niri::handlers: error setting gamma for output eDP-1: error setting GAMMA_LUT
Nov 10 14:47:33 archlinux niri[1028]: Caused by:
Nov 10 14:47:33 archlinux niri[1028]:     Permission denied (os error 13)
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.911211Z  WARN niri::handlers: error setting gamma for output eDP-1: error setting GAMMA_LUT
Nov 10 14:47:33 archlinux niri[1028]: Caused by:
Nov 10 14:47:33 archlinux niri[1028]:     Permission denied (os error 13)
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.925390Z DEBUG niri::backend::tty: device changed: 57857
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.935637Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.936801Z  WARN niri::handlers: error setting gamma for output eDP-1: error setting GAMMA_LUT
Nov 10 14:47:33 archlinux niri[1028]: Caused by:
Nov 10 14:47:33 archlinux niri[1028]:     Permission denied (os error 13)
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.936835Z  WARN niri::handlers: error setting gamma for output eDP-1: error setting GAMMA_LUT
Nov 10 14:47:33 archlinux niri[1028]: Caused by:
Nov 10 14:47:33 archlinux niri[1028]:     Permission denied (os error 13)
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.953124Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.965797Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.982004Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:33 archlinux niri[1028]: 2025-11-10T14:47:33.998593Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:34 archlinux niri[1028]: 2025-11-10T14:47:34.015458Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:34 archlinux niri[1028]: 2025-11-10T14:47:34.032605Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:34 archlinux niri[1028]: 2025-11-10T14:47:34.048982Z  WARN niri::backend::tty: error queueing frame: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some("/dev/dri/card1")` (Permission denied (os error 13))
Nov 10 14:47:34 archlinux niri[1028]: 2025-11-10T14:47:34.049195Z  WARN niri::handlers: error setting gamma for output eDP-1: error setting GAMMA_LUT
Nov 10 14:47:34 archlinux niri[1028]: Caused by:
Nov 10 14:47:34 archlinux niri[1028]:     Permission denied (os error 13)
Nov 10 14:47:34 archlinux niri[1028]: 2025-11-10T14:47:34.049207Z  WARN niri::handlers: error setting gamma for output eDP-1: error setting GAMMA_LUT
Nov 10 14:47:34 archlinux niri[1028]: Caused by:
Nov 10 14:47:34 archlinux niri[1028]:     Permission denied (os error 13)

riogu avatar Nov 10 '25 20:11 riogu

Might be related to: https://github.com/pop-os/cosmic-comp/issues/872

Sempyos avatar Nov 10 '25 21:11 Sempyos