[SOLVED] GPU Passthrough with virt-manager problems

If none of the more specific forums is the right place to ask

[SOLVED] GPU Passthrough with virt-manager problems

Postby TopKek » 2017-12-31 04:32

Hello,

I've been following this guide on GPU Passthrough with virt-manager. Following this guide with:
i5 4590 (Yes it supports VT-d)
8GB RAM
GTX 750ti (Guest)
HD4600 (Host)
Debian Testing (Host)
Windows 10 Pro (Guest)

All goes well and I can boot and install windows inside the VM. Windows detects the GPU and the drivers load correctly.
Code: Select all
dmesg | grep -e "Directed I/O"
[    0.443606] DMAR: Intel(R) Virtualization Technology for Directed I/O


Code: Select all
lsmod | grep vfio
vfio_pci               45056  0
vfio_virqfd            16384  1 vfio_pci
irqbypass              16384  2 kvm,vfio_pci
vfio_iommu_type1       24576  0
vfio                   28672  2 vfio_iommu_type1,vfio_pci


Code: Select all
dmesg | grep pci-stub
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.14.0-2-amd64 root=UUID=3390b79b-49fa-43d2-a932-33f9ad80ea51 ro quiet pci-stub.ids=10de:1380,10de:0fbc modprobe.blacklist=nouveau intel_iommu=on
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.14.0-2-amd64 root=UUID=3390b79b-49fa-43d2-a932-33f9ad80ea51 ro quiet pci-stub.ids=10de:1380,10de:0fbc modprobe.blacklist=nouveau intel_iommu=on
[    1.389557] pci-stub: add 10DE:1380 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.389568] pci-stub 0000:01:00.0: claimed by stub
[    1.389579] pci-stub: add 10DE:0FBC sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.389583] pci-stub 0000:01:00.1: claimed by stub


Code: Select all
dmesg | grep VFIO
[    1.765107] VFIO - User Level meta-driver version: 0.3


In my /etc/default/grub:
Code: Select all
GRUB_CMDLINE_LINUX_DEFAULT="quiet pci-stub.ids=10de:1380,10de:0fbc modprobe.blacklist=nouveau intel_iommu=on"


In /etc/modprobe.d/blacklist.conf:
Code: Select all
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off


All appears to be well.
After a reboot however, the VM constantly fails to start. Everything appears the same as before (above) but when I try to start the VM from virt-manager, the host hangs for about 3 minutes then either virt-manager crashes, or I get:
Code: Select all
Error starting domain: internal error: process exited while connecting to monitor

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 125, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 82, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1505, in startup
    self._backend.create()
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1069, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error: process exited while connecting to monitor


After this error/crash, I go to check everything again, and dmesg | grep -e "Directed I/O" returns nothing, lsmod | grep vfio returns the same thing,
Code: Select all
dmesg | grep pci-stub
[10881.313004] pci-stub 0000:01:00.0: claimed by stub
[10881.332998] pci-stub 0000:01:00.1: claimed by stub


dmesg | grep VFIO also returns nothing. /etc/modprobe.d/blacklist.conf and /etc/default/grub are unchanged.

I am passing through both my GPU and it's HDMI audio part to the VM.

If I reboot again, everything returns to normal (dmesg shows Directed I/O again etc.). However the VM still does the same thing. If anyone knows whats happening here and a solution for it, I'd love to hear it...

Thanks
Last edited by TopKek on 2017-12-31 19:20, edited 1 time in total.
TopKek
 
Posts: 5
Joined: 2017-08-10 18:36

Re: GPU Passthrough with virt-manager problems

Postby TopKek » 2017-12-31 19:20

I have solved the issue, the VM now correctly boots after a reboot of the host.

When installing virt-manager and adding your user to the kvm groups, reboot before making the VM.
Also, even though the Debian wiki page on KVM says to add yourself to the kvm group for jessie and older, I found adding your user to the KVM group on buster/testing might have solved the issue (# adduser <youruser> kvm)
TopKek
 
Posts: 5
Joined: 2017-08-10 18:36


Return to General Questions

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable