T-vK / MobilePassThrough

Make GPU passthrough on notebooks easy and accessible!
170 stars 19 forks source link

qemu error "Group 1 is not viable" #10

Open krumlo opened 3 years ago

krumlo commented 3 years ago

When running start_vm.sh (Fedora 30) I get:

> Loading config from /home/d/MobilePassThrough/user.conf
> Using a virtual OS drive...
> Bumblebee works fine on this system. Using optirun when necessary...
> Retrieving and parsing DGPU IDs...
39b9
> Loading vfio-pci kernel module...
> Using Looking Glass...
> Calculating required buffer size for 1920x1080 for Looking Glass...
> Looking Glass buffer size set to: 32M
> Starting IVSHMEM server...
*** Example code, do not use in production ***
> Adjusting permissons for the IVSHMEM server socket...
> Not using DGPU vBIOS override...
> Not using SMB share...
> Using dGPU passthrough...
> Unbinding dGPU from nvidia driver...
> 0000:01:00.0
0000:01:00.0 /sys/bus/pci/devices/0000:01:00.0/driver/unbind
> Binding dGPU to VFIO driver...
> Not using mediated iGPU passthrough...
> Using spice on port 5900...
> Using QXL...
> Not using USB passthrough...
> Using virtual input method 'usb-tablet' for keyboard/mouse input...
> Starting the Virtual Machine...
0+1 records in
0+1 records out
2 bytes copied, 4.0757e-05 s, 49.1 kB/s
QEMU 3.1.1 monitor - type 'help' for more information
(qemu) qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,x-pci-sub-device-id=0x39b9,x-pci-sub-vendor-id=0x17aa,multifunction=on: vfio 0000:01:00.0: group 1 is not viable
Please ensure all devices within the iommu_group are bound to their vfio bus driver.
DNSMASQ terminated
0+1 records in
0+1 records out
2 bytes copied, 6.2173e-05 s, 32.2 kB/s
ip_forward disabled
> Binding dGPU back to nvidia driver...

Where I see it fail in start_vm is whilst trying to unbind the dGPU. In /sys/bus/devices/0000:01:00.0/ there is no driver folder, and therefore no unbind file. driver/unbind is however present for the iGPU.

lspci -nnv output might be giving a clue as to why this is:

00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04) (prog-if 00 [VGA controller])
    Subsystem: Lenovo Device [17aa:39b9]
    Flags: bus master, fast devsel, latency 0, IRQ 130
    Memory at a2000000 (64-bit, non-prefetchable) [size=16M]
    Memory at b0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 6000 [size=64]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: i915

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] [10de:1c20] (rev ff) (prog-if ff)
    !!! Unknown header type 7f
    Kernel modules: nouveau, nvidia_drm, nvidia

lshw -c video output only shows the iGPU:

  *-display                 
       description: VGA compatible controller
       product: HD Graphics 630
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:130 memory:a2000000-a2ffffff memory:b0000000-bfffffff ioport:6000(size=64) memory:c0000-dffff

lsiommu output:

IOMMU Group 0 00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:5910] (rev 05)
IOMMU Group 10 02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821AE 802.11ac PCIe Wireless Network Adapter [10ec:8821]
IOMMU Group 11 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 10)
IOMMU Group 12 04:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961 [144d:a804]
IOMMU Group 1 00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 05)
IOMMU Group 1 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] [10de:1c20] (rev ff)
IOMMU Group 1 01:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev ff)
IOMMU Group 2 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04)
IOMMU Group 3 00:14.0 USB controller [0c03]: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller [8086:a12f] (rev 31)
IOMMU Group 3 00:14.2 Signal processing controller [1180]: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem [8086:a131] (rev 31)
IOMMU Group 4 00:16.0 Communication controller [0780]: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 [8086:a13a] (rev 31)
IOMMU Group 5 00:17.0 SATA controller [0106]: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] [8086:a103] (rev 31)
IOMMU Group 6 00:1c.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #3 [8086:a112] (rev f1)
IOMMU Group 7 00:1c.3 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #4 [8086:a113] (rev f1)
IOMMU Group 8 00:1d.0 PCI bridge [0604]: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 [8086:a118] (rev f1)
IOMMU Group 9 00:1f.0 ISA bridge [0601]: Intel Corporation HM175 Chipset LPC/eSPI Controller [8086:a152] (rev 31)
IOMMU Group 9 00:1f.2 Memory controller [0580]: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller [8086:a121] (rev 31)
IOMMU Group 9 00:1f.3 Audio device [0403]: Intel Corporation CM238 HD Audio Controller [8086:a171] (rev 31)
IOMMU Group 9 00:1f.4 SMBus [0c05]: Intel Corporation 100 Series/C230 Series Chipset Family SMBus [8086:a123] (rev 31)

Compatibility check:

[OK] VT-X / AMD-V virtualization is enabled in the UEFI.
[OK] VT-D / IOMMU is enabled in the UEFI.
[OK] The IOMMU kernel parameters are set.
[Success] GPU with ID '01:00.0' could be passed through to a virtual machine!
[Success] GPU with ID '00:02.0' could be passed through to a virtual machine!
[Success] There are 2 GPU(s) in this system that could be passed through to a VM!

Is Compatible?  Name                              IOMMU_GROUP  PCI Address
Yes             GP106M [GeForce GTX 1060 Mobile]  1            pci@0000:01:00.0
Yes             HD Graphics 630                   2            pci@0000:00:02.0

[OK] You have GPUs that are not in the same IOMMU group. At least one of these could be passed through to a VM and at least one of the remaining ones could be used for the host system.
[Info] Device name: 80YY
[Info] BIOS version: 5XCN22WW
[OK] This system is probably MUXed. (The connection between the GPU(s) and the [internal display]/[display outputs] is multiplexed.)
T-vK commented 3 years ago

I haven't worked on this project in a while, maybe something changed. Maybe there is something in this thread that would help: https://forum.level1techs.com/t/need-help-with-dynamically-binding-and-un-binding-nvidia-gpu/154278/5

Also, you wrote the driver folder is not in /sys/bus/devices/.../

but shouldn't you look in /sys/bus/pci/devices/.../ instead?