弄显卡直连的时候Xorg出问题了……

[    44.164] (--) Log file renamed from "/var/log/Xorg.pid-3283.log" to "/var/log/Xorg.0.log"
[    44.164] 
X.Org X Server 1.19.6
Release Date: 2017-12-20
[    44.164] X Protocol Version 11, Revision 0
[    44.164] Build Operating System: openSUSE SUSE LINUX
[    44.164] Current Operating System: Linux linux-lpr1 4.17.1-1-default #1 SMP PREEMPT Thu Jun 14 06:39:01 UTC 2018 (df028bb) x86_64
[    44.164] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.17.1-1-default root=UUID=4f1b8374-6f94-4946-a0cb-f85e960c106e resume=/dev/disk/by-id/ata-GLOWAY_STK240GS3-S7_000000008850-part6 amd_iommu=on iommu=pt default_hugepagesz=1G hugepagesz=1G hugepages=6 transparent_hugepage=never video=vesafb:off,efifb:off splash=silent quiet showopts
[    44.164] Build Date: 17 April 2018  12:00:00PM
[    44.164]  
[    44.164] Current version of pixman: 0.34.0
[    44.164] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    44.164] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    44.164] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Jun 19 22:05:15 2018
[    44.164] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    44.164] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    44.165] (==) No Layout section.  Using the first Screen section.
[    44.165] (==) No screen section available. Using defaults.
[    44.165] (**) |-->Screen "Default Screen Section" (0)
[    44.165] (**) |   |-->Monitor "<default monitor>"
[    44.165] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[    44.165] (==) Automatically adding devices
[    44.165] (==) Automatically enabling devices
[    44.165] (==) Automatically adding GPU devices
[    44.165] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    44.165] (WW) The directory "/usr/share/fonts/misc/sgi" does not exist.
[    44.165] 	Entry deleted from font path.
[    44.165] (==) FontPath set to:
	/usr/share/fonts/misc:unscaled,
	/usr/share/fonts/Type1/,
	/usr/share/fonts/100dpi:unscaled,
	/usr/share/fonts/75dpi:unscaled,
	/usr/share/fonts/ghostscript/,
	/usr/share/fonts/cyrillic:unscaled,
	/usr/share/fonts/truetype/,
	built-ins
[    44.165] (==) ModulePath set to "/usr/lib64/xorg/modules"
[    44.165] (**) Extension "XFree86-DGA" is disabled
[    44.165] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[    44.165] (II) Loader magic: 0x55ee0800dce0
[    44.165] (II) Module ABI versions:
[    44.165] 	X.Org ANSI C Emulation: 0.4
[    44.165] 	X.Org Video Driver: 23.0
[    44.165] 	X.Org XInput driver : 24.1
[    44.165] 	X.Org Server Extension : 10.0
[    44.166] (++) using VT number 7

