Page 1 of 1

State of PCIe/GPU passthrough

Posted: 2. Jul 2017, 05:47
by imrazor
I've been trying to use Proxmox to create some VMs for educational and entertainment purposes. While I do have GPU passthrough working with KVM, I'm having a lot of issues with audio, both passed through and emulated sound hardware. Which brings me to VirtualBox.

Has anyone here actually gotten the experimental GPU passthrough working in Virtualbox on a Linux host? How difficult was it to configure? Did you have to make any compromises in terms of guest performance or functionality?

Finally, can I run Virtualbox and use passthrough on an existing Debian Jessie Proxmox install? I realize that having a type 1 and type 2 hypervisor running at the same time is supposed to be impossible, but I'm hoping to avoid a reinstall.

Re: State of PCIe/GPU passthrough

Posted: 2. Jul 2017, 12:32
by mpack
If you have a VT-d host PC, a Linux host OS with the right kernel, and a second graphics card then yes, a handful of people have managed to get this working. But frankly, IMHO anyone trying to use a VM to talk to physical hardware is unlikely to enjoy the experience.

Any reason why you can't just enable 3D acceleration for normal virtually accelerated graphics?

Re: State of PCIe/GPU passthrough

Posted: 2. Jul 2017, 19:30
by imrazor
mpack wrote:Any reason why you can't just enable 3D acceleration for normal virtually accelerated graphics?
That's actually a good question. I'm wanting to learn more about Windows Server and Linux, so having a virtualized box is one way to avoid having 4 or 5 separate PCs around my office. With GPU passthrough, I can also consolidate Windows gaming/entertainment into one PC, keep Linux as my primary OS, and cut down on power use and heat generation. I also like a challenge, but this is getting a little old.

Proxmox includes a 4.4 kernel in their repo with numerous virtualization features enabled, like IOMMU. If I want to get GPU pass through working with Virtualbox, it looks like I'll have to reinstall Linux and compile a bleeding edge kernel with IOMMU and ACS.

Re: State of PCIe/GPU passthrough

Posted: 2. Jul 2017, 20:18
by Perryg
Most if not all Linux kernels these days support iommu but you need to enable it. Usually with a kernel parm in grub. IE: "intel_iommu=on" or similar, assuming your CPU and bios also supports the VT-d feature. That said I feel it important to warn you that you are setting out on a time consuming endeavour. I was able to achieve PCI passthrough a few years ago as a test and it took days to achieve only to find out that the improvement I was expecting was not near as great as I thought it would be.

Re: State of PCIe/GPU passthrough

Posted: 3. Jul 2017, 09:33
by mpack
Perryg wrote:only to find out that the improvement I was expecting was not near as great as I thought it would be.
What was your comparison with Perry? Normal or 3D accelerated? I'm assuming it was against normal graphics, so the improvement vs "3D accelerated" would be even less.

@imrazor: 3D acceleration is not a panacea. Being a VM the level of OpenGL support tends to be behind the times, and some apps will complain about that. For most however I imagine that 3D acceleration will be perfectly adequate - and a lot simpler to set up.

Re: State of PCIe/GPU passthrough

Posted: 3. Jul 2017, 13:35
by Perryg
Actually since the VBox video was not being used with passthrough it was just overall performance that was not improved all that much. The guest did see the second GPU and use the accelerated portion of the card just fine. There was just no major improvement over VBox accelerated graphics. At least not enough to justify doing this on a daily basis. I had other hurdles that needed addressing but it was so long ago I don't remember exactly what, nor am I inclined to go through that mess again to find out especially since I don't have a second video card in my development machine now.

Re: State of PCIe/GPU passthrough

Posted: 3. Jul 2017, 19:42
by imrazor
Thanks for the input everyone. I assume you're saying that VBox offers some OpenGL acceleration to VMs. If so, that's news to me. However, I intend to pass through the GPU to a Windows VM (for gaming and DRM'd video streaming), so I need DirectX support rather than OpenGL. Or does VBox offer DirectX 11 acceleration?

Re: State of PCIe/GPU passthrough

Posted: 4. Jul 2017, 08:58
by mpack
VirtualBox GAs offers a DirectX API to Windows guests - again behind the times of course. However Direct3D API calls in the guest will be redirected to OpenGL on the host so it's still the same feature.

p.s. "the GPU"? You understand that it has to be a dedicated PCI card right? Not something the host is using.

Re: State of PCIe/GPU passthrough

Posted: 7. Jul 2017, 19:06
by imrazor
Sorry it took me so long to respond....been under the weather.

So it looks like Virtualbox offers DX9 support, but not anything more recent. Is this hardware accelerated, or strictly software based rendering? In any event, it looks like I probably would want GPU pass through to support modern software/games.

Yes, my system has two GPUs. An ancient ATI X1800 GTO for the host OS, and a more recent GTX 1050 Ti for passthrough. I do have a more recent Quadro I could use for the host, but it's easier to use seperate GPU manufacturers.

Re: State of PCIe/GPU passthrough

Posted: 8. Jul 2017, 09:00
by mpack
imrazor wrote: So it looks like Virtualbox offers DX9 support, but not anything more recent. Is this hardware accelerated, or strictly software based rendering?
As already mentioned, guest GA calls (whether to guest OpenGL or guest DirectX) are redirected to OpenGL calls on the host. Only you can say whether OpenGL on your host is hardware accelerated. On Windows hosts the answer is usually yes, if the host has anything other than basic Windows graphics. I have no idea what's normal on Linux hosts.