Open ThePraeceps opened 5 years ago
When I use GVT-g with libvirt, I add this to the XML configuration of the virtual machine, in order to add the virtual graphics device to the VM:
<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='off'>
<source>
<address uuid='5bfcd486-c5eb-43e4-a5ee-97366690106f'/>
</source>
<rom bar='off'/>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</hostdev>
Replace 5bfcd486-c5eb-43e4-a5ee-97366690106f
with the actual UUID of your virtual graphics device.
P.S.: You can also (optionally) change <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
if you want your VM to see the vGPU at a particular PCIe slot. You shouldn't have problems if you leave this slot as is in the code above.
I attempted to do that as described in the dma-buf guide, but the latest version of either libvirt or qemu (Documentation says "Since 3.2" so I'm assuming qemu as libvirt is 5.0.0) doesn't support mdev host dev devices so I am unable to do that.
Mmh, I don't quite understand actually. First of all, I forgot to mention that I'm using GVT-g with libvirt 4.5.0
and QEMU 2.12.0
on a CentOS 7.6 computer.
Anyway, I don't see any reasons why your libvirt version shouldn't support this type of device: libvirt documentation says that libvirt supports hostdev
devices of type mdev
and model vfio-pci
since version 4.4.0
. And libvirt changelog doesn't mention changes to that in its 5.x.x
releases.
P.S.: my VM uses Q35 chipset and UEFI bios (OVMF), if it can help.
My only suggestion for now is to try with a live ISO of CentOS 7.6, in order to see if it's a software-related issue only.
Your issue could also somehow depend on the way you created the vGPU or on the way you set up your environment (GVT-g drivers, parameters to pass to Linux during boot, ...).
Interesting, I thought dma-buf doesn't support UEFI. I'm pretty certain that the environment is correct because like I said I can run the QEMU command line version just fine.
I think I'm using I440FX so I'll give q35 a try too.
As you get it working with qemu, but not with libvirt, it might be related to #81.
Hey all,
I've managed to get GVT-g working sucessfully using the following script:
This works as intended and is working fully on my system.
However, if I create what I feel like is a equivelent libvirt XML.
I get the following error:
Despite the file definitely existing and I can boot successfully straight after with QEMU. I'm passing QEMU arguments rather than defining it in XML as the QEMU version I'm running doesn't support the arguments and compiling it from source has caused me issues in the past.
There are not any AppArmor denied logs in /var/log/syslog and even if I disable AppArmor for libvirt it still does not work.
QEMU is configured to use the kvm group and even if I run it under root it still doesn't work.
Does anyone have any ideas?
Version info: