You are not logged in.

#1 2023-06-27 00:04:21

Guanran928
Member
Registered: 2023-04-02
Posts: 9

X.org freezes randomly

Hello, I switched to Arch Linux a few months ago, everything so far is pretty good, but one of the issues I am experiencing is that X11 seems to freeze randomly. Sometimes X11 works for 30min before freezing, sometimes a few hours.
I searched and attempted some methods to fix this, but none of them worked.

Here's my X11 log (/var/log/Xorg.0.log.old)
https://pastebin.com/He66RfMV
I bet something is wrong with NVIDIA (because it is spamming the log)

My system specs:
(I am on an NVIDIA Optimus laptop)
https://pastebin.com/r3ZK4Jka

Here's my display-related software installed:
https://pastebin.com/xAnJiSzF

My microcode is working correctly. Here is my systemd-boot launch entry:
https://pastebin.com/ErDkdz62

I do not use xf86-video-intel. This post claimed it's caused by xf86-video-intel:
https://bbs.archlinux.org/viewtopic.php?id=254962

I do not use optimus-manager or similar packages. I am using the official NVIDIA offload method.

My /etc/X11 and /etc/X11/xorg.conf.d directory does not contain any X.org configuration files.

Wayland works perfectly, but I have no idea why. I've seen people claim that NVIDIA should break on Wayland (maybe it's because I'm on Optimus, I don't really know)
I want to switch to X11 because I've been experiencing issues with Wayland, and the games I play run smoother on X11.

(sorry for my poor english :p, its not my native language)

Last edited by Guanran928 (2023-06-27 23:54:35)

Offline

#2 2023-06-27 00:18:22

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

I haven't attempted this yet, I think it would need xf86-video-intel to work:
https://wiki.archlinux.org/title/Intel_ … tel_driver

(this page shows you will need xf86-video-intel to use this configuration, https://wiki.archlinux.org/title/Intel_ … iguration)
(and nvidia-smi shows x11 is running on NVIDIA, I don't think this will affect too much)

Last edited by Guanran928 (2023-06-27 00:19:53)

Offline

#3 2023-06-27 00:47:47

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,857

Re: X.org freezes randomly

You generally don't want xf86-video-intel. There have been a bunch of regressions in the nvidia driver so I'd first test installing the current linux-headers and nvidia-dkms and nvidia-utils and lib32-nvidia-utils downgraded to a 530xx driver variant: https://wiki.archlinux.org/title/Arch_Linux_Archive

IF this doesn't help you could also check for a kernel regression by trying the LTS kernel.

Offline

#4 2023-06-27 08:08:06

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,942

Re: X.org freezes randomly

maybe it's because I'm on Optimus, I don't really know

Your X11 server runs on the intel chip, nvidia would be available though prime only.

Elaborate on the symptoms:
When X11 "freezes", can you still switch the VT (ctrl+alt+F1,F2,…)?
Is it (always) when prime-run'ning stuff?
Does eg. music continue to play?
Does the mouse cursor still move?

Also, what desktop environment/WM/compositor do you run? And how do you start it?
(I've seen the DE being SIGSTOP'd by the stating shell because of a bogus shell rc…)

Offline

#5 2023-06-27 11:06:36

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

Your X11 server runs on the intel chip, nvidia would be available though prime only.

I'm not really sure, but nvidia-smi shows /usr/lib/Xorg is running on NVIDIA


Elaborate on the symptoms:
When X11 "freezes", can you still switch the VT (ctrl+alt+F1,F2,…)?
Is it (always) when prime-run'ning stuff?
Does eg. music continue to play?
Does the mouse cursor still move?

Also, what desktop environment/WM/compositor do you run? And how do you start it?

I'm not able to switch tty,
I'm not sure, but most of the time it crashes when I am playing a game (using dGPU)
Music does not play anymore
The mouse cursor does not move

I am using Bspwm and SDDM, and picom

EDIT: Music does play, but audio from the running game is stuck
EDIT: Game audio does play, but it is frozen after ~30s

Last edited by Guanran928 (2023-06-28 14:34:00)

Offline

#6 2023-06-27 13:45:07

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

By the way, here's my journalctl log:
https://pastebin.com/DSjBx6VY

EDIT: typo

Last edited by Guanran928 (2023-06-27 16:05:23)

Offline

#7 2023-06-27 15:52:58

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,942

Re: X.org freezes randomly

Does that journal cover the issue?
There's notably

Jun 27 07:00:09.339211 arch kernel: [drm:drm_new_set_master] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
…
Jun 27 07:13:46.235843 arch systemd-shutdown[1]: Syncing filesystems and block devices.

but the shutdown is ~14 minutes after the nvidia-drm error.

Try w/o

lsm=landlock,lockdown,yama,integrity,apparmor,bpf

and then to downgrade the nvidia driver, there aren't any other red flags in the journal.

Offline

#8 2023-06-27 16:06:37

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

seth wrote:

and then to downgrade the nvidia driver, there aren't any other red flags in the journal.

Which exact version should I downgrade to? 530.xx?

Offline

#9 2023-06-27 16:09:58

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,942

Re: X.org freezes randomly

Yes. And you'll have to either (preferably) use the dkms version or downgrade the kernel as well.

Offline

#10 2023-06-27 18:18:04

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

Without lsm=landlock,lockdown,yama,integrity,apparmor,bpf in my kernel parameter seems solved this issue, I played 40 minutes of CS:GO and no crash (yet).

I will mark this thread as solved first.

EDIT: typo

Last edited by Guanran928 (2023-06-27 18:22:27)

Offline

#11 2023-06-27 20:22:55

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,942

Re: X.org freezes randomly

Ftr, the default is "landlock,lockdown,yama,integrity,bpf" so the problem seems to be w/ apparmor.

Offline

#12 2023-06-27 23:54:23

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

Guanran928 wrote:

Without lsm=landlock,lockdown,yama,integrity,apparmor,bpf in my kernel parameter seems solved this issue, I played 40 minutes of CS:GO and no crash (yet).

I will mark this thread as solved first.

EDIT: typo

Guess I said that too early. This morning I launched CS:GO and X11 immediately crashed. (twice in a row)

However, here's some extra information:
Bluetooth seems to be still functioning, and it is still reconnecting after I restarted my Bluetooth keyboard.
The music is playing, but it goes out after a few minutes (I'm not sure did the music end, I will test later). My guess is WiFi stopped functioning.
Brightness, media, and volume key seems to stop functioning. (I bound those keys through sxhkd to a script)
My laptop's keyboard backlight trigger key is still functioning (triggered by pressing Fn+Space), but CapsLock and NumLock aren't functional.
Power button is still functioning, I am able to shutdown my laptop using the power button.

BTW I found a new way to share my computer's information, using hw-probe:
https://linux-hardware.org/?probe=6615a04065
(I have no idea why it is saying I'm using GNOME)

EDIT: Added more infomations, fix typo

EDIT:
The audio from a background YouTube video goes out first, then a few second later game audio froze.
Sometimes there will be a working cursor, but sometimes not, this seems to be random.

Last edited by Guanran928 (2023-06-28 14:35:43)

Offline

#13 2023-06-28 05:53:21

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,942

Re: X.org freezes randomly

Power button is still functioning, I am able to shutdown my laptop using the power button.

That's not helpful sad
https://wiki.archlinux.org/title/Keyboa … el_(SysRq)

The symptoms sound like the kernel halted, so the next stop would be to test downgrading the nvidia driver.

Offline

#14 2023-06-28 14:33:12

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

seth wrote:

The symptoms sound like the kernel halted, so the next stop would be to test downgrading the nvidia driver.

I downgraded my NVIDIA driver to 530.41.03-1 (nvidia-dkms, nvidia-utils and lib32-nvidia-utils).
I am still experiencing freezes.

Offline

#15 2023-06-28 15:57:32

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,942

Re: X.org freezes randomly

Can you reboot w/ the magic sysrq?

Offline

#16 2023-07-01 00:57:33

Guanran928
Member
Registered: 2023-04-02
Posts: 9

Re: X.org freezes randomly

seth wrote:

Can you reboot w/ the magic sysrq?

I am sorry, but I didn't trigger the freeze for the past few day, I will respond when I triggered it. smile

Offline

#17 2023-07-10 12:58:56

zayn7lie
Member
Registered: 2023-07-02
Posts: 37
Website

Re: X.org freezes randomly

IDK if your problem is quite similar to mine: https://bbs.archlinux.org/viewtopic.php?id=287096?
Have you encountered the same problem recently?

Offline

Board footer

Powered by FluxBB