Changing the graphic card prevent X11 from launching

Hello,

I switched my nvidia graphic card to an amd graphic card in my nixos machine. Since then X11 is unable to start for some reason.

The new graphic card is an amd Radeon RX 6500XT

Here is the configuration that I added:

boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
hardware.opengl.extraPackages = with pkgs; [
   rocm-opencl-icd
   rocm-opencl-runtime
   amdvlk
];
hardware.opengl.driSupport  = true;

The display manager use is lightdm and the desktopmanager is xfce.

Debugging that I did:

journalctl -u display-manager.service

systemd[1]: Starting X11 Server...
systemd[1]: Started X11 Server.
systemd[1]: display-manager.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: display-manager.service: Failed with result 'exit-code'.
systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 1.
systemd[1]: Stopped X11 Server.
systemd[1]: Starting X11 Server...
systemd[1]: Started X11 Server.
systemd[1]: display-manager.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: display-manager.service: Failed with result 'exit-code'.
systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 2.
systemd[1]: Stopped X11 Server.
systemd[1]: Starting X11 Server...
systemd[1]: Started X11 Server.
systemd[1]: display-manager.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: display-manager.service: Failed with result 'exit-code'.
systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 3.
systemd[1]: Stopped X11 Server.
systemd[1]: display-manager.service: Start request repeated too quickly.
systemd[1]: display-manager.service: Failed with result 'exit-code'.
systemd[1]: Failed to start X11 Server.
systemd[1]: display-manager.service: Triggering OnFailure= dependencies.
systemd[1]: display-manager.service: Failed to enqueue OnFailure= job, ignoring: Unit plymouth-quit.service not found.

journalctl -u x11.service

-- Journal begins at Tue 2022-01-11 06:35:40 EST, ends at Mon 2022-03-14 22:27:37 EDT. --
-- No entries --

/var/log/X.0.log

X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[    44.352] Build Operating System: Nix
[    44.352] Current Operating System: Linux mtetreault-desktop 5.10.105 #1-NixOS SMP Fri Mar 11 11:11:55 UTC 2022 x86_64
[    44.352] Kernel command line: initrd=\efi\nixos\8xcacmdmyjly10r2ripdh5gwyh3fgvss-initrd-linux-5.10.105-initrd.efi init=/nix/store/c9gfsdir24bi4zpna7mvpyvyqx5slg2v-nixos-system-mtetreault-desktop-21.11.336515.0f85665118d/init loglevel=4
[    44.352] Build Date: 29 July 2021  06:48:50PM
[    44.352]
[    44.352] Current version of pixman: 0.38.4
[    44.352] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    44.353] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    44.353] (++) Log file: "/var/log/X.0.log", Time: Mon Mar 14 22:43:32 2022
[    44.353] (++) Using config file: "/nix/store/0kcgk9sz745gzy3css6q2qfzm8dzngj4-xserver.conf"
[    44.353] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    44.353] (==) Using system config directory "/nix/store/v9zlz9d800lim6v0bc65v99lmgr9lgcm-xorg-server-1.20.13/share/X11/xorg.conf.d"
[    44.353] (==) ServerLayout "Layout[all]"
[    44.353] (**) |-->Screen "Screen-amdgpu[0]" (0)
[    44.353] (**) |   |-->Monitor "<default monitor>"
[    44.355] (**) |   |-->Device "Device-amdgpu[0]"
[    44.355] (==) No monitor specified for screen "Screen-amdgpu[0]".
	Using a default monitor configuration.
[    44.355] (**) Option "DontZap" "on"
[    44.355] (**) Option "AllowMouseOpenFail" "on"
[    44.355] (==) Automatically adding devices
[    44.355] (==) Automatically enabling devices
[    44.355] (==) Automatically adding GPU devices
[    44.355] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    44.355] (**) FontPath set to:
	/nix/store/ykd1vky8w15i2nnx21wn0sv9d28zh5w6-unifont-14.0.01/share/fonts,
	/nix/store/rw0rmzjr1cwank8xjvz3rwgrj9zw7d6r-font-cursor-misc-1.0.3/lib/X11/fonts/misc,
	/nix/store/dybkji1hivyg9hnscg2jhhajgqb2bv1f-font-misc-misc-1.1.2/lib/X11/fonts/misc,
	/nix/store/74ljwk0a811cdmg7lahkqjjrdxwk1vkm-font-bh-lucidatypewriter-100dpi-1.0.3/lib/X11/fonts/100dpi,
	/nix/store/9p4lkdq9jycjqk615radqfl66ma3j7xs-font-bh-lucidatypewriter-75dpi-1.0.3/lib/X11/fonts/75dpi,
	/nix/store/9kn73xxda5wyx8d8y4fy3ggnkn7yvyb9-font-bh-100dpi-1.0.3/lib/X11/fonts/100dpi,
	/nix/store/yxv39ryka91mjcrvd15bb67j21q7087b-font-adobe-100dpi-1.0.3/lib/X11/fonts/100dpi,
	/nix/store/4pn92v1wism8f64bw88ky3vvp0495dis-font-adobe-75dpi-1.0.3/lib/X11/fonts/75dpi
