3

I have a Dell XPS 15 9550 laptop running Ubuntu 16.04.1. I am trying to setup a KVM virtual machine with GPU passthrough in which the NVIDIA GeForce GTX 960M is used by the VM and the Intel Integrated Graphics is used by the host machine.

I tried setting it up using both pci-stub and vfio-pci, however in both cases it fails to obtain the iommu group:

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

I added intel_iommu=on to the Grub settings. I added the following to the /etc/modules file.

vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel

I checked in which iommu group my video card is and which other devices are in the same group:

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

My NVIDIA GeForce GTX 960M [10de:139b] is in group 1 as is the Intel Corporation Sky Lake PCIe Controller (x16) [8086:1901]. So I created a file /etc/modprobe.d/vfio-pci.conf and added the ids of these two:

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

After a reboot, I checked if the kernel driver in use for the NVidia card is vfio-pci. However, as mentioned, this is not the case. When I checked the syslog however, I do see that the two devices are added.

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

Why does the vfio-pci driver fail to obtain the video card?

closed as off-topic by Jeff Schaller, Stephen Rauch, Satō Katsura, GAD3R, Rui F Ribeiro Sep 2 '17 at 17:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, Stephen Rauch, Satō Katsura, GAD3R, Rui F Ribeiro
If this question can be reworded to fit the rules in the help center, please edit the question.

1

I solved it by putting modules in /etc/initramfs-tools/modules. Because right now vfio-pci loads after nouveau already claimed GPU.

  • Please explain. Exactly what files did you change/add? And what did you add to them? – twoLeftFeet Apr 27 at 4:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.