friendica (DFRN) - Link to source

GPU VIrtualization and Pass through.


I got something super awesome working on my computer tonight. I regularly run Ubuntu Linux, also have arch installed, slowly working on building that environment, and that's where the majority of my work gets done.

But I also like to play a 3D MMORPG called flyff (Flying for Fun), so named because you can fly around the game on various vehicles.

Anyway, prior to tonight to actually play I had to dual boot into windows, which meant I couldn't play between work items or whatever because I would have to boot the computer back and forth.

I had a win10 virtual machine but the virtio drivers only managed about 5fps and a lot of lag between action and display getting updated, not adequate for game play, ok to sell off items in a store or something but not for actual battles and navigation was VERY painful in that mode.

Well, my machine is an i7-9700k based systems, and in addition to the usual vt-x and vt-d virtualization technologies they also have vt-g. What is that? It is a virtualized GPU, actually it allows you to create as many virtual GPUs as you like within the contraints of memory.

I had to build a kernel to support this because the one Ubuntu supplies does not, but that's okay I have a zillion other reasons I build my own kernels anyway.

So once setup, and that was some work, initially I got a black screen, then fixed that but couldn't see boot messages or my cursor and keyboard was super lagged.

I discovered that they had wrapped libvirtd in apparmor and the apparmor profile did not include many of things qemu needed to access to implement virtual gpu's in guests hosts. So since I'm the only one using this machine, I did not feel a need to protect the host from the guest in this manner and simply disabled the profile and now everything works.

It's not QUITE bare metal but it's close enough for decent game play AND qemu and the virtual GPUs work together to share the physical GPU with the host and guest just as the normal emulated display would.

Another reason to love Intel graphics! With any other vendor I would need TWO gpus, one for the host and one for the guest in order to go pass through to the guest. But this let's me share ONE gpu in a way that is very seemless and transparent between the host and guests. Great solution, would be nice if Ubuntu would implement it natively into their network manager, I had to hand code the xml file for the virtual machine because virt-manager didn't know how to do it.