Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xorg crashes at startup, starting graphical session impossible #352328

Closed
cxandru opened this issue Oct 30, 2024 · 8 comments
Closed

Xorg crashes at startup, starting graphical session impossible #352328

cxandru opened this issue Oct 30, 2024 · 8 comments
Labels
0.kind: bug Something is broken

Comments

@cxandru
Copy link

cxandru commented Oct 30, 2024

Describe the bug

Nixos fails to start Xorg (at commit 27e30d1, so unstable on October 1. Why am I not using the most recent one, you may ask? Well, because there I encounter #349816)).

It either stays stuck at the systemd message "Starting Displaymanager", or on "Process Core Dump (In both cases there is a core dump). coredumpctl reveals: 1447 0 0 SIGABRT inaccessible /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/Xorg
The contents of /var/log/X.0.log are:

[    16.287] (II) Initializing extension GLX
[    16.339] (EE)
[    16.339] (EE) Backtrace:
[    16.340] (EE) 0: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/X (OsSigHandler+0x33) [0x5c29a3]
[    16.341] (EE) unw_get_proc_name failed: no unwind info found [-10]
[    16.341] (EE) 1: /nix/store/3dyw8dzj9ab4m8hv5dpyx7zii8d0w6fi-glibc-2.39-52/lib/libc.so.6 (?+0x0) [0x7fe0fde4b5c0]
[    16.342] (EE) 2: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/lib/xorg/modules/extensions/libglx.so (glxConvertConfigs+0x12) [0x7fe0fdc15b92]
[    16.343] (EE) 3: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/lib/xorg/modules/extensions/libglx.so (__glXDRIscreenProbe+0x2e8) [0x7fe0fdc1de98]
[    16.344] (EE) 4: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/lib/xorg/modules/extensions/libglx.so (xorgGlxServerInit+0xb7) [0x7fe0fdc142b7]
[    16.344] (EE) 5: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/X (_CallCallbacks+0x34) [0x44c474]
[    16.345] (EE) 6: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/X (GlxExtensionInit+0x15f) [0x57e72f]
[    16.346] (EE) 7: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/X (InitExtensions+0x89) [0x4bba69]
[    16.346] (EE) 8: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/X (dix_main+0x1ac) [0x44ad8c]
[    16.347] (EE) 9: /nix/store/3dyw8dzj9ab4m8hv5dpyx7zii8d0w6fi-glibc-2.39-52/lib/libc.so.6 (__libc_start_call_main+0x7e) [0x7fe0fde3514e]
[    16.348] (EE) 10: /nix/store/3dyw8dzj9ab4m8hv5dpyx7zii8d0w6fi-glibc-2.39-52/lib/libc.so.6 (__libc_start_main+0x89) [0x7fe0fde35209]
[    16.349] (EE) 11: /nix/store/x9zy8n82bdi9aapgy6p3hiqvyv5iw6fa-xorg-server-21.1.13/bin/X (_start+

Expected behavior

Xorg doesn't segfault on startup

Additional context

This is my current xserver-related setup, though I've also tried it with commenting it all out and it doesn't make a difference:

  services.xserver.videoDrivers = [ "intel" ];
  services.xserver.deviceSection = ''
    Option "TearFree" "true"
  '';
  services.xserver = {
    enable = true;
    xkb.layout = "de";
    xkb.variant = "neo";
    videoDrivers = [ "intel" ];
    #xfce
    desktopManager = {
      xterm.enable = false;
      xfce = {
        enable = true;
      };
    };
  };
hardware.graphics.extraPackages = [ pkgs.mesa.drivers ];

I have Intel integrated graphics: (hwinfo output is: Intel 3rd Gen Core processor Graphics Controller)

Metadata

(this is incomplete as I writing this issue from the rolled-back version of the OS, but I already mentioned the exact commit above)

  • system: "x86_64-linux"
  • host os: `Linux 24.11pre-git 6.11.1
  • multi-user?: yes
  • sandbox: yes

@cxandru cxandru added the 0.kind: bug Something is broken label Oct 30, 2024
@Atemu
Copy link
Member

Atemu commented Oct 31, 2024

Please nixos-rebuild boot and then reboot.

Are you mixing nixpkgs revisions?

@cxandru
Copy link
Author

cxandru commented Nov 6, 2024

Please nixos-rebuild boot and then reboot.

I did that

Are you mixing nixpkgs revisions?

I'm pinning nixpgks the oldschool way:

pkgs.mkShell {
  nixkpkgsUrl = "https://github.com/NixOS/nixpkgs/archive/27e30d177e57d912d614c88c622dcfdb2e6e6515.tar.gz";
  shellHook = ''
    rebuild () {
      echo Copying config from ~/.cfg
      sudo cp -rf ${config} ${extensions} /etc/nixos
      sudo nixos-rebuild -I "nixpkgs=${nixkpkgsUrl}" $@
    }
  '';
}

@cxandru
Copy link
Author

cxandru commented Nov 6, 2024

So, the problem does go away when I comment out hardware.graphics.extraPackages = [ pkgs.mesa.drivers ];, apparently I actually hadn't tried that. But, this means no Mesa support, which means e.g. I can't run blender (See Blender segfaults on start · Issue #75868 · NixOS/nixpkgs
(adding mesa, as suggested in this comment there had previously fixed that issue for me)

Examing the coredump log led me to this Archlinux Subreddit thread: Xorg segfault with xinit : r/archlinux. I have Intel HD Graphics 4000, which according to this answer should be supported by the crocus driver.

My question is: It seems that somehow the option Option "DRI" "crocus" would need to be configured, but /etc/X11/xorg.conf.d/20-intel.conf seems to be ignored under nixos, is there some package option where it can be added?

I tried adding it in services.xserver.deviceSection in my configuration.nix, but it didn't do anything there either.

@Atemu
Copy link
Member

Atemu commented Nov 6, 2024

when I comment out hardware.graphics.extraPackages = [ pkgs.mesa.drivers ];,

That is redundant because mesa is in the global graphics driver packages path by default. Doing this shouldn't break anything which is why I suspected you might be mixing nixpkgs revisions because adding a different version of Mesa here would indeed break things.

What actually must have helped for that person in the other thread was not running blender from a nix-shell that likely used a different revision to their mesa. I'll state again that mixing Nixpkgs revisions is not supported and will likely not work, especially not for graphics-related things. It's like doing a partial upgrade in Arch terms.

somehow the option Option "DRI" "crocus" would need to be configured

It shouldn't. The default modesetting should work just fine but I don't know about these legacy drivers. Anyhow, the proper way to do this would be to set services.xserver.videoDrivers = [ "drivername" ];. There doesn't appear to be an xf86video driver for crocus though, so I'm not entirely sure which one you should set. I'd start with intel but perhaps it's actually intended to be used with modesetting?

cc @K900

@Shados
Copy link
Member

Shados commented Nov 9, 2024

@cxandru I had the same issue; I fixed it by swapping from services.xserver.videoDrivers = [ "intel" ]; to the "modesetting" driver. Adding Option "DRI" "crocus" to services.xserver.deviceSection then also seems to have worked fine, judging by the xorg log:

[  1584.081] (II) modeset(0): [DRI2] Setup complete
[  1584.081] (II) modeset(0): [DRI2]   DRI driver: crocus

...

[  1584.103] (II) AIGLX: Loaded and initialized crocus

(although I guess it might have been using crocus to begin with)

diogotcorreia added a commit to diogotcorreia/dotfiles that referenced this issue Nov 20, 2024
@mpickering
Copy link
Contributor

Thanks @cxandru and @Shados, I changed the driver to "modesetting" and that fixed the issue for me as well.

@Atemu
Copy link
Member

Atemu commented Dec 15, 2024

That sounds like a solution to me. modesetting is the default btw.

@Atemu Atemu closed this as completed Dec 15, 2024
@Atemu Atemu closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/upgrade-to-nixos-24-11-display-manger-fails-to-start/57450/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

5 participants