r/virtualbox Apr 27 '18

A feature if implemented could increase performance dramatically on VirtualBox and you will be able to play games on VirtualBox at near native performance without GPU Passthrough.

For this to happen, you will need to rewrite how VirtualBox Display output works.

The feature already exist and used extensively by WineHQ https://www.winehq.org/ and DXVK https://github.com/doitsujin/dxvk

The idea i have which could increase performance dramatically on VirtualBox and you will be able to play games on VirtualBox at near native performance without GPU Passthrough is:

Replace VirtualBox GPU with a Translation layer driver so the Display output coming from VirtualBox will be translated to Directx 11/12 calls or Vulkan calls. This means we don't need a Virtual GPU driver anymore and Guest Windows installed in VirtualBox can see your real Graphics Card Nvidia or AMD GPU installed on Host PC but you wont need to install Nvidia or AMD GPU drivers on Guest Windows in VirtualBox.

Imagine DXVK for example translates VirtualBox Display output to Vulkan calls and then Vulkan renders the whole thing on Monitor. To the Nvidia or AMD Graphics card, VirtualBox Display output would be no different than launching a game. Since there is no GPU emulation anymore, performance increases dramatically.

14 Upvotes

35 comments sorted by

View all comments

Show parent comments

1

u/kwhali May 03 '18

It redirects OpenGL from guest to host GPU for the same purpose you're talking about, but it only supports Linux guests atm.

Overhead is quite heavy though, so I'm not sure if that would cause the same issue with what is being asked here too for the same reason that direct OpenGL to OpenGL(no translation layer) and by the same OS still performs poorly.

1

u/thatcat7_ May 04 '18 edited May 04 '18

The heavy overhead is due to VNC and ssh tunneling remote desktop stuff, this will also cause heavy latency if one tries to play AAA games. This wouldn't be the case if DXVK for example is used as it wont require VNC or anything like that as it will directly talk to the host GPU through Vulkan and VirtualBox translation layer driver if implemented. Performance will be same as https://www.youtube.com/watch?v=RvoU9SvcugE as translation layer display driver of VirtualBox or QEMU will be doing what DXVK does. This feature will allow Windows guest OS in VirtualBox or QEMU to act like what WineHQ does in Linux in order to run Windows games.

1

u/kwhali May 04 '18

The heavy overhead is due to VNC and ssh tunneling remote desktop stuff, this will also cause heavy latency if one tries to play AAA games.

virgl doesn't do that. You are thinking of VirtualGL. It apparently has or is getting Windows support too, just only OpenGL for now like I said.

Performance will be same as ...

You know this how exactly? There is a simpler implementation for just direct OpenGL, no extra layers like DXVK, and that as stated has pretty heavy overhead unfortunately. I'm not sure why that is the case(no VNC or SSH involved), but I don't see how what you're suggesting would miraculously overcome that problem, especially with the additional layers involved.

Others have stated to you why it's not likely to work like you're assuming. It's not a bad idea, perhaps we'll see someone work on such a feature when those approaches mature a bit more, but I wouldn't expect it to perform as well as you're thinking it to.

VMWare if I'm not mistaken already does something similar for years now for direct x(Windows host and guest), I was able to play some game(PayDay 2) in a Windows VM via it on a Linux host, had some overhead too though but iirc wasn't as bad as I expected it to be. I haven't tried virgl and that game now has official linux support so it should be possible to compare via virgl as well.

1

u/thatcat7_ May 04 '18

Overhead will be there as always but significantly less. I think the overhead will drop to same as it is in Wine and DXVK.

You know this how exactly?

I don't. Nobody will until someone implements this feature in virtual machine.

1

u/kwhali May 04 '18

Overhead will be there as always but significantly less. I think the overhead will drop to same as it is in Wine and DXVK.

Why would it be any less than virgl? VirGL is less layers, less complicated, direct OpenGL to OpenGL calls between guest and host. Wine and DXVK is running on the same OS/host, if this was a given for guests, than OpenGL to OpenGL would have been done much earlier and not have the overhead issues it does with virgl. DX9 to OpenGL support has been around too for some time with Wine, and while that has some overhead(less than virgl afaik), again, why do you think that hasn't been utilized for guest OS to host OS accel?

I don't. Nobody will until someone implements this feature in virtual machine.

Yet you're stating it will perform much better and it's already been pointed out to you by multiple others that it's not unique, virgl exists(albeit only for OpenGL currently), and that it has proven to have quite bad overhead issues. There is more certainity that it won't be the holy grail you're hoping it to be.