Xorg fails to start after setting up GPU passthrough

Hi, so I have a problem with xorg failing at "“no screens found”.

If I do a startx or lightdm from tty xorg runs and I get into my WM just fine. However, get a dbus error if I run lightdm from the tty. On the other hand, I bypass lightdm and I don’t get the dbus error if i start xserver from the tty.

output of /var/log/Xorg.0.log

[     7.706] 
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
[     7.706] Build Operating System: Linux Manjaro Linux
[     7.706] Current Operating System: Linux desk 5.10.23-1-MANJARO #1 SMP PREEMPT Thu Mar 11 18:47:18 UTC 2021 x86_64
[     7.706] Kernel command line: BOOT_IMAGE=/vmlinuz-5.10-x86_64 root=UUID=1578da60-6045-4342-8e0c-7644878ee482 rw iommu=pt amd_iommu=on cryptdevice=UUID=be971bfe-ee44-4d08-80a7-69b696e0cf12:luks-be971bfe-ee44-4d08-80a7-69b696e0cf12 root=/dev/mapper/luks-be971bfe-ee44-4d08-80a7-69b696e0cf12 resume=/dev/mapper/luks-be971bfe-ee44-4d08-80a7-69b696e0cf12 udev.log_priority=3
[     7.706] Build Date: 16 December 2020  10:33:32PM
[     7.706]  
[     7.706] Current version of pixman: 0.40.0
[     7.706] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[     7.706] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     7.706] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Apr  7 02:30:14 2021
[     7.706] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     7.706] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     7.706] (==) No Layout section.  Using the first Screen section.
[     7.706] (==) No screen section available. Using defaults.
[     7.706] (**) |-->Screen "Default Screen Section" (0)
[     7.706] (**) |   |-->Monitor "<default monitor>"
[     7.706] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[     7.706] (**) |   |-->Device "AMD"
[     7.706] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[     7.706] (==) Automatically adding devices
[     7.707] (==) Automatically enabling devices
[     7.707] (==) Automatically adding GPU devices
[     7.707] (==) Automatically binding GPU devices
[     7.707] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     7.707] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[     7.707] 	Entry deleted from font path.
[     7.707] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[     7.707] 	Entry deleted from font path.
[     7.707] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[     7.707] 	Entry deleted from font path.
[     7.707] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF,
	/usr/share/fonts/OTF
[     7.707] (==) ModulePath set to "/usr/lib/xorg/modules"
[     7.707] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[     7.707] (II) Module ABI versions:
[     7.707] 	X.Org ANSI C Emulation: 0.4
[     7.707] 	X.Org Video Driver: 24.1
[     7.707] 	X.Org XInput driver : 24.1
[     7.707] 	X.Org Server Extension : 10.0
[     7.707] (++) using VT number 7

[     7.707] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[     7.718] (--) PCI: (8@0:0:0) 10de:1e81:10de:13a0 rev 161, Mem @ 0xd8000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x00003000/128, BIOS @ 0x????????/524288
[     7.718] (--) PCI:*(69@0:0:0) 1002:66af:1002:081e rev 193, Mem @ 0x80000000/268435456, 0x90000000/2097152, 0x9fb00000/524288, I/O @ 0x00004000/256, BIOS @ 0x????????/131072
[     7.718] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[     7.718] (II) LoadModule: "glx"
[     7.718] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[     7.720] (II) Module glx: vendor="X.Org Foundation"
[     7.720] 	compiled for 1.20.10, module version = 1.0.0
[     7.720] 	ABI class: X.Org Server Extension, version 10.0
[     7.720] (II) LoadModule: "amdgpu"
[     7.720] (II) Loading /usr/lib/xorg/modules/drivers/amdgpu_drv.so
[     7.721] (II) Module amdgpu: vendor="X.Org Foundation"
[     7.721] 	compiled for 1.20.8, module version = 19.1.0
[     7.721] 	Module class: X.Org Video Driver
[     7.721] 	ABI class: X.Org Video Driver, version 24.1
[     7.721] (II) AMDGPU: Driver for AMD Radeon:
	All GPUs supported by the amdgpu kernel driver
[     7.782] (II) AMDGPU(0): [KMS] drm report modesetting isn't supported.
[     7.782] (EE) Screen 0 deleted because of no matching config section.
[     7.782] (II) UnloadModule: "amdgpu"
[     7.782] (EE) Device(s) detected, but none match those in the config file.
[     7.782] (EE) 
Fatal server error:
[     7.782] (EE) no screens found(EE) 
[     7.782] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[     7.782] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[     7.782] (EE) 
[     7.832] (EE) Server terminated with error (1). Closing log file.

output of mhwd -li --pci

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI

output of inxi -G after doing a startx.

Graphics:  Device-1: NVIDIA TU104 [GeForce RTX 2080 SUPER] driver: vfio-pci v: 0.2 
           Device-2: Advanced Micro Devices [AMD/ATI] Vega 20 [Radeon VII] driver: amdgpu v: kernel 
           Display: server: X.Org 1.20.10 driver: loaded: amdgpu resolution: 1: 2560x1080~60Hz 2: 2560x1440~60Hz 
           OpenGL: renderer: AMD Radeon VII (VEGA20 DRM 3.40.0 5.10.23-1-MANJARO LLVM 11.1.0) v: 4.6 Mesa 20.3.4 


