You are not logged in.

#1 2020-11-03 17:14:18

Tabascl
Member
Registered: 2020-11-03
Posts: 2

[SOLVED]OVMF Passthrough: X fails to start if host uses Nvidia drivers

EDIT: Found the solution:

I needed to add the BusID of the host GPU to the Section "Device" of my xorg.conf.

Hi everyone,

I've come across a weird problem while working on a GPU passthrough on the following hardware:

CPU: Ryzen 9 3900XT
GPU (Host): Nvidia GTX 1070
GPU (Guest): Nvidia RTX 3080
Mainboard: Asus PRIME X570-P

Relevant output of

lspci -nnk
04:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:3302]
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia
04:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1)
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:3302]
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
09:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2206] (rev a1)
        Subsystem: NVIDIA Corporation Device [10de:1467]
        Kernel driver in use: vfio-pci
        Kernel modules: nouveau, nvidia_drm, nvidia
09:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:1aef] (rev a1)
        Subsystem: NVIDIA Corporation Device [10de:1467]
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel

If I boot my machine with both cards connected to my 2 monitors (each GPU has a DisplayPort and a HDMI cable connected to each monitor), I don't get any output from the host card.
If however, I unplug the guest GPU from the machine and boot, I get output from host card suddenly. At this point I can reconnect the guest card cables and the passthrough works flawlessly.

Here's the log from X, which I've got by sshing into the machine when it was booted with everything connected:

[     8.102] (--) Log file renamed from "/var/log/Xorg.pid-1163.log" to "/var/log/Xorg.0.log"
[     8.103] 
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
[     8.103] Build Operating System: Linux Manjaro Linux
[     8.103] Current Operating System: Linux pc 5.8.16-2-MANJARO #1 SMP PREEMPT Mon Oct 19 11:33:03 UTC 2020 x86_64
[     8.103] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.8-x86_64 root=UUID=b1a39470-dbb6-43aa-94ee-42be05bae299 rw quiet apparmor=1 security=apparmor udev.log_priority=3 usbcore.autosuspend=-1 amd_iommu=on iommu=pt video=efifb:off default_hugepagesz=1G hugepagesz=1G hugepages=20
[     8.103] Build Date: 02 September 2020  07:39:17AM
[     8.103]  
[     8.103] Current version of pixman: 0.40.0
[     8.103] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[     8.103] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     8.103] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Nov  3 16:32:01 2020
[     8.103] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     8.103] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     8.103] (==) ServerLayout "layout"
[     8.103] (**) |-->Screen "Screen0" (0)
[     8.103] (**) |   |-->Monitor "Monitor0"
[     8.103] (**) |   |-->Device "Device0"
[     8.103] (==) Automatically adding devices
[     8.103] (==) Automatically enabling devices
[     8.103] (==) Automatically adding GPU devices
[     8.103] (==) Automatically binding GPU devices
[     8.103] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     8.103] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/misc".
[     8.103] 	Entry deleted from font path.
[     8.103] 	(Run 'mkfontdir' on "/usr/share/fonts/misc").
[     8.103] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/TTF".
[     8.103] 	Entry deleted from font path.
[     8.103] 	(Run 'mkfontdir' on "/usr/share/fonts/TTF").
[     8.103] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[     8.103] 	Entry deleted from font path.
[     8.103] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[     8.103] 	Entry deleted from font path.
[     8.103] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[     8.103] 	Entry deleted from font path.
[     8.103] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[     8.103] 	Entry deleted from font path.
[     8.103] (==) FontPath set to:
 
[     8.103] (==) ModulePath set to "/usr/lib/xorg/modules"
[     8.103] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[     8.103] (II) Module ABI versions:
[     8.103] 	X.Org ANSI C Emulation: 0.4
[     8.103] 	X.Org Video Driver: 24.1
[     8.103] 	X.Org XInput driver : 24.1
[     8.103] 	X.Org Server Extension : 10.0
[     8.103] (++) using VT number 1
 
