PCI 패스스루 후 Xorg/GDM의 기본 GPU 장치를 변경하시겠습니까?

PCI 패스스루 후 Xorg/GDM의 기본 GPU 장치를 변경하시겠습니까?

장치 Intel Corporation HD Graphics 510는 Ubuntu 호스트 시스템에 사용해야 합니다.

장치 NVIDIA Corporation GP107는 KVM 사용을 위해 예약되었습니다.

Ubuntu 호스트 시스템은 Intel Corporation HD Graphics 510X 서버에 연결하는 데 제대로 사용할 수 없습니다. 이 문제를 해결할 수 있나요?

sudo systemctl start gdm명령을 사용하면 TTY가 계속 깜박이고 사용하기 어려워집니다.

sudo 고양이 /etc/default/grub | grep 명령줄

GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity nouveau.runpm=0"
GRUB_CMDLINE_LINUX="rd.modules-load=vfio-pci intel_iommu=on"

고양이 /etc/modprobe.d/local.conf

options vfio-pci ids=10de:1c81,10de:0fb9
options vfio-pci disable_vga=1

sudo 업데이트-그럽

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-32-generic
Found initrd image: /boot/initrd.img-4.15.0-32-generic
Found linux image: /boot/vmlinuz-4.15.0-30-generic
Found initrd image: /boot/initrd.img-4.15.0-30-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

sudo 업데이트-initramfs -u

update-initramfs: Generating /boot/initrd.img-4.15.0-32-generic

systemctl 재부팅

고양이 ~/.local/share/xorg/Xorg.0.log

[   876.205] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_3253
[   876.206] (II) xfree86: Adding drm device (/dev/dri/card0)
[   876.208] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[   876.214] (--) PCI: (0:0:2:0) 8086:1902:1462:7995 rev 6, Mem @ 0xdd000000/16777216, 0xb0000000/268435456, I/O @ 0x0000f000/64
[   876.214] (--) PCI:*(0:1:0:0) 10de:1c81:1462:8c97 rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[   876.214] (II) LoadModule: "glx"
[   876.214] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so

lspci -tvnnk

-[0000:00]-+-00.0  Intel Corporation Skylake Host Bridge/DRAM Registers [8086:190f]
        +-01.0-[01]--+-00.0  NVIDIA Corporation GP107 [GeForce GTX 1050] [10de:1c81]
        |            \-00.1  NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9]
        +-02.0  Intel Corporation HD Graphics 510 [8086:1902]
        +-08.0  Intel Corporation Skylake Gaussian Mixture Model [8086:1911]
        +-14.0  Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f]
        +-14.2  Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131]
        +-16.0  Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a]
        +-17.0  Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102]
        +-1d.0-[02]----00.0  Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168]
        +-1f.0  Intel Corporation Sunrise Point-H LPC Controller [8086:a143]
        +-1f.2  Intel Corporation Sunrise Point-H PMC [8086:a121]
        +-1f.3  Intel Corporation Sunrise Point-H HD Audio [8086:a170]
        \-1f.4  Intel Corporation Sunrise Point-H SMBus [8086:a123]

lspci -nnks 01:00

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107 [GeForce GTX 1050] [10de:1c81] (rev a1)
    Subsystem: Micro-Star International Co., Ltd. [MSI] GP107 [GeForce GTX 1050] [1462:8c97]
    Kernel driver in use: vfio-pci
    Kernel modules: nvidiafb, nouveau
01:00.1 Audio device [0403]: NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9] (rev a1)
    Subsystem: Micro-Star International Co., Ltd. [MSI] GP107GL High Definition Audio Controller [1462:8c97]
    Kernel driver in use: vfio-pci
    Kernel modules: snd_hda_intel

lspci -nnks 00:02

00:02.0 Display controller [0380]: Intel Corporation HD Graphics 510 [8086:1902] (rev 06)
    Subsystem: Micro-Star International Co., Ltd. [MSI] HD Graphics 510 [1462:7995]
    Kernel driver in use: i915
    Kernel modules: i915

GPU-manager.log:

