Ubuntu 16.04.1을 실행하는 Dell XPS 15 9550 노트북이 있습니다. GPU 패스스루가 있는 KVM 가상 머신을 설정하려고 합니다. 여기서 가상 머신은 NVIDIA GeForce GTX 960M을 사용하고 호스트는 Intel 통합 그래픽을 사용합니다.
pci-stub 및 vfio-pci를 사용하여 설정을 시도했지만 두 경우 모두 iommu 그룹을 가져올 수 없습니다.
01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 960M] [10de:139b] (rev a2)
Subsystem: Dell GM107M [GeForce GTX 960M] [1028:06e4]
Kernel driver in use: nouveau
Kernel modules: nvidiafb, nouveau
Grub 설정에 intel_iommu=on을 추가했습니다. /etc/modules 파일에 다음을 추가했습니다.
vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel
내 그래픽 카드가 어떤 iommu 그룹에 속해 있는지, 같은 그룹에 어떤 다른 장치가 있는지 확인했습니다.
00:00.0 Host bridge [0600]: Intel Corporation Sky Lake Host Bridge/DRAM Registers [8086:1910] (rev 07)
Subsystem: Dell Skylake Host Bridge/DRAM Registers [1028:06e4]
00:01.0 PCI bridge [0604]: Intel Corporation Sky Lake PCIe Controller (x16) [8086:1901] (rev 07)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:02.0 VGA compatible controller [0300]: Intel Corporation Skylake Integrated Graphics [8086:191b] (rev 06)
DeviceName: Onboard IGD
Subsystem: Dell Skylake Integrated Graphics [1028:06e4]
Kernel driver in use: i915_bpo
Kernel modules: i915_bpo
00:04.0 Signal processing controller [1180]: Intel Corporation Skylake Processor Thermal Subsystem [8086:1903] (rev 07)
Subsystem: Dell Skylake Processor Thermal Subsystem [1028:06e4]
Kernel driver in use: proc_thermal
Kernel modules: processor_thermal_device
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
Subsystem: Dell Sunrise Point-H USB 3.0 xHCI Controller [1028:06e4]
Kernel driver in use: xhci_hcd
00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131] (rev 31)
Subsystem: Dell Sunrise Point-H Thermal subsystem [1028:06e4]
00:15.0 Signal processing controller [1180]: Intel Corporation Sunrise Point-H LPSS I2C Controller #0 [8086:a160] (rev 31)
Subsystem: Dell Sunrise Point-H Serial IO I2C Controller [1028:06e4]
Kernel driver in use: intel-lpss
Kernel modules: intel_lpss_pci
00:15.1 Signal processing controller [1180]: Intel Corporation Sunrise Point-H LPSS I2C Controller #1 [8086:a161] (rev 31)
Subsystem: Dell Sunrise Point-H Serial IO I2C Controller [1028:06e4]
Kernel driver in use: intel-lpss
Kernel modules: intel_lpss_pci
00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
Subsystem: Dell Sunrise Point-H CSME HECI [1028:06e4]
Kernel driver in use: mei_me
Kernel modules: mei_me
00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] [8086:a103] (rev 31)
Subsystem: Dell Sunrise Point-H SATA Controller [AHCI mode] [1028:06e4]
Kernel driver in use: ahci
Kernel modules: ahci
00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #1 [8086:a110] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1c.1 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #2 [8086:a111] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1d.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #13 [8086:a11c] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1d.6 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #15 [8086:a11e] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a14e] (rev 31)
Subsystem: Dell Sunrise Point-H LPC Controller [1028:06e4]
00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
Subsystem: Dell Sunrise Point-H PMC [1028:06e4]
00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
Subsystem: Dell Sunrise Point-H HD Audio [1028:06e4]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
Subsystem: Dell Sunrise Point-H SMBus [1028:06e4]
Kernel modules: i2c_i801
01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 960M] [10de:139b] (rev a2)
Subsystem: Dell GM107M [GeForce GTX 960M] [1028:06e4]
Kernel driver in use: nouveau
Kernel modules: nvidiafb, nouveau
02:00.0 Network controller [0280]: Broadcom Corporation BCM43602 802.11ac Wireless LAN SoC [14e4:43ba] (rev 01)
Subsystem: Dell BCM43602 802.11ac Wireless LAN SoC [1028:0020]
Kernel driver in use: brcmfmac
Kernel modules: brcmfmac
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
Subsystem: Dell RTS525A PCI Express Card Reader [1028:06e4]
Kernel driver in use: rtsx_pci
Kernel modules: rtsx_pci
04:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller [144d:a802] (rev 01)
Subsystem: Samsung Electronics Co Ltd NVMe SSD Controller [144d:a801]
Kernel driver in use: nvme
Kernel modules: nvme
$ find /sys/kernel/iommu_groups/ -type l
/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/2/devices/0000:00:02.0
/sys/kernel/iommu_groups/3/devices/0000:00:04.0
/sys/kernel/iommu_groups/4/devices/0000:00:14.0
/sys/kernel/iommu_groups/4/devices/0000:00:14.2
/sys/kernel/iommu_groups/5/devices/0000:00:15.0
/sys/kernel/iommu_groups/5/devices/0000:00:15.1
/sys/kernel/iommu_groups/6/devices/0000:00:16.0
/sys/kernel/iommu_groups/7/devices/0000:00:17.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.1
/sys/kernel/iommu_groups/8/devices/0000:02:00.0
/sys/kernel/iommu_groups/8/devices/0000:03:00.0
/sys/kernel/iommu_groups/9/devices/0000:00:1d.0
/sys/kernel/iommu_groups/9/devices/0000:00:1d.4
/sys/kernel/iommu_groups/9/devices/0000:00:1d.6
/sys/kernel/iommu_groups/9/devices/0000:04:00.0
/sys/kernel/iommu_groups/10/devices/0000:00:1f.0
/sys/kernel/iommu_groups/10/devices/0000:00:1f.2
/sys/kernel/iommu_groups/10/devices/0000:00:1f.3
/sys/kernel/iommu_groups/10/devices/0000:00:1f.4
내 NVIDIA GeForce GTX 960M [10de:139b]는 Intel Sky Lake PCIe 컨트롤러(x16) [8086:1901]와 마찬가지로 그룹 1에 속합니다. 그래서 /etc/modprobe.d/vfio-pci.conf 파일을 만들고 다음 두 ID를 추가했습니다.
options vfio-pci ids=10de:139b,8086:1901
sudo update-initramfs -u
재부팅 후 NVidia 카드에서 사용하는 커널 드라이버가 vfio-pci인지 확인했습니다. 그러나 위에서 언급했듯이 이는 사실이 아닙니다. 그러나 시스템 로그를 확인하면 두 장치가 모두 추가된 것으로 표시됩니다.
systemd-modules-load[1189]: Inserted module 'vfio'
systemd-modules-load[1189]: Inserted module 'vfio_iommu_type1'
systemd-modules-load[1189]: Inserted module 'vfio_pci'
kernel: [ 8.662599] vfio_pci: add [10de:139b[ffff:ffff]] class 0x000000/00000000
kernel: [ 8.662602] vfio_pci: add [8086:1901[ffff:ffff]] class 0x000000/00000000
systemd-modules-load[1199]: Inserted module 'vfio'
systemd-modules-load[1199]: Inserted module 'vfio_iommu_type1'
systemd-modules-load[1199]: Inserted module 'vfio_pci'
kernel: [ 8.344978] vfio_pci: add [10de:139b[ffff:ffff]] class 0x000000/00000000
kernel: [ 8.344981] vfio_pci: add [8086:1901[ffff:ffff]] class 0x000000/00000000
systemd-modules-load[1202]: Inserted module 'vfio'
systemd-modules-load[1202]: Inserted module 'vfio_iommu_type1'
systemd-modules-load[1202]: Inserted module 'vfio_pci'
kernel: [ 8.336405] vfio_pci: add [10de:139b[ffff:ffff]] class 0x000000/00000000
kernel: [ 8.336409] vfio_pci: add [8086:1901[ffff:ffff]] class 0x000000/00000000
systemd-modules-load[1202]: Inserted module 'vfio'
systemd-modules-load[1202]: Inserted module 'vfio_iommu_type1'
systemd-modules-load[1202]: Inserted module 'vfio_pci'
kernel: [ 8.454811] vfio_pci: add [10de:139b[ffff:ffff]] class 0x000000/00000000
kernel: [ 8.454814] vfio_pci: add [1028:06e4[ffff:ffff]] class 0x000000/00000000
kernel: [ 8.454816] vfio_pci: add [8086:1901[ffff:ffff]] class 0x000000/00000000
vfio-pci 드라이버가 그래픽 카드를 얻을 수 없는 이유는 무엇입니까?
답변1
모듈을 /etc/initramfs-tools/modules에 넣어 문제를 해결했습니다. 이제 nouveau가 GPU를 점유한 후에 vfio-pci가 로드되기 때문입니다.