Disclaimer I deserve this because I did mess with the Xorg files and deleted the “90-mhwd.conf” before this issue started. This was to get both my AMD gpu and NVIDIA gpu to show up with hardware ids for GPU passthrough. I’m now just hoping I can just fix my xorg and not reinstall the OS.


That is a symlink from /etc/X11/mhwd.d/nvidia.conf
So, try to recreate that symlink from TTY with this command:

sudo ln -s /etc/X11/mhwd.d/nvidia.conf /etc/X11/xorg.conf.d/90-mhwd.conf

then reboot your system and see if it helps.
Make sure you have a proper config inside /etc/X11/mhwd.d/

On the other hand, you might want to try nomodeset from boot …

I made the symlink however the file being linked is empty. Also setting nomodeset in grub makes xserver and lightdm just hard fail when started in the tty instead of startup.

new Xorg.0.log file

[   238.486] 
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
[   238.505] Build Operating System: Linux Manjaro Linux
[   238.512] Current Operating System: Linux desk 5.10.23-1-MANJARO #1 SMP PREEMPT Thu Mar 11 18:47:18 UTC 2021 x86_64
[   238.512] Kernel command line: BOOT_IMAGE=/vmlinuz-5.10-x86_64 root=UUID=1578da60-6045-4342-8e0c-7644878ee482 rw nomodeset iommu=pt amd_iommu=on cryptdevice=UUID=be971bfe-ee44-4d08-80a7-69b696e0cf12:luks-be971bfe-ee44-4d08-80a7-69b696e0cf12 root=/dev/mapper/luks-be971bfe-ee44-4d08-80a7-69b696e0cf12 resume=/dev/mapper/luks-be971bfe-ee44-4d08-80a7-69b696e0cf12 udev.log_priority=3
[   238.534] Build Date: 16 December 2020  10:33:32PM
[   238.542]  
[   238.549] Current version of pixman: 0.40.0
[   238.563] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   238.563] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   238.593] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Apr  7 17:41:04 2021
[   238.600] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   238.608] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   238.608] (==) No Layout section.  Using the first Screen section.
[   238.608] (==) No screen section available. Using defaults.
[   238.608] (**) |-->Screen "Default Screen Section" (0)
[   238.608] (**) |   |-->Monitor "<default monitor>"
[   238.608] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[   238.608] (**) |   |-->Device "AMD"
[   238.608] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[   238.608] (==) Automatically adding devices
[   238.608] (==) Automatically enabling devices
[   238.608] (==) Automatically adding GPU devices
[   238.608] (==) Automatically binding GPU devices
[   238.608] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   238.608] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[   238.608] 	Entry deleted from font path.
[   238.608] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[   238.608] 	Entry deleted from font path.
[   238.608] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[   238.608] 	Entry deleted from font path.
[   238.608] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF,
	/usr/share/fonts/OTF
[   238.608] (==) ModulePath set to "/usr/lib/xorg/modules"
[   238.608] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[   238.608] (II) Module ABI versions:
[   238.608] 	X.Org ANSI C Emulation: 0.4
[   238.608] 	X.Org Video Driver: 24.1
[   238.608] 	X.Org XInput driver : 24.1
[   238.608] 	X.Org Server Extension : 10.0
[   238.609] (++) using VT number 3

[   238.611] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[   238.619] (--) PCI: (8@0:0:0) 10de:1e81:10de:13a0 rev 161, Mem @ 0xd8000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x00003000/128, BIOS @ 0x????????/524288
[   238.619] (--) PCI:*(69@0:0:0) 1002:66af:1002:081e rev 193, Mem @ 0x80000000/268435456, 0x90000000/2097152, 0x9fb00000/524288, I/O @ 0x00004000/256, BIOS @ 0x????????/131072
[   238.619] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   238.619] (II) LoadModule: "glx"
[   238.619] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   238.620] (II) Module glx: vendor="X.Org Foundation"
[   238.620] 	compiled for 1.20.10, module version = 1.0.0
[   238.620] 	ABI class: X.Org Server Extension, version 10.0
[   238.620] (II) LoadModule: "amdgpu"
[   238.620] (II) Loading /usr/lib/xorg/modules/drivers/amdgpu_drv.so
[   238.620] (II) Module amdgpu: vendor="X.Org Foundation"
[   238.620] 	compiled for 1.20.8, module version = 19.1.0
[   238.620] 	Module class: X.Org Video Driver
[   238.620] 	ABI class: X.Org Video Driver, version 24.1
[   238.620] (II) AMDGPU: Driver for AMD Radeon:
	All GPUs supported by the amdgpu kernel driver
[   238.620] (II) AMDGPU(0): [KMS] drm report modesetting isn't supported.
[   238.620] (EE) Screen 0 deleted because of no matching config section.
[   238.620] (II) UnloadModule: "amdgpu"
[   238.620] (EE) Device(s) detected, but none match those in the config file.
[   238.620] (EE) 
Fatal server error:
[   238.620] (EE) no screens found(EE) 
[   238.620] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   238.620] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   238.620] (EE) 
[   238.644] (EE) Server terminated with error (1). Closing log file.