State of PCIe/GPU passthrough

Discussions related to using VirtualBox on Linux hosts.
Post Reply
imrazor
Posts: 34
Joined: 15. Oct 2015, 02:53
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows Server 2012 & R2, Win8.1, CentOS 7

State of PCIe/GPU passthrough

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: State of PCIe/GPU passthrough

Post 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?
imrazor
Posts: 34
Joined: 15. Oct 2015, 02:53
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows Server 2012 & R2, Win8.1, CentOS 7

Re: State of PCIe/GPU passthrough

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: State of PCIe/GPU passthrough

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: State of PCIe/GPU passthrough

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: State of PCIe/GPU passthrough

Post 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.
imrazor
Posts: 34
Joined: 15. Oct 2015, 02:53
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows Server 2012 & R2, Win8.1, CentOS 7

Re: State of PCIe/GPU passthrough

Post 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?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: State of PCIe/GPU passthrough

Post 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.
imrazor
Posts: 34
Joined: 15. Oct 2015, 02:53
Primary OS: Linux other
VBox Version: OSE Debian
Guest OSses: Windows Server 2012 & R2, Win8.1, CentOS 7

Re: State of PCIe/GPU passthrough

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: State of PCIe/GPU passthrough

Post 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.
Post Reply