Jump to content

NVIDIA to officially allow GPU passthrough to Windows VM from Linux host

gjsman

Summary

Today, NVIDIA announced that they will officially support the ability to have a Windows VM on a Linux host and passthrough a GPU to it. Although this was technically possible earlier, NVIDIA made it very difficult with Error 43 on their consumer hardware, requiring gamers to try preventing NVIDIA's drivers from knowing they were running inside a VM. With this change, running a Linux operating system as your daily driver and having a Windows VM for certain games is now easily possible.

 

However, NVIDIA can't do anything without a catch. Because this is not SR-IOV, you will need 2 GPUs: 1 for Linux, and 1 being passed through to Windows. Which, considering the GPU shortage, means this is a shallow victory.

 

Quotes

Quote
NVIDIA has enabled GPU passthrough beta support for a Windows virtual machine on GeForce GPUs. What does this mean?
With virtualization enabled, GeForce customers on a Linux host PC can now enable GeForce GPU passthrough on a virtual Windows guest OS.  There are a few GeForce use cases where this functionality is beneficial such as:
  • GeForce customers wanting to run a Linux host and be able to launch a Windows virtual machine (VM) to play games 
  • Game developers wanting to test code in both Windows and Linux on one machine
 
What class of virtualization is supported on GeForce GPUs?
GeForce GPU passthrough supports 1 virtual machine.  SR-IOV is not supported on GeForce.  If you want to enable multiple virtual machines to have direct access to a single GPU or want the GPU to be able to assign virtual functions to multiple virtual machines, you will need to use NVIDIA Tesla, Quadro, or RTX enterprise GPUs.
 
Which driver is GeForce virtualization (beta) supported on? 
GeForce virtualization (beta) is supported on R465 or higher drivers.
 
Which GeForce GPUs and Windows OSes support virtualization?
The feature is enabled on all GeForce/TITAN GPUs supported in the R465 driver (Kepler and later for Desktop; Maxwell and later for Notebook) for Windows 10.
 
Do you need to have more than one GPU installed or can you leverage the same GPU being used by the host OS for virtualization?
One GPU is required for the Linux host OS and one GPU is required for the Windows virtual machine.

 

My thoughts

I'm happy, but at the same time, a bit miffed that this isn't SR-IOV with the ability to split a GPU into parts (like you can with CPU cores), so the requirement for 2 GPUs is quite unfortunate.

 

Sources:

https://nvidia.custhelp.com/app/answers/detail/a_id/5173/~/geforce-gpu-passthrough-for-windows-virtual-machine-%28beta%29

Link to comment
Share on other sites

Link to post
Share on other sites

Does this mean they're removing the block from the driver or only new GPUs will have pass-through ability?

 

If the latter I still don't plan on buying an NVIDIA GPU.

Link to comment
Share on other sites

Link to post
Share on other sites

Great for those situations when you want to use an open source OS, but don't want open source graphics drivers, so you run Nvidia and also don't really want an open source OS, so you run Windows in a VM.

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, gjsman said:

Summary

Today, NVIDIA announced that they will officially support the ability to have a Windows VM on a Linux host and passthrough a GPU to it. Although this was technically possible earlier, NVIDIA made it very difficult with Error 43 on their consumer hardware, requiring gamers to try preventing NVIDIA's drivers from knowing they were running inside a VM. With this change, running a Linux operating system as your daily driver and having a Windows VM for certain games is now easily possible.

 

However, NVIDIA can't do anything without a catch. Because this is not SR-IOV, you will need 2 GPUs: 1 for Linux, and 1 being passed through to Windows. Which, considering the GPU shortage, means this is a shallow victory.

 

Quotes

 

My thoughts

I'm happy, but at the same time, a bit miffed that this isn't SR-IOV with the ability to split a GPU into parts (like you can with CPU cores), so the requirement for 2 GPUs is quite unfortunate.

 

Sources:

https://nvidia.custhelp.com/app/answers/detail/a_id/5173/~/geforce-gpu-passthrough-for-windows-virtual-machine-%28beta%29

Well, you could always use the iGPU on Intel systems to do this, that's how you did it on Windows as well. So this isn't really anything new in that regard.

 

Though I don't see the point, this will just enable hacking of MMO games by using the virtual machine so the client OS isn't aware of what's going on. So I don't expect competitive MMO games to permit their games to be played inside a Linux hosted virtualized environment any more than they currently permit this already on a MacOS hosted or Windows hosted one.

 