[    44.166] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    44.166] (II) xfree86: Adding drm device (/dev/dri/card0)
[    44.172] (--) PCI:*(0:1:0:0) 10de:1c82:1458:378e rev 161, Mem @ 0xfd000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[    44.172] (--) PCI: (0:7:0:0) 1002:9552:0000:0000 rev 0, Mem @ 0xc0000000/268435456, 0xfe120000/65536, I/O @ 0x0000a000/256, BIOS @ 0x????????/131072
[    44.172] (II) LoadModule: "glx"
[    44.172] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[    44.173] (II) Module glx: vendor="X.Org Foundation"
[    44.173] 	compiled for 1.19.6, module version = 1.0.0
[    44.173] 	ABI class: X.Org Server Extension, version 10.0
[    44.173] (II) Scanning /etc/X11/xorg_pci_ids directory for additional PCI ID's supported by the drivers
[    44.173] (II) Scanning /etc/X11/xorg_pci_ids directory for additional PCI ID's supported by the drivers
[    44.173] (==) Matched ati as autoconfigured driver 0
[    44.173] (==) Matched nvidia as autoconfigured driver 1
[    44.173] (==) Matched nouveau as autoconfigured driver 2
[    44.173] (==) Matched nv as autoconfigured driver 3
[    44.173] (==) Matched modesetting as autoconfigured driver 4
[    44.173] (==) Matched fbdev as autoconfigured driver 5
[    44.173] (==) Matched vesa as autoconfigured driver 6
[    44.173] (==) Assigned the driver to the xf86ConfigLayout
[    44.173] (II) LoadModule: "ati"
[    44.173] (WW) Warning, couldn't open module atimodprobe
[    44.173] (II) UnloadModule: "ati"
[    44.173] (II) Unloading ati
[    44.173] (EE) Failed to load module "ati" (module does not exist, 0)
[    44.173] (II) LoadModule: "nvidia"
[    44.173] (WW) Warning, couldn't open module nvidia
[    44.173] (II) UnloadModule: "nvidia"
[    44.173] (II) Unloading nvidia
[    44.173] (EE) Failed to load module "nvidia" (module does not exist, 0)
[    44.173] (II) LoadModule: "nouveau"
[    44.173] (II) Loading /usr/lib64/xorg/modules/drivers/nouveau_drv.so
[    44.174] (II) Module nouveau: vendor="X.Org Foundation"
[    44.174] 	compiled for 1.19.6, module version = 1.0.15
[    44.174] 	Module class: X.Org Video Driver
[    44.174] 	ABI class: X.Org Video Driver, version 23.0
[    44.174] (II) LoadModule: "nv"
[    44.174] (WW) Warning, couldn't open module nv
[    44.174] (II) UnloadModule: "nv"
[    44.174] (II) Unloading nv
[    44.174] (EE) Failed to load module "nv" (module does not exist, 0)
[    44.174] (II) LoadModule: "modesetting"
[    44.174] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so
[    44.174] (II) Module modesetting: vendor="X.Org Foundation"
[    44.174] 	compiled for 1.19.6, module version = 1.19.6
[    44.174] 	Module class: X.Org Video Driver
[    44.174] 	ABI class: X.Org Video Driver, version 23.0
[    44.174] (II) LoadModule: "fbdev"
[    44.174] (II) Loading /usr/lib64/xorg/modules/drivers/fbdev_drv.so
[    44.174] (II) Module fbdev: vendor="X.Org Foundation"
[    44.174] 	compiled for 1.19.6, module version = 0.5.0
[    44.174] 	Module class: X.Org Video Driver
[    44.174] 	ABI class: X.Org Video Driver, version 23.0
[    44.174] (II) LoadModule: "vesa"
[    44.174] (II) Loading /usr/lib64/xorg/modules/drivers/vesa_drv.so
[    44.174] (II) Module vesa: vendor="X.Org Foundation"
[    44.174] 	compiled for 1.19.6, module version = 2.4.0
[    44.174] 	Module class: X.Org Video Driver
[    44.174] 	ABI class: X.Org Video Driver, version 23.0
[    44.174] (II) NOUVEAU driver 
[    44.174] (II) NOUVEAU driver for NVIDIA chipset families :
[    44.174] 	RIVA TNT        (NV04)
[    44.174] 	RIVA TNT2       (NV05)
[    44.174] 	GeForce 256     (NV10)
[    44.174] 	GeForce 2       (NV11, NV15)
[    44.174] 	GeForce 4MX     (NV17, NV18)
[    44.174] 	GeForce 3       (NV20)
[    44.174] 	GeForce 4Ti     (NV25, NV28)
[    44.174] 	GeForce FX      (NV3x)
[    44.174] 	GeForce 6       (NV4x)
[    44.175] 	GeForce 7       (G7x)
[    44.175] 	GeForce 8       (G8x)
[    44.175] 	GeForce GTX 200 (NVA0)
[    44.175] 	GeForce GTX 400 (NVC0)
[    44.175] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    44.175] (II) FBDEV: driver for framebuffer: fbdev
[    44.175] (II) VESA: driver for VESA chipsets: vesa
[    44.289] (EE) [drm] Failed to open DRM device for pci:0000:01:00.0: -19
[    44.290] (II) modeset(G0): using drv /dev/dri/card0
[    44.290] (II) Loading sub module "fbdevhw"
[    44.290] (II) LoadModule: "fbdevhw"
[    44.290] (II) Loading /usr/lib64/xorg/modules/libfbdevhw.so
[    44.290] (II) Module fbdevhw: vendor="X.Org Foundation"
[    44.290] 	compiled for 1.19.6, module version = 0.0.2
[    44.290] 	ABI class: X.Org Video Driver, version 23.0
[    44.290] (EE) Unable to find a valid framebuffer device
[    44.290] (WW) Falling back to old probe method for fbdev
[    44.290] (II) Loading sub module "fbdevhw"
[    44.290] (II) LoadModule: "fbdevhw"
[    44.290] (II) Loading /usr/lib64/xorg/modules/libfbdevhw.so
[    44.290] (II) Module fbdevhw: vendor="X.Org Foundation"
[    44.290] 	compiled for 1.19.6, module version = 0.0.2
[    44.290] 	ABI class: X.Org Video Driver, version 23.0
[    44.290] vesa: Ignoring device with a bound kernel driver
[    44.290] (EE) Screen 0 deleted because of no matching config section.
[    44.290] (II) UnloadModule: "fbdev"
[    44.290] (II) UnloadSubModule: "fbdevhw"
[    44.290] (EE) Screen 0 deleted because of no matching config section.
[    44.290] (II) UnloadModule: "vesa"
[    44.290] (EE) Device(s) detected, but none match those in the config file.
[    44.290] (EE) 
Fatal server error:
[    44.290] (EE) no screens found(EE) 
[    44.290] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.orgmodprobe
 for help. 
[    44.290] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    44.290] (EE) 
[    44.297] (EE) Server terminated with error (1). Closing log file.

这是不是加载Nouveau失败后 Xorg放弃治疗了?
不能在内核指定哪个显卡启动吗?
非得从第一条显卡槽启动?
屏蔽了nouveau 貌似还是被Xorg modprobe了出来……

错误在这里,不是 nouveau 的锅,另外你 nouveau 禁用没成功。nvidia 闭源驱动也不存在。你的 Screen0 也没有有效的 config。

Xorg 可以通过 PCI 指定用哪张卡:

我试着设定了/etc/X11/xorg.conf.d/secondary-gpu.conf
Section “Device”
Identifier “Device1”
Driver “radeon”
VendorName “AMD Corporation”
BoardName “AMD Secondary”
BusID “PCI:7:0:0”
EndSection

[   219.726] (--) Log file renamed from "/var/log/Xorg.pid-3572.log" to "/var/log/Xorg.0.log"
[   219.727] 
X.Org X Server 1.19.6
Release Date: 2017-12-20
[   219.727] X Protocol Version 11, Revision 0
[   219.727] Build Operating System: openSUSE SUSE LINUX
[   219.727] Current Operating System: Linux linux-lpr1 4.17.1-1-default #1 SMP PREEMPT Thu Jun 14 06:39:01 UTC 2018 (df028bb) x86_64
[   219.727] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.17.1-1-default root=UUID=4f1b8374-6f94-4946-a0cb-f85e960c106e resume=/dev/disk/by-id/ata-GLOWAY_STK240GS3-S7_000000008850-part6 amd_iommu=on iommu=pt video=efifb:off splash=silent quiet showopts
[   219.727] Build Date: 17 April 2018  12:00:00PM
[   219.727]  
[   219.727] Current version of pixman: 0.34.0
[   219.727] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   219.727] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   219.727] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jun 20 12:48:49 2018
[   219.727] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   219.727] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   219.727] (==) No Layout section.  Using the first Screen section.
[   219.727] (==) No screen section available. Using defaults.
[   219.727] (**) |-->Screen "Default Screen Section" (0)
[   219.727] (**) |   |-->Monitor "<default monitor>"
[   219.728] (==) No device specified for screen "Default Screen Section".
	Using the first device section listed.
[   219.728] (**) |   |-->Device "Device1"
[   219.728] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[   219.728] (==) Automatically adding devices
[   219.728] (==) Automatically enabling devices
[   219.728] (==) Automatically adding GPU devices
[   219.728] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   219.728] (WW) The directory "/usr/share/fonts/misc/sgi" does not exist.
[   219.728] 	Entry deleted from font path.
[   219.728] (==) FontPath set to:
	/usr/share/fonts/misc:unscaled,
	/usr/share/fonts/Type1/,
	/usr/share/fonts/100dpi:unscaled,
	/usr/share/fonts/75dpi:unscaled,
	/usr/share/fonts/ghostscript/,
	/usr/share/fonts/cyrillic:unscaled,
	/usr/share/fonts/truetype/,
	built-ins
[   219.728] (==) ModulePath set to "/usr/lib64/xorg/modules"
[   219.728] (**) Extension "XFree86-DGA" is disabled
[   219.728] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[   219.728] (II) Loader magic: 0x5614f4fffce0
[   219.728] (II) Module ABI versions:
[   219.728] 	X.Org ANSI C Emulation: 0.4
[   219.728] 	X.Org Video Driver: 23.0
[   219.728] 	X.Org XInput driver : 24.1
[   219.728] 	X.Org Server Extension : 10.0
[   219.729] (++) using VT number 7

[   219.729] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[   219.729] (II) xfree86: Adding drm device (/dev/dri/card0)
[   219.735] (--) PCI:*(0:1:0:0) 10de:1c82:1458:378e rev 161, Mem @ 0xfd000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[   219.735] (--) PCI: (0:7:0:0) 1002:9552:0000:0000 rev 0, Mem @ 0xc0000000/268435456, 0xfe120000/65536, I/O @ 0x0000a000/256, BIOS @ 0x????????/131072
[   219.735] (II) LoadModule: "glx"
[   219.735] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[   219.736] (II) Module glx: vendor="X.Org Foundation"
[   219.736] 	compiled for 1.19.6, module version = 1.0.0
[   219.736] 	ABI class: X.Org Server Extension, version 10.0
[   219.736] (II) LoadModule: "radeon"
[   219.736] (WW) Warning, couldn't open module radeon
[   219.736] (II) UnloadModule: "radeon"
[   219.736] (II) Unloading radeon
[   219.736] (EE) Failed to load module "radeon" (module does not exist, 0)
[   219.736] (EE) No drivers available.
[   219.736] (EE) 
Fatal server error:
[   219.736] (EE) no screens found(EE) 
[   219.736] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   219.736] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   219.736] (EE) 
[   219.736] (EE) Server terminated with error (1). Closing log file.

说是radeon不存在 但是这玩意明明在的呀
sudo lsmod | grep “radeon”
radeon 1634304 10
ttm 126976 1 radeon
drm_kms_helper 196608 1 radeon
drm 462848 12 drm_kms_helper,radeon,ttm
i2c_algo_bit 16384 1 radeon

第一,你的 log 的时间是否对。
第二,你指定的 PCI 槽是否对。

是不是应该给点 background 为什么楼从 nouveau 歪到 radeon 去了

https://www.redhat.com/archives/vfio-users/2016-August/msg00025.html
和这边情况一样
我的第一条PCI-E不能用来做显卡直通
Xorg的log看起来是vfio pci绑定显卡之后 Xorg还是用第一张卡显示图形了
于是想试着屏蔽nouveau 看会不会好点(似乎没有成)
lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD9x0/RX980 Host Bridge (rev 02)
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD/ATI] RD890S/RD990 I/O Memory Management Unit (IOMMU)
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GFX port 0)
00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 0)
00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 1)
00:06.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 2)
00:07.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 3)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0)
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 09)
03:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
04:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 01)
05:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
06:07.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)
07:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4330/4350/4550]
07:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] RV710/730 HDMI Audio [Radeon HD 4000 series]
pci槽应该没问题