log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can't access /run/u-d-c-nvidia-was-loaded file
can't access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for nvidia modules in /lib/modules/4.15.0-32-generic/updates/dkms
Looking for amdgpu modules in /lib/modules/4.15.0-32-generic/updates/dkms
Is nvidia loaded? no
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is nvidia kernel module available? no
Is amdgpu kernel module available? no
Vendor/Device Id: 8086:1902
BusID "PCI:0@0:2:0"
Is boot vga? no
Vendor/Device Id: 10de:1c81
BusID "PCI:1@0:0:0"
Is boot vga? yes
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card0", driven by "i915"
Found "/dev/dri/card0", driven by "i915"
output 0:
        card0-HDMI-A-1
Number of connected outputs for /dev/dri/card0: 1
Does it require offloading? yes
last cards number = 2
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
Has the system changed? No
Unsupported discrete card vendor: 8086
Nothing to do

Xorg.0.log:

$ cat ~/.local/share/xorg/Xorg.0.log
[  2684.239]
X.Org X Server 1.19.6
Release Date: 2017-12-20
[  2684.244] X Protocol Version 11, Revision 0
[  2684.246] Build Operating System: Linux 4.4.0-119-generic x86_64 Ubuntu
[  2684.247] Current Operating System: Linux ab350n2 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07 UTC 2018 x86_64
[  2684.247] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-32-generic root=UUID=87ad8dee-9975-11e8-a30b-309c230abb92 ro rd.modules-load=vfio-pci intel_iommu=on maybe-ubiquity
[  2684.251] Build Date: 13 April 2018  08:07:36PM
[  2684.253] xorg-server 2:1.19.6-1ubuntu4 (For technical support please see http://www.ubuntu.com/support)
[  2684.254] Current version of pixman: 0.34.0
[  2684.258]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[  2684.258] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  2684.265] (==) Log file: "/home/$USER/.local/share/xorg/Xorg.0.log", Time: Tue Aug 21 11:35:44 2018
[  2684.267] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  2684.267] (==) No Layout section.  Using the first Screen section.
[  2684.267] (==) No screen section available. Using defaults.
[  2684.267] (**) |-->Screen "Default Screen Section" (0)
[  2684.267] (**) |   |-->Monitor "<default monitor>"
[  2684.267] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[  2684.267] (==) Automatically adding devices
[  2684.267] (==) Automatically enabling devices
[  2684.267] (==) Automatically adding GPU devices
[  2684.267] (==) Automatically binding GPU devices
[  2684.267] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  2684.267] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[  2684.267]    Entry deleted from font path.
[  2684.267] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[  2684.267]    Entry deleted from font path.
[  2684.267] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[  2684.267]    Entry deleted from font path.
[  2684.267] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[  2684.267]    Entry deleted from font path.
[  2684.267] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[  2684.267]    Entry deleted from font path.
[  2684.267] (==) FontPath set to:
    /usr/share/fonts/X11/misc,
    /usr/share/fonts/X11/Type1,
    built-ins
[  2684.267] (==) ModulePath set to "/usr/lib/xorg/modules"
[  2684.267] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[  2684.267] (II) Loader magic: 0x564f402c8020
[  2684.267] (II) Module ABI versions:
[  2684.267]    X.Org ANSI C Emulation: 0.4
[  2684.267]    X.Org Video Driver: 23.0
[  2684.267]    X.Org XInput driver : 24.1
[  2684.267]    X.Org Server Extension : 10.0
[  2684.268] (++) using VT number 5

