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