I
I
Interface2017-08-19 23:47:09
linux
Interface, 2017-08-19 23:47:09

What could be the problem with video card forwarding?

Good afternoon!
There was a desire to make a virtual machine with video card forwarding (qemu + kvm).
Focused mainly on this guide: https://davidyat.es/2016/09/08/gpu-passthrough/
Available:

Iron

- cpu: Intel(R) Core(TM) i5-3470S CPU @ 2.90GHz
- одна (!) дискретная видеокарта: GeForce GTX 650 Ti
- материнская плата: Gigabyte Z77-D3H
Soft

- Хост ОС: xubuntu 17.04 (такая же картина была на 16.04)
- В dual-boot'е (grub) - Windows 7
- Qemu 2.8.0
- virsh 2.5.0
- virt-manager 1.3.2
How the host is prepared

Для проброса меняю 4 файла:
/etc/modprobe.d/blacklist.conf: (закоменчиваю / раскоменчиваю строки добавленные в конец файла)
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

/etc/modules: (закоменчиваю / раскоменчиваю строки добавленные в конец файла)
vfio
vfio_iommu_type1
vfio_pci
vhost-net

/etc/initramfs-tools/modules: (закоменчиваю / раскоменчиваю строки добавленные в конец файла)
pci-stub
/etc/default/grub: (меняется параметр GRUB_CMDLINE_LINUX_DEFAULT)
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on pci-stub.ids=10de:11c6,10de:0e0b"

После изменений:
update-initramfs -u
update-grub

и reboot

The system boots, the screen is black (after GRUB'a) is available via SSH. dmesg
output | grep pci-stub :
dmesg | grep pci-stub
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.10.0-32-generic root=UUID=584687ef-ebd7-4208-9e79-5ab3dfcf7266 ro quiet splash intel_iommu=on pci-stub.ids=10de:11c6,10de:0e0b vt.handoff=7
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.10.0-32-generic root=UUID=584687ef-ebd7-4208-9e79-5ab3dfcf7266 ro quiet splash intel_iommu=on pci-stub.ids=10de:11c6,10de:0e0b vt.handoff=7
[    1.640890] pci-stub: add 10DE:11C6 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.640901] pci-stub 0000:01:00.0: claimed by stub
[    1.640908] pci-stub: add 10DE:0E0B sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.640912] pci-stub 0000:01:00.1: claimed by stub

which, due to the presence of "claimed by stub" - inspires hope that the card is successfully untied from the host system.
Virtual machine preparation

Виртуалку создавал через virt-manager (gui), из настроек:
- UEFI;
- Проброс PCI устройств 01:00.0 и 01:00.1 также через GUI;
- chipset: i440FX
Помимо этого через virsh edit было добавлено:
<features>
    ...
    <hyperv>
      <vendor_id state='on' value='whatever'/>
    </hyperv>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>


As a result, after a reboot, I go via SSH (there is no second monitor and a second discrete card :( ) to the host, I start the virtual machine there through virsh start <name>, which leads (as far as I can tell) to a system crash (ssh in the terminal stops showing signs of life, the host does not ping, there
is a file /var/crash/_usr_bin_qemu-system-x86_64.64055.crash on the host (in which I cannot see the cause of the problem)). the cause of the fail (and how to figure it out from this log)?
UPDATE:
At the time of writing the question has not yet dealt with the integrated GPU. (It did not start out of the box) As a result, after installing the Intel drivers, I was able to connect the monitor to the built-in video card. But a nuance arose: with a forwarded discrete video card (when the lines are uncommented), the built-in one does not work. I determined at random that it was related to /etc/modprobe.d/blacklist.conf, if you leave it in its original form, then the built-in GPU works, but dmesg | grep pci-stubonly 01:00.1 remains (which, as I understand it, is the sound in a discrete video card).
Forwarding to the virtual machine still does not work. What does it have to do with it when I tried to start the virtual machine, I saw how everything broke down: after entering the command (virsh start), the system hung (only the cursor responded) - so it does not carry much information (considering that the configuration is somewhat different). Perhaps not all the necessary drivers are blacklisted?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2018-03-29
@rPman

Almost everyone has problems with one video card, and even when the system starts up, upon completion of work, the host system will hang completely (in fact, no one is safe from this even with two video cards)
find yourself another card, at least an ancient pci;) really everything will be simplified

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question