[  2684.269] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_3253
[  2684.270] (II) xfree86: Adding drm device (/dev/dri/card0)
[  2684.270] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[  2684.271] (--) PCI: (0:0:2:0) 8086:1902:1462:7995 rev 6, Mem @ 0xdd000000/16777216, 0xb0000000/268435456, I/O @ 0x0000f000/64
[  2684.271] (--) PCI:*(0:1:0:0) 10de:1c81:1462:8c97 rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[  2684.271] (II) LoadModule: "glx"
[  2684.272] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[  2684.272] (II) Module glx: vendor="X.Org Foundation"
[  2684.272]    compiled for 1.19.6, module version = 1.0.0
[  2684.272]    ABI class: X.Org Server Extension, version 10.0
[  2684.272] (==) Matched nouveau as autoconfigured driver 0
[  2684.272] (==) Matched modesetting as autoconfigured driver 1
[  2684.272] (==) Matched fbdev as autoconfigured driver 2
[  2684.272] (==) Matched vesa as autoconfigured driver 3
[  2684.272] (==) Assigned the driver to the xf86ConfigLayout
[  2684.272] (II) LoadModule: "nouveau"
[  2684.272] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so
[  2684.272] (II) Module nouveau: vendor="X.Org Foundation"
[  2684.272]    compiled for 1.19.3, module version = 1.0.15
[  2684.272]    Module class: X.Org Video Driver
[  2684.272]    ABI class: X.Org Video Driver, version 23.0
[  2684.272] (II) LoadModule: "modesetting"
[  2684.272] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[  2684.272] (II) Module modesetting: vendor="X.Org Foundation"
[  2684.272]    compiled for 1.19.6, module version = 1.19.6
[  2684.272]    Module class: X.Org Video Driver
[  2684.272]    ABI class: X.Org Video Driver, version 23.0
[  2684.272] (II) LoadModule: "fbdev"
[  2684.272] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[  2684.272] (II) Module fbdev: vendor="X.Org Foundation"
[  2684.272]    compiled for 1.19.3, module version = 0.4.4
[  2684.272]    Module class: X.Org Video Driver
[  2684.272]    ABI class: X.Org Video Driver, version 23.0
[  2684.272] (II) LoadModule: "vesa"
[  2684.272] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[  2684.273] (II) Module vesa: vendor="X.Org Foundation"
[  2684.273]    compiled for 1.19.3, module version = 2.3.4
[  2684.273]    Module class: X.Org Video Driver
[  2684.273]    ABI class: X.Org Video Driver, version 23.0
[  2684.273] (II) NOUVEAU driver Date:   Fri Apr 21 14:41:17 2017 -0400
[  2684.273] (II) NOUVEAU driver for NVIDIA chipset families :
[  2684.273]    RIVA TNT        (NV04)
[  2684.273]    RIVA TNT2       (NV05)
[  2684.273]    GeForce 256     (NV10)
[  2684.273]    GeForce 2       (NV11, NV15)
[  2684.273]    GeForce 4MX     (NV17, NV18)
[  2684.273]    GeForce 3       (NV20)
[  2684.273]    GeForce 4Ti     (NV25, NV28)
[  2684.273]    GeForce FX      (NV3x)
[  2684.273]    GeForce 6       (NV4x)
[  2684.273]    GeForce 7       (G7x)
[  2684.273]    GeForce 8       (G8x)
[  2684.273]    GeForce GTX 200 (NVA0)
[  2684.273]    GeForce GTX 400 (NVC0)
[  2684.273] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  2684.273] (II) FBDEV: driver for framebuffer: fbdev
[  2684.273] (II) VESA: driver for VESA chipsets: vesa
[  2684.273] xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
[  2684.391] (EE) [drm] Failed to open DRM device for pci:0000:01:00.0: -19
[  2684.391] (WW) Falling back to old probe method for modesetting
[  2684.391] (II) modeset(1): using default device
[  2684.391] (II) Loading sub module "fbdevhw"
[  2684.391] (II) LoadModule: "fbdevhw"
[  2684.391] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[  2684.391] (II) Module fbdevhw: vendor="X.Org Foundation"
[  2684.391]    compiled for 1.19.6, module version = 0.0.2
[  2684.392]    ABI class: X.Org Video Driver, version 23.0
[  2684.392] (EE) open /dev/fb0: Permission denied
[  2684.392] (WW) Falling back to old probe method for fbdev
[  2684.392] (II) Loading sub module "fbdevhw"
[  2684.392] (II) LoadModule: "fbdevhw"
[  2684.392] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[  2684.392] (II) Module fbdevhw: vendor="X.Org Foundation"
[  2684.392]    compiled for 1.19.6, module version = 0.0.2
[  2684.392]    ABI class: X.Org Video Driver, version 23.0
[  2684.392] (EE) open /dev/fb0: Permission denied
[  2684.392] vesa: Ignoring device with a bound kernel driver
[  2684.392] (WW) Falling back to old probe method for vesa
[  2684.392] (II) modeset(G0): using drv /dev/dri/card0
[  2684.392] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[  2684.392] (EE) Screen 0 deleted because of no matching config section.
[  2684.392] (II) UnloadModule: "modesetting"
[  2684.392] (EE) Screen 1 deleted because of no matching config section.
[  2684.392] (II) UnloadModule: "fbdev"
[  2684.392] (II) UnloadSubModule: "fbdevhw"
[  2684.392] (EE) Screen 1 deleted because of no matching config section.
[  2684.392] (II) UnloadModule: "vesa"
[  2684.392] (EE)
Fatal server error:
[  2684.392] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[  2684.392] (EE)
[  2684.392] (EE)
Please consult the The X.Org Foundation support
    at http://wiki.x.org