If you are playing games as your primary pc purpose, you run Windows. If you use your Linux for some other reason and occasionally play games on it, then maybe this gives you an option that wasn't previously available. However, again, this falls back to game developers to not purposely break the game running inside a VM. Many games have broken mouse movement inside a VM because of mouse cursor translation not matching the the host os.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

O.O
I avoided this in the past because it was such a PITA.  My memory was it was the only way to have a really secure windows system.  My work around is currently using my PC as more or less nothing but a games console and just not doing anything vaguely of consequence on it.  This could make things viable though.

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

Keep in mind that if you are doing development under Linux, Nvidia offers drivers for using your current Nvidia GPU (GeForce and Quadro) for CUDA acceleration under WSL2

https://developer.nvidia.com/cuda/wsl/download

 

So, I don't think it is the end of the world the current limitation, unless you don't have Intel integrated graphics, and you really want to play games under Linux through a VM running under Windows for some reason... I guess TuxRacer is that of a compelling game....

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, gjsman said:

you will need 2 GPUs: 1 for Linux, and 1 being passed through to Windows

Well up until Ryzen got very popular the majority had an Intel iGPU anyway, I would say most still do.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, leadeater said:

Well up until Ryzen got very popular the majority had an Intel iGPU anyway, I would say most still do.

Plus Linux will run on pretty much anything (as long as you go for a low weight DM like XFCE), you could just go buy a GT710 and use it to run Linux then pass your RTX through to Windows.

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Master Disaster said:

Plus Linux will run on pretty much anything (as long as you go for a low weight DM like XFCE), you could just go buy a GT710 and use it to run Linux then pass your RTX through to Windows.

So not actually much simpler to set up?  That’s unfortunate.

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

What's the current performance penalty of running Windows in such a way? Last time i tried to run a VM (though it was a Linux VM within Windows) it was not a great experience.

 

Since it's a dedicated GPU being passed through, one would assume there should be no GPU penalty?

🌲🌲🌲

 

 

 

◒ ◒ 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Arika S said:

What's the current performance penalty of running Windows in such a way? Last time i tried to run a VM (though it was a Linux VM within Windows) it was not a great experience.

 

Since it's a dedicated GPU being passed through, one would assume there should be no GPU penalty?

My memory was someone claimed 10%.  I don’t know how accurate that is though.

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

That's really nice, especially if you have an integrated graphics to use on your host system.

23 hours ago, gjsman said:

I'm happy, but at the same time, a bit miffed that this isn't SR-IOV with the ability to split a GPU into parts (like you can with CPU cores), so the requirement for 2 GPUs is quite unfortunate.

Well, that's not possible to solve since the geforce cards (and most quadro/teslas) lack actual hardware that's required to have proper SR-IOV.

 

13 hours ago, GoodBytes said:

Keep in mind that if you are doing development under Linux, Nvidia offers drivers for using your current Nvidia GPU (GeForce and Quadro) for CUDA acceleration under WSL2

It's slower than native, and even worse to get stuff working than your regular CUDA install (which is a PITA by itself already).

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, Bombastinator said:

So not actually much simpler to set up?  That’s unfortunate.

The same thing is true of any VM Hardware Passthrough. Devices connected to your computer can only talk to one bus at a time, if you want to pass them through to a VM then it will always disable them on the host, that's just the nature of virtualised hardware.

 

Its not like you can buy a 6700XT (April Fools joke right there), stick it in a computer and magically use it in both a Windows host and Linux VM at the same time (or vice versa).

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, Arika S said:

What's the current performance penalty of running Windows in such a way? Last time i tried to run a VM (though it was a Linux VM within Windows) it was not a great experience.

 

Since it's a dedicated GPU being passed through, one would assume there should be no GPU penalty?

VM being clunky is a problem of lacking graphics, since VM emulate hardware, graphics are emulated and run on the host CPU, that's why running anything with a GUI on a VM feels clunky nevermind that anything that needs graphics horsepower would be a slideshow if it manages to run at all, non graphical workloads tend to be 10-20% slower that on bare metal depending on the workload itself.

 

Once you give a full real GPU to a VM, performance its basically the same as bare metal unless the program gets CPU bottlenecked which the VM performance penalty applies.

