O GPU Passthrough com vfio-pci ainda usa o driver nouveau [closed]

3

Eu tenho um laptop Dell XPS 15 9550 rodando o Ubuntu 16.04.1. Estou tentando configurar uma máquina virtual KVM com passagem de GPU na qual a NVIDIA GeForce GTX 960M é usada pela VM e a Intel Integrated Graphics é usada pela máquina host.

Eu tentei configurá-lo usando pci-stub e vfio-pci, mas em ambos os casos ele não consegue obter o grupo 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

Eu adicionei intel_iommu = on às configurações do Grub. Eu adicionei o seguinte ao arquivo / etc / modules.

vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel

Eu verifiquei em qual grupo iommu minha placa de vídeo está e quais outros dispositivos estão no mesmo grupo:

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

Minha NVIDIA GeForce GTX 960M [10de: 139b] está no grupo 1, assim como o Controlador PCIe Sky Lake da Intel Corporation (x16) [8086: 1901]. Então criei um arquivo /etc/modprobe.d/vfio-pci.conf e adicionei os ids destes dois:

options vfio-pci ids=10de:139b,8086:1901
sudo update-initramfs -u

Após a reinicialização, verifiquei se o driver do kernel em uso para a placa NVidia é vfio-pci. No entanto, como mencionado, este não é o caso. Quando eu verifiquei o syslog, no entanto, vejo que os dois dispositivos foram adicionados.

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

Por que o driver vfio-pci não consegue obter a placa de vídeo?

    
por user3197231 27.08.2016 / 23:37

1 resposta

1

Eu resolvi colocando módulos em / etc / initramfs-tools / modules. Porque agora o vfio-pci carrega após o nouveau já ter reivindicado GPU.

    
por 28.08.2016 / 22:03