← Back to context

Comment by WanjohiRyan

12 hours ago

Yes they are not... we run the Nvidia drivers unmodified. Only thing we have done is make the guest driver think it's running on the host, talking to the host's GPU kernel.

It works really well with a ~2% performance penalty. Nvproxy by google/gvisor has been doing this for years.

You should try running it yourself and see how it goes :D

So you can share the GPU between multiple VMs? I can have 4 VMs simultaneously do work on the GPU?

And each one would have its own Nvidia driver? How do they not interfere with each other? I mean I am by no means an expert in GPU architecture or anything similar, but I thought the problems with sharing a GPU come from the differences between GPU vs CPU architecture. On the other hand, multiple processes on a host can run on the same GPU, but that is all using the same kernel. I am just very confused.

  • This has been a thing for AMD, Intel, and Qualcomm GPUs for a few years now. Search for "DRM native context". The only difference here is that you had to use mesa drivers before and now someone made it work with the Nvidia drivers.

How is this different (in effect, not technically) from just using PCI passthrough, apart from being less safe and less tested?

  • Fair point, we still have a long way to go in terms of security AND being suitable for everyday use.

    However, nvgpu is meant to be used in PCI passthrough in scenarios where you would want to run and share your GPU across multiple KVM guests, or you don't want to detach the GPU from the host, and plug it into the VM you are running... you know, that little dance you do everytime you want to game inside a VM.

  •   > just using PCI passthrough
    

    On a laptop, I never got a working setup where I could attach/detach a modern nvidia card from host linux. So something that can do without is better. But intel SRIOV is a thing as well, which should be the secure alternative.

    • I got it working on my laptop. It has an Intel integrated iGPU and an NVIDIA discrete dGPU. I was able to pass through the NVIDIA GPU and use it for CUDA/etc.

      But the NVIDIA dGPU is muxless, so apparently all of the display outputs (laptop screen, HDMI outputs) are effectively hard wired to the iGPU. dGPU can render in a VM, it just has no where it can send it without trying to use Looking Glass or similar approach.