this is one of the greatest thing that has happened to me recently, and it happened on this forum, those involved have my eternal gratitude http://linustechtips.com/main/topic/198850-update-alex-got-his-moto-g2-lets-get-a-moto-g-for-alexgoeshigh-unofficial/ :')

i use to have the second best link in the world here, but it died ;_; its a 404 now but it will always be here

 

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, AlexGoesHigh said:

VM being clunky is a problem of lacking graphics, since VM emulate hardware, graphics are emulated and run on the host CPU, that's why running anything with a GUI on a VM feels clunky nevermind that anything that needs graphics horsepower would be a slideshow if it manages to run at all, non graphical workloads tend to be 10-20% slower that on bare metal depending on the workload itself.

 

Once you give a full real GPU to a VM, performance its basically the same as bare metal unless the program gets CPU bottlenecked which the VM performance penalty applies.

This is not exactly true. If a person was to put a lot of work into their VM setup then you can get very very close to bare metal performance but that just does't happen simply because you pass a GPU through. 

 

Also performance hit from using a VM varies widely dependent on the application. 1 game may get near perfect native performance while another takes a 10% hit. The best way to describe it is you are gonna get a small latency increase that effects the behavior of the whole system. You can measure this with different latency tools for Windows but everything memory reads/writes to I/O in general is gonna be effected. With the right tweaks the impact can be small enough to not matter but those tweaks are not on by default and often depend on the hardware you use. 

 

The biggest hit is in I/O to disk. Even if you passthrough a controller or a M.2 drive there is still a noticeable hit under certain I/O loads that just isn't going away. (Although if gaming is your concern passing a M.2 drive or a SATA controller through to the VM basically makes it unnoticeable unless you run a benchmark of some sort)

 

The list can go on. If you are doing VR better make sure you pass though a USB controller (or hope your video card has that nifty USBC port) because without it the latency of the emulated USB is too much. Getting high polling rate mice to work well takes tweaking as well. For the love of all that is holly don't use e1000 drivers for your virtual nic. Know your CPU core layout. Isolate cores. Pray to the VM gods by sacrificing a virgin CPU. Do the hooky pooky... cuz.. really that is what it is all about? 

But seriously it can be a lot of work and really rewarding if you are into tweaking software/hardware for the best performance. 

 

Also to stay on topic I do not get what Nvidia is doing here. What is the advantage of adding this to the driver? Making it a tiny bit easier to isolate the GPU for passthrough? Is doing it 'Nvidia way' suppose to yield better performance somehow? What is the point!? 

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/30/2021 at 2:10 PM, Windows7ge said:

Does this mean they're removing the block from the driver or only new GPUs will have pass-through ability?

 

Removed from driver, so all GPUs 600 series and up I believe.

Current System: Ryzen 7 3700X, Noctua NH L12 Ghost S1 Edition, 32GB DDR4 @ 3200MHz, MAG B550i Gaming Edge, 1TB WD SN550 NVME, SF750, RTX 3080 Founders Edition, Louqe Ghost S1

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, OrcephRye said:

Also to stay on topic I do not get what Nvidia is doing here. What is the advantage of adding this to the driver? Making it a tiny bit easier to isolate the GPU for passthrough? Is doing it 'Nvidia way' suppose to yield better performance somehow? What is the point!? 

Make our lives easier without having to do any workaround to get their GPUs working under passthrough scenarios.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/31/2021 at 1:13 PM, Arika S said:

What's the current performance penalty of running Windows in such a way? Last time i tried to run a VM (though it was a Linux VM within Windows) it was not a great experience.

 

Since it's a dedicated GPU being passed through, one would assume there should be no GPU penalty?

My experience is around 5%, depending on the type of workload and tweaks to the VM (cpu pinning, numa, hugetables...) I am more than willing to accept that tradeoff, since hardware these days is overpowered anyway and I wouldnt notice the difference from bare metal even if I tried. But keep in mind, virtualization with gpu/pcie-passthrough is still not a one click solution and performance depends on many factors, so your results may vary.

 

Regarding the topic at hand: i very much appreciate the efforts that go into opening hardware to virtualization by the common user. More and more features become available outside of enterprise environments, and thats a good thing. Currently i use AMD only, just because it was simpler to get stuff working in a VM. News like this one might change that.

Link to comment
Share on other sites

Link to post
Share on other sites

How about the other way around or from Windows host to Windows VM? I want to give sketchy software direct access to my GPU in Linux or Windows running on VM!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×