for help.
[  2684.392] (EE) Please also check the log file at "/home/$USER/.local/share/xorg/Xorg.0.log" for additional information.
[  2684.392] (EE)
[  2684.423] (EE) Server terminated with error (1). Closing log file.

답변1

어쨌든 Xorg는 NVIDIA 카드를 사용하려고 하는 것 같습니다. 시도해 보았 니어떤 GPU Xorg를 사용해야 하는지 지정?

vfio_pci를 활성화한 후 X가 시작되지 않습니다.

이는 호스트 GPU가 보조 GPU로 감지되어 X가 게스트 GPU용 드라이버를 로드하려고 할 때 실패/충돌하는 것과 관련이 있습니다. 이를 방지하려면 호스트 GPU의 BusID를 지정하는 Xorg 구성 파일이 필요합니다. 올바른 BusID는 lspci 또는 Xorg 로그에서 얻을 수 있습니다.출처 →

/etc/X11/xorg.conf.d/10-intel.conf

Section "Device"
        Identifier "Intel GPU"
        Driver "modesetting"
        BusID  "PCI:0:2:0"
EndSection

xorg.conf.d아직 존재하지 않는 경우 간단히 생성하십시오.

그 후에는 Xorg가 더 이상 NVIDIA 그래픽 카드를 사용하려고 시도해서는 안 됩니다. Arch Wiki 페이지에는 앞으로 진행하면서 흥미로울 수 있는 다른 문제가 나열되어 있습니다.

답변2

데스크톱 컴퓨터에 두 번째 NVIDIA GPU를 설치한 후 관련 문제가 발생했습니다. 부팅을 시도할 때 로그에는 gdm(Gnome Display Manager 3)이 시작되었다고 표시되지만 왼쪽 상단에서 깜박이는 커서만 보였습니다.

허용된 답변에서 @Daniel B가 언급했듯이 수정 사항은 Xorg 구성 파일과 관련이 있습니다. NVIDIA 유틸리티를 사용하여 올바른 구성 파일을 생성할 수 있었습니다.

  1. 실행 레벨 3으로 부팅(그래픽 부팅이 실패할 때 터미널 가져오기 허용): e부트로더 화면에서 키를 누른 다음 3줄 끝에 을 추가 linuxefi하고 로 부팅을 시작합니다 ctrl + x.
  2. 표준 사용자 이름과 비밀번호로 로그인하세요.
  3. 기존 Xorg 구성을 백업합니다.sudo cp -r /etc/X11/xorg.conf.d /etc/X11/xorg.conf.d.bak
  4. NVIDIA 도구를 사용하여 새로운 Xorg 구성을 만듭니다.sudo nvidia-xconfig -a
  5. 새 구성 파일이 올바른 위치에 배치되지 않았을 수 있습니다. 또는 이와 유사한 파일이 있는 경우 /etc/X11/xorg.conf.d/10-nvidia.conf백업되었는지 확인한 다음 새 구성 파일을 복사하세요. sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.d/10-nvidia.conf (Fedora 29에서는 이 작업을 수행해야 했습니다.)
  6. 재부팅:sudo reboot

위의 경로는 Fedora 29에 해당하며 배포판에서 해당 구성 파일을 저장하는 위치에 따라 조정해야 할 수도 있습니다.

관련 정보