[     8.103] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[     8.103] (II) xfree86: Adding drm device (/dev/dri/card0)
[     8.103] (II) Platform probe for /sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:02.0/0000:04:00.0/drm/card0
[     8.105] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules"
[     8.105] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules"
[     8.116] (--) PCI: (4@0:0:0) 10de:1b81:1462:3302 rev 161, Mem @ 0xf9000000/16777216, 0xd0000000/268435456, 0xe0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/524288
[     8.116] (--) PCI:*(9@0:0:0) 10de:2206:10de:1467 rev 161, Mem @ 0xfb000000/16777216, 0xb0000000/268435456, 0xc0000000/33554432, I/O @ 0x0000f000/128, BIOS @ 0x????????/524288
[     8.116] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[     8.117] (II) LoadModule: "glx"
[     8.117] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[     8.117] (II) Module glx: vendor="X.Org Foundation"
[     8.117] 	compiled for 1.20.9, module version = 1.0.0
[     8.117] 	ABI class: X.Org Server Extension, version 10.0
[     8.117] (II) LoadModule: "nvidia"
[     8.117] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[     8.117] (II) Module nvidia: vendor="NVIDIA Corporation"
[     8.117] 	compiled for 1.6.99.901, module version = 1.0.0
[     8.117] 	Module class: X.Org Video Driver
[     8.117] (II) NVIDIA dlloader X Driver  455.28  Wed Sep 30 01:04:06 UTC 2020
[     8.117] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[     8.118] (II) Loading sub module "fb"
[     8.118] (II) LoadModule: "fb"
[     8.118] (II) Loading /usr/lib/xorg/modules/libfb.so
[     8.118] (II) Module fb: vendor="X.Org Foundation"
[     8.118] 	compiled for 1.20.9, module version = 1.0.0
[     8.118] 	ABI class: X.Org ANSI C Emulation, version 0.4
[     8.118] (II) Loading sub module "wfb"
[     8.118] (II) LoadModule: "wfb"
[     8.118] (II) Loading /usr/lib/xorg/modules/libwfb.so
[     8.118] (II) Module wfb: vendor="X.Org Foundation"
[     8.118] 	compiled for 1.20.9, module version = 1.0.0
[     8.118] 	ABI class: X.Org ANSI C Emulation, version 0.4
[     8.118] (II) Loading sub module "ramdac"
[     8.118] (II) LoadModule: "ramdac"
[     8.118] (II) Module "ramdac" already built-in
[     8.118] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[     8.118] (==) NVIDIA(0): RGB weight 888
[     8.118] (==) NVIDIA(0): Default visual is TrueColor
[     8.118] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[     8.118] (**) Option "AllowNVIDIAGpuScreens"
[     8.118] (**) NVIDIA(0): Option "Stereo" "0"
[     8.118] (**) NVIDIA(0): Option "nvidiaXineramaInfoOrder" "DFP-1"
[     8.118] (**) NVIDIA(0): Option "SLI" "Off"
[     8.118] (**) NVIDIA(0): Option "MultiGPU" "Off"
[     8.118] (**) NVIDIA(0): Option "BaseMosaic" "off"
[     8.118] (**) NVIDIA(0): Stereo disabled by request
[     8.118] (**) NVIDIA(0): NVIDIA SLI disabled.
[     8.118] (**) NVIDIA(0): NVIDIA Multi-GPU disabled.
[     8.118] (**) NVIDIA(0): Option "MetaModes" "DP-4: 2560x1440_144 +0+0, HDMI-0: 2560x1440_144 +2560+0"
[     8.118] (**) NVIDIA(0): Enabling 2D acceleration
[     8.118] (II) Loading sub module "glxserver_nvidia"
[     8.118] (II) LoadModule: "glxserver_nvidia"
[     8.118] (II) Loading /usr/lib/nvidia/xorg/libglxserver_nvidia.so
[     8.122] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
[     8.122] 	compiled for 1.6.99.901, module version = 1.0.0
[     8.122] 	Module class: X.Org Server Extension
[     8.122] (II) NVIDIA GLX Module  455.28  Wed Sep 30 01:01:28 UTC 2020
[     8.122] (II) NVIDIA: The X server supports PRIME Render Offload.
[     8.122] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
[     8.122] (EE) NVIDIA(0): Failing initialization of X screen
[     8.122] (II) UnloadModule: "nvidia"
[     8.122] (II) UnloadSubModule: "glxserver_nvidia"
[     8.122] (II) Unloading glxserver_nvidia
[     8.122] (II) UnloadSubModule: "wfb"
[     8.122] (II) UnloadSubModule: "fb"
[     8.122] (**) NVIDIA(G0): Depth 24, (--) framebuffer bpp 32
[     8.122] (==) NVIDIA(G0): RGB weight 888
[     8.122] (==) NVIDIA(G0): Default visual is TrueColor
[     8.122] (==) NVIDIA(G0): Using gamma correction (1.0, 1.0, 1.0)
[     8.122] (II) Applying OutputClass "nvidia" options to /dev/dri/card0
[     8.122] (II) Applying OutputClass "nvidia" options to /dev/dri/card0
[     8.122] (**) NVIDIA(G0): Option "Stereo" "0"
[     8.122] (**) NVIDIA(G0): Option "nvidiaXineramaInfoOrder" "DFP-1"
[     8.122] (**) NVIDIA(G0): Option "SLI" "Off"
[     8.122] (**) NVIDIA(G0): Option "MultiGPU" "Off"
[     8.122] (**) NVIDIA(G0): Option "BaseMosaic" "off"
[     8.122] (**) NVIDIA(G0): Option "AllowEmptyInitialConfiguration"
[     8.122] (**) NVIDIA(G0): Stereo disabled by request
[     8.122] (**) NVIDIA(G0): NVIDIA SLI disabled.
[     8.122] (**) NVIDIA(G0): NVIDIA Multi-GPU disabled.
[     8.122] (**) NVIDIA(G0): Enabling 2D acceleration
[     8.122] (II) NVIDIA: The X server supports PRIME Render Offload.
[     8.523] (--) NVIDIA(0): Valid display device(s) on GPU-1 at PCI:4:0:0
[     8.523] (--) NVIDIA(0):     DFP-0
[     8.523] (--) NVIDIA(0):     DFP-1
[     8.523] (--) NVIDIA(0):     DFP-2
[     8.523] (--) NVIDIA(0):     DFP-3
[     8.523] (--) NVIDIA(0):     DFP-4
[     8.523] (--) NVIDIA(0):     DFP-5
[     8.523] (--) NVIDIA(0):     DFP-6 (boot)
[     8.523] (--) NVIDIA(0):     DFP-7
[     8.524] (II) NVIDIA(G0): NVIDIA GPU GeForce GTX 1070 (GP104-A) at PCI:4:0:0 (GPU-1)
[     8.524] (--) NVIDIA(G0): Memory: 8388608 kBytes
[     8.524] (--) NVIDIA(G0): VideoBIOS: 86.04.26.00.3e
[     8.524] (II) NVIDIA(G0): Detected PCI Express Link width: 16X
[     8.524] (--) NVIDIA(GPU-1): DFP-0: disconnected
[     8.524] (--) NVIDIA(GPU-1): DFP-0: Internal TMDS
[     8.524] (--) NVIDIA(GPU-1): DFP-0: 330.0 MHz maximum pixel clock
[     8.524] (--) NVIDIA(GPU-1): 
[     8.553] (--) NVIDIA(GPU-1): Microstep MSI MAG271CQR (DFP-1): connected
[     8.553] (--) NVIDIA(GPU-1): Microstep MSI MAG271CQR (DFP-1): Internal TMDS
[     8.553] (--) NVIDIA(GPU-1): Microstep MSI MAG271CQR (DFP-1): 600.0 MHz maximum pixel clock
[     8.553] (--) NVIDIA(GPU-1): 
[     8.553] (--) NVIDIA(GPU-1): DFP-2: disconnected
[     8.553] (--) NVIDIA(GPU-1): DFP-2: Internal DisplayPort
[     8.553] (--) NVIDIA(GPU-1): DFP-2: 1440.0 MHz maximum pixel clock
[     8.553] (--) NVIDIA(GPU-1): 
[     8.554] (--) NVIDIA(GPU-1): DFP-3: disconnected
[     8.554] (--) NVIDIA(GPU-1): DFP-3: Internal TMDS
[     8.554] (--) NVIDIA(GPU-1): DFP-3: 165.0 MHz maximum pixel clock
[     8.554] (--) NVIDIA(GPU-1): 
[     8.554] (--) NVIDIA(GPU-1): DFP-4: disconnected
[     8.554] (--) NVIDIA(GPU-1): DFP-4: Internal DisplayPort
[     8.554] (--) NVIDIA(GPU-1): DFP-4: 1440.0 MHz maximum pixel clock
[     8.554] (--) NVIDIA(GPU-1): 
[     8.554] (--) NVIDIA(GPU-1): DFP-5: disconnected
[     8.554] (--) NVIDIA(GPU-1): DFP-5: Internal TMDS
[     8.554] (--) NVIDIA(GPU-1): DFP-5: 165.0 MHz maximum pixel clock
[     8.554] (--) NVIDIA(GPU-1): 
[     8.554] (--) NVIDIA(GPU-1): Microstep MSI MAG271CQR (DFP-6): connected
[     8.554] (--) NVIDIA(GPU-1): Microstep MSI MAG271CQR (DFP-6): Internal DisplayPort
[     8.554] (--) NVIDIA(GPU-1): Microstep MSI MAG271CQR (DFP-6): 1440.0 MHz maximum pixel clock
[     8.554] (--) NVIDIA(GPU-1): 
[     8.555] (--) NVIDIA(GPU-1): DFP-7: disconnected
[     8.555] (--) NVIDIA(GPU-1): DFP-7: Internal TMDS
[     8.555] (--) NVIDIA(GPU-1): DFP-7: 165.0 MHz maximum pixel clock
[     8.555] (--) NVIDIA(GPU-1): 
[     8.590] (II) NVIDIA(G0): Validated MetaModes:
[     8.590] (II) NVIDIA(G0):     "NULL"
[     8.590] (II) NVIDIA(G0): Virtual screen size determined to be 640 x 480
[     8.608] (WW) NVIDIA(G0): Cannot find size of first mode for Microstep MSI MAG271CQR
[     8.608] (WW) NVIDIA(G0):     (DFP-6); cannot compute DPI from Microstep MSI MAG271CQR
[     8.608] (WW) NVIDIA(G0):     (DFP-6)'s EDID.
[     8.608] (==) NVIDIA(G0): DPI set to (75, 75); computed from built-in default
[     8.608] (EE) Screen(s) found, but none have a usable configuration.
[     8.608] (EE) 
Fatal server error:
[     8.608] (EE) no screens found(EE) 
[     8.608] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[     8.608] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[     8.608] (EE) 
[     8.608] (EE) Server terminated with error (1). Closing log file.

This looks like the nvidia driver still tries to use the guest GPU, and somehow taints the host GPU in the process.
Is there any way to fix this, so I can leave all cables plugged in?

Last edited by Tabascl (2020-11-03 19:59:55)

Offline

Board footer

Powered by FluxBB