Xorg errors while attempting gpu passthrough

I have successfully attached my gpu to a debian qube, however whenever I go to start xorg as instructed in the guide here: Create a Gaming HVM - Community Guides - Qubes OS Forum, it errors out saying it can’t find any screens. The full message when the script is started is here:

X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
Current Operating System: Linux gpu 6.6.31-1.qubes.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 22 00:57:05 GMT 2024 x86_64
Kernel command line: root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 clocksource=tsc xen_scrub_pages=0 apparmor=1 security=apparmor
xorg-server 2:21.1.7-3+deb12u7 (Debian -- User Support)
Current version of pixman: 0.42.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: “/var/log/Xorg.1.log”, Time: Thu Jul 11 11:57:23 2024
(++) Using config file: “/home/user/AOC.conf”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
(II) AMDGPU(0): [KMS] Kernel modesetting enabled.
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at “/var/log/Xorg.1.log” for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

If anyone knows how to fix this error, that would be very helpful.

On a side note, the xorgX1.sh script makes me put a binary in otherwise it doesn’t run and there is no mention of that in the guide. I have just been using xterm, but perhaps I should be using something else?

here is the output from /var/log/Xorg.1.log:

[ 390.912]
X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
[ 390.912] Current Operating System: Linux gpu 6.6.31-1.qubes.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 22 00:57:05 GMT 2024 x86_64
[ 390.912] Kernel command line: root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 clocksource=tsc xen_scrub_pages=0 apparmor=1 security=apparmor
[ 390.912] xorg-server 2:21.1.7-3+deb12u7 (Debian -- User Support)
[ 390.912] Current version of pixman: 0.42.2
[ 390.912] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 390.912] Markers: (–) probed, () from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 390.912] (==) Log file: “/var/log/Xorg.1.log”, Time: Thu Jul 11 11:57:23 2024
[ 390.912] (++) Using config file: “/home/user/AOC.conf”
[ 390.912] (==) Using system config directory “/usr/share/X11/xorg.conf.d”
[ 390.912] (==) ServerLayout “Gaming”
[ 390.912] (
) |–>Screen “AMD AOC” (0)
[ 390.912] () | |–>Monitor “AOC”
[ 390.913] (
) | |–>Device “AMD”
[ 390.913] (==) Automatically adding devices
[ 390.913] (==) Automatically enabling devices
[ 390.913] (==) Automatically adding GPU devices
[ 390.913] (==) Automatically binding GPU devices
[ 390.913] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 390.913] (WW) The directory “/usr/share/fonts/X11/cyrillic” does not exist.
[ 390.913] Entry deleted from font path.
[ 390.913] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins
[ 390.913] (==) ModulePath set to “/usr/lib/xorg/modules”
[ 390.913] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 390.913] (II) Loader magic: 0x5e76c5934f00
[ 390.913] (II) Module ABI versions:
[ 390.913] X.Org ANSI C Emulation: 0.4
[ 390.913] X.Org Video Driver: 25.2
[ 390.913] X.Org XInput driver : 24.4
[ 390.913] X.Org Server Extension : 10.0
[ 390.913] (–) using VT number 2

[ 390.913] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 390.921] (–) PCI:*(0@0:4:0) 1234:1111:1af4:1100 rev 2, Mem @ 0xf1000000/16777216, 0xf2136000/4096, BIOS @ 0x???/131072
[ 390.921] (–) PCI: (0@0:8:0) 1002:7480:f111:0007 rev 193, Mem @ 0x200000000/8589934592, 0xe0000000/268435456, 0xf2000000/1048576, I/O @ 0x0000c300/256, BIOS @ 0x???/131072
[ 390.921] (II) LoadModule: “glx”
[ 390.921] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 390.922] (II) Module glx: vendor=“X.Org Foundation”
[ 390.922] compiled for 1.21.1.7, module version = 1.0.0
[ 390.922] ABI class: X.Org Server Extension, version 10.0
[ 390.922] (II) LoadModule: “amdgpu”
[ 390.922] (II) Loading /usr/lib/xorg/modules/drivers/amdgpu_drv.so
[ 390.922] (II) Module amdgpu: vendor=“X.Org Foundation”
[ 390.922] compiled for 1.21.1.7, module version = 23.0.0
[ 390.922] Module class: X.Org Video Driver
[ 390.922] ABI class: X.Org Video Driver, version 25.2
[ 390.922] (II) AMDGPU: Driver for AMD Radeon:
All GPUs supported by the amdgpu kernel driver
[ 390.929] (II) AMDGPU(0): [KMS] Kernel modesetting enabled.
[ 390.929] (EE) AMDGPU(0): [drm] Failed to open DRM device for pci:0000:00:08.0: No such file or directory
[ 390.929] (EE) Screen 0 deleted because of no matching config section.
[ 390.929] (II) UnloadModule: “amdgpu”
[ 390.929] (EE) Device(s) detected, but none match those in the config file.
[ 390.929] (EE)
Fatal server error:
[ 390.929] (EE) no screens found(EE)
[ 390.929] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 390.929] (EE) Please also check the log file at “/var/log/Xorg.1.log” for additional information.
[ 390.929] (EE)
[ 390.936] (EE) Server terminated with error (1). Closing log file.

Did you connect a separate display to your GPU that you’ve passthrough to your qube?

it’s mentioned there:

1 Like

A monitor is connected to the gpu. I must have missed that part in the guide, gave it a try, same error

Check the output of lspci in your qube and check if your GPU ID is 0000:00:08.0.
Do you have any errors when you run xorgX1.sh?

0000:00:08.0 is the gpu. running xorgX1.sh on its own tells me a binary is required, it never gets to actually running xorg.

Check the dmesg/journalctl in the qube, maybe you’re missing your GPU firmware or there is some driver issue.
Also did you generate your own Xorg config? E.g.:

This might be an issue. See R4.1(x86_64) unable to unset `nomodeset` kernel CLI in PV - #3 by kreyren

I missed that part originally. I generated the config file and modified it like the comment said and I am still getting the same error about the gpu. I am also getting an error that I am pretty sure is related to the config, so I think this is progress.

Regarding dmesg, I did find this error, pci 0000:00:08.0: can’t claim BAR 2 [mem 0x7ee0000000-0xyeefffffff 64bit pref]: no compatible bridge window. In journalctl I have found these errors: gpu kernel: piix4_smbus 0000:00:01.3 SMBus Host Controller not enabled, gpu kernel: Error: Driver ‘pcspkr’ is already registered, aborting. I also seem to have broken this qube as it no longer opens windows when launched, so I am going to try in a fresh qube