[    44.355] (**) ModulePath set to "/nix/store/m0pbiqn5p4s0g4znxm02wgd957shznxb-xf86-video-amdgpu-21.0.0/lib/xorg/modules/drivers,/nix/store/v9zlz9d800lim6v0bc65v99lmgr9lgcm-xorg-server-1.20.13/lib/xorg/modules,/nix/store/v9zlz9d800lim6v0bc65v99lmgr9lgcm-xorg-server-1.20.13/lib/xorg/modules/extensions,/nix/store/v9zlz9d800lim6v0bc65v99lmgr9lgcm-xorg-server-1.20.13/lib/xorg/modules/drivers,/nix/store/x8rpq01bidf8mkchzpbnws2ycs2cgipc-xf86-input-evdev-2.10.6/lib/xorg/modules/input,/nix/store/0hnm7sc53bhxbwyf3zz378an7drg9v15-xf86-input-libinput-1.2.0/lib/xorg/modules/input"
[    44.355] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[    44.355] (II) Loader magic: 0x62dd40
[    44.355] (II) Module ABI versions:
[    44.355] 	X.Org ANSI C Emulation: 0.4
[    44.355] 	X.Org Video Driver: 24.1
[    44.355] 	X.Org XInput driver : 24.1
[    44.355] 	X.Org Server Extension : 10.0
[    44.356] (++) using VT number 7

[    44.356] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    44.375] (--) PCI:*(3@0:0:0) 1002:743f:1043:05d9 rev 193, Mem @ 0xc0000000/268435456, 0xd0000000/2097152, 0xfb900000/1048576, I/O @ 0x0000e000/256, BIOS @ 0x????????/131072
[    44.375] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    44.375] (II) "glx" will be loaded by default.
[    44.375] (II) LoadModule: "glx"
[    44.375] (II) Loading /nix/store/v9zlz9d800lim6v0bc65v99lmgr9lgcm-xorg-server-1.20.13/lib/xorg/modules/extensions/libglx.so
[    44.377] (II) Module glx: vendor="X.Org Foundation"
[    44.377] 	compiled for 1.20.13, module version = 1.0.0
[    44.377] 	ABI class: X.Org Server Extension, version 10.0
[    44.377] (II) LoadModule: "amdgpu"
[    44.377] (II) Loading /nix/store/m0pbiqn5p4s0g4znxm02wgd957shznxb-xf86-video-amdgpu-21.0.0/lib/xorg/modules/drivers/amdgpu_drv.so
[    44.378] (II) Module amdgpu: vendor="X.Org Foundation"
[    44.378] 	compiled for 1.20.13, module version = 21.0.0
[    44.378] 	Module class: X.Org Video Driver
[    44.378] 	ABI class: X.Org Video Driver, version 24.1
[    44.378] (II) AMDGPU: Driver for AMD Radeon:
	All GPUs supported by the amdgpu kernel driver
[    44.379] (II) AMDGPU(0): [KMS] Kernel modesetting enabled.
[    44.379] (EE) AMDGPU(0): [drm] Failed to open DRM device for pci:0000:03:00.0: No such file or directory
[    44.379] (EE) Screen 0 deleted because of no matching config section.
[    44.379] (II) UnloadModule: "amdgpu"
[    44.379] (EE) Device(s) detected, but none match those in the config file.
[    44.379] (EE)
Fatal server error:
[    44.379] (EE) no screens found(EE)
[    44.379] (EE)
Please consult the The X.Org Foundation support
	 at http://wiki.x.org
 for help.
[    44.379] (EE) Please also check the log file at "/var/log/X.0.log" for additional information.
[    44.379] (EE)
[    44.419] (EE) Server terminated with error (1). Closing log file.
1 Like

you seem to have all the important parts from AMD GPU - NixOS Wiki covered.
What do you get from running head /sys/class/drm/*/status ?
So you have any autogenerated X11 config left over from the NVIDIA card?
What channel are you running? 21.11 or unstable?

I suspect the interesting parts are here, but I don’t have enough experience with amdgpu to troubleshoot this kind of failure.

Most likely your kernel is too old. Support for 6000 series AMD cards was landed in linux 5.9. If you do uname -a and it’s younger, this is likely your issue.

For NixOS:

boot.kernelPackages = linuxPackages_5_15;
1 Like

He’s on 5.10 according to @mtetreault’s logs. The 6500XT card is a quite recent model in the 6000 series though, codename Beige Goby. So you’ll need a fair bit newer kernel/firmware.

According to this Phoronix aritlce it’s included since v5.14, so your suggestion should still work. Firmware landed somewhere around september, so that’s okay for NixOS 21.11 (which is on 20211216).

3 Likes

@jonringer @ius Thanks for your help, my kernel was indeed too old. I switched to the latest kernel and it works flawlessly.