QEMU GPU passthrough with windowed framebuffer on host
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
QEMU GPU passthrough with windowed framebuffer on host
My apologies if this topic would fit better in the Virtualization & Cloud section; it seemed like a better fit here.
I have an odd question that frankly I am not sure where best to ask, so I thought I'd give it a shot here.
For my work, being able to run multiple OSs in KVM VMs with dedicated discreet GPUs would be very convenient. I've done some tinkering with a second video card, QEMU, and macOS (don't worry, this is not a macOS-specific question!).
I have gotten to where I can pass the second GPU through to the VM, and can boot the machine with acceleration to a display connected physically to the second GPU.
My question: is it possible to get the accelerated framebuffer back into the host, e.g. inside the QEMU window in the host?
I'm thinking that the answer may be 'no' for a few reasons, but I hope I am wrong.
Isn't that dependent on the physical GPU/hardware?
Note: I came accross this vGPU functions while looking up sr-iov (different cat) https://wiki.archlinux.org/title/Intel_GVT-g
That's very interesting, thank you. I just so happen to be using a Radeon Pro but it's hard to find information about which models are supported -- some sources say all "Pro" models are. I will definitely be looking into this more.
I think generally the framebuffer, once rendered in the GPU, is not passed back into the host -- it just gets polled over the display cable by the monitor. There are functions in OpenGL, for example, that can copy the buffer back into main memory, but in my experience they are slow.
So that's why I'm wondering, without the use of something like SR-IOV (how does this actually work?) what needs to happen to get that framebuffer back into the host and displayed in the QEMU window.
Note to anybody else reading this -- I am not sure about any of this so take it with a grain of salt.
My question: is it possible to get the accelerated framebuffer back into the host, e.g. inside the QEMU window in the host?
Not sure I understand the question correctly, but, wouldn't that break the principle of the Virtual Machine?
It is however possible for the virtual machine to SHARE things with the host, like for example a filesystem. But in practice with QEMU, that is most easily done with plan9 network file system.
Having done alot of experimentation with GPU passthrough (and failed), albeit not with a second GPU, but sharing the same GPU, I did notice that the principle of the GPU in many cases also works in the same way as sharing. Meaning the way you actually get the screen on a non-GPU-passthrough is basically also over a kind of virtual network video stream. Several of the methods of using a display on a KVM/QEMU VM works in that way, and if I don't remember incorrect Looking Glass being one of them.
So, in theory, it should (maybe) be possible to stream back /dev/fb0 to the host in such a way, or something similar.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.