Update: Have successfully passed it through and installed Intel drivers! (Be careful to use an unused address for slot in <address>!)

Is auto resolution somehow still supported like with QXL? Currently I cannot even use the mouse because I can't hit the buttons. How you solved this?

Regards,
Richard

2017-09-04 0:09 GMT+02:00 Richard Lagler <rilagler@gmail.com>:
Update: I upgraded to libvirt 3.6 what enabled mdev finding with virsh nodedev-list --tree. (it should be available since libvirt 3.4, I had 3.2) One more step done!

However, I still can't assign the vgpu neither per virt-manager's xml nor the qemu file (.sh) according to Github Docu.

If the xml section is inserted, the VM disappears from virt-manager. Doesn't mind if I take Alex' or Kraxel syntax.
With qemu config file nothing appears in Windows device manager without an error.

Help is very much appreciated!
Kind Regards,
Richard

2017-09-03 20:24 GMT+02:00 Richard Lagler <rilagler@gmail.com>:
My vfio-pci becomes not auto-loaded, it is a parameter for the qemu/libvirt config file, but nowhere it docu is stated the module needs to be loaded?

Tried also Kraxel's docu from his blog, https://www.kraxel.org/blog/2017/01/virtual-gpu-support-landing-upstream/, without success:

"First, we must allow qemu access /dev. By default libvirt uses control groups to restrict access. That must be turned off. Edit /etc/libvirt/qemu.conf. Uncomment the cgroup_controllers line. Remove "devices" from the list. Restart libvirtd.

Second, we must allow qemu access the iommu group (10 in my case). A simple chmod will do:"


kraxel@broadwell ~# chmod 666 /dev/vfio/10


<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  [ ... ]
  <currentMemory unit='KiB'>1048576</currentMemory>
  <memoryBacking>
    <locked/>
  </memoryBacking>
  [ ... ]
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,addr=05.0,sysfsdev=/sys/class/mdev_bus/0000:00:02.0/f321853c-c584-4a6b-b99a-3eee22a3919c'/>
  </qemu:commandline>
</domain>

2017-09-03 16:36 GMT+02:00 Richard Lagler <rilagler@gmail.com>:
Hi,

I echo the UUID in terminal 1, here I don't get an error when creating the vgpu.

lenovo-yoga /etc/libvirt/qemu # ls -l /sys/bus/pci/devices/0000\:00\:02.0/30b480da-7f3f-486c-b056-c4de16796a12/
insgesamt 0
lrwxrwxrwx 1 root root    0  3. Sep 16:24 driver -> ../../../../bus/mdev/drivers/vfio_mdev
drwxr-xr-x 2 root root    0  3. Sep 16:25 intel_vgpu
lrwxrwxrwx 1 root root    0  3. Sep 16:25 iommu_group -> ../../../../kernel/iommu_groups/0
lrwxrwxrwx 1 root root    0  3. Sep 16:25 mdev_type -> ../mdev_supported_types/i915-GVTg_V5_4
drwxr-xr-x 2 root root    0  3. Sep 16:25 power
--w------- 1 root root 4096  3. Sep 16:25 remove
lrwxrwxrwx 1 root root    0  3. Sep 16:24 subsystem -> ../../../../bus/mdev
-rw-r--r-- 1 root root 4096  3. Sep 16:24 uevent

But virish doesn't find it and also Windows doesn't see the new gpu.

lenovo-yoga /etc/libvirt/qemu # virsh nodedev-list --tree
computer
  |
     ....
  +- pci_0000_00_02_0
  |   |
  |   +- drm_card0
  |   +- drm_renderD128
  |    
      ....


What could be missing?




2017-09-03 15:28 GMT+02:00 Alex Williamson <alex.williamson@redhat.com>:
On Sun, 3 Sep 2017 12:07:56 +0200
Richard Lagler <rilagler@gmail.com> wrote:

> Hi,
>
> I successfully loaded the modules at initramfs by creating an own
> module-setup.sh in /usr/lib/dracut/modules.d/00gvt
> #!/bin/sh
>
> installkernel() {
>         instmods kvmgt
>         instmods vfio-iommu-type1
>         instmods vfio-mdev
> }
>
> Now an mdev-supported-types appears in /sys/bus/pci/devices/0000:00:02.0.
> However, I cannot echo the uuid to "create" in the i915-GVTg_V5_4 folder
> due to a disk full error.
>
> Permissions are:
> lenovo-yoga
> /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4 # ls
> -la
> insgesamt 0
> drwxr-xr-x 3 root root    0  3. Sep 12:02 .
> drwxr-xr-x 4 root root    0  3. Sep 11:58 ..
> -r--r--r-- 1 root root 4096  3. Sep 12:02 available_instances
> --w------- 1 root root 4096  3. Sep 12:02 create
> -r--r--r-- 1 root root 4096  3. Sep 12:02 description
> -r--r--r-- 1 root root 4096  3. Sep 12:02 device_api
> drwxr-xr-x 2 root root    0  3. Sep 12:02 devices
>
> I can chmod +755 to create, then I can successfully echo the UUID and the
> folder is created at ../0000:00:02.0. However, it only remains there until
> the next reboot what causes the UUID folder to disappear again.

vGPUs are of course not persistent across reboots.

> Finally, does someone know how to add the device in virt-manager xml
> config? I tried some parsing utilities and by adding the pci device in gui
> and added the <uuid> </uuid> flag but it causes my notebook monitor to turn
> off when I start the machine.

Syntax looks like this:

    <hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci'>
      <source>
        <address uuid='6d9f3fa0-47a7-4f0e-b6ba-2ea2b0722cbc'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </hostdev>

Thanks,

Alex