State of PCIe/GPU passthrough

Discussions related to using VirtualBox on Linux hosts.

State of PCIe/GPU passthrough

Postby imrazor » 2. Jul 2017, 05:47

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.
imrazor
 
Posts: 31
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

Postby mpack » 2. Jul 2017, 12:32

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

Re: State of PCIe/GPU passthrough

Postby imrazor » 2. Jul 2017, 19:30

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.
imrazor
 
Posts: 31
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

Postby Perryg » 2. Jul 2017, 20:18

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

Re: State of PCIe/GPU passthrough

Postby mpack » 3. Jul 2017, 09:33

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

Re: State of PCIe/GPU passthrough

Postby Perryg » 3. Jul 2017, 13:35

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

Re: State of PCIe/GPU passthrough

Postby imrazor » 3. Jul 2017, 19:42

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?
imrazor
 
Posts: 31
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

Postby mpack » 4. Jul 2017, 08:58

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

Re: State of PCIe/GPU passthrough

Postby imrazor » 7. Jul 2017, 19:06

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.
imrazor
 
Posts: 31
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

Postby mpack » 8. Jul 2017, 09:00

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


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 13 guests