GPU Virtualization - GPU shared between Host and GuestVM

tinfoil-hat

Active Member
Joined
Oct 24, 2021
Messages
299
Reaction score
155
Credits
2,101
Hi there, I heard it was possible to share the GPU with both (Host and GuestVM). Sadly I havent found much online. I heard it is possible via Nvidia RTX Series. I have a AMD Ryzen 7 PRO 5750G and AMD ATI Radeon RX 6600. OS is Linuxmint 21.1

Maybe someone here has done something similar. I am not talking about GPU Passtrough, since it would have the Graphicscard dedicated to Windows VM

Cheers
 


You can try doing a single GPU passthrough, see the following github pages as examples.
 
You can try doing a single GPU passthrough, see the following github pages as examples.
Thanks, for your reply. But this was not what I ment. With GPU Passtrough you cant use the Grapicscard on the host and with single GPU-Passtrough you also aren't able to use the GUI of your Linux machine. If I understand GPU Virtualizing correctly, you can use your GPU with both: Guest and Host at the same exact time
 
You described wanting to able to use one gpu for for both, in the first link I shared you see the advantages and disadvantages.
Advantages:
As already stated, this model only requires one GPU
The ability to switch back and forth between different OSes with FULL use of a discrete graphics processor (Linux on Host with full GPU, Windows 10 Guest with Full GPU, MacOS guest with full GPU)
Bragging rights
Could be faster than dual booting (this depends on your system)
Using virtual disk images (like qcow) gives you management of snapshots, making breaking your guest os easy to recover from.
Disadvantages:
Can only use one OS at a time.
Once the VM is running, it's basically like running that as your main OS. You will be logged out of your user on the host, but will be unable to manage the host locally at all. You can still use ssh/vnc/xrdp to manage the host.
There are still some quirks (I need your help to iron these out!)
Using virtual disk images could be a performance hit
You can still use raw partitions/lvm/pass through raw disks, but loose the more robust snapshot and management features
If you DO have a second video card, solutions like looking-glass are WAYYY more convenient and need active testing and development.
All VMs must be run as root. There are security considerations to be made there. This model requires a level of risk acceptance.
If you are wanting to use the gpu for the host and the vm at the same time because AFAIK a device can't be active on two systems at once. For example, I have a Proxmox host and added a Quadro Nvidia gpu to that system, which I then passed through to my vm. I am not able to use it on the host system because it's in assigned to the vm. I think that's called I think that's called a PCI passthrough where you need one gpu for the host and one for the vm.
The way you described it the single gpu pass-through seemed like a good alternative for what you want.
 
AFAIK a device can't be active on two systems at once.
Looking a bit further it does seem possible.
There seems to be more information about how to do it with Nvidia than with AMD, I actually can't find anything about it of how to do it with AMD.
 
Last edited:
Looking a bit further it does seem possible.
There seems to be more information about how to do it with Nvidia than with AMD, I actually can't find anything about it of how to do it with AMD.
That's why I am asking here :D
 
Then it will be a standard GPU Passtrough, I guess, thank you anyways
 
Looking at the linked website in that superuser reply it seems you would need a high-end enterprise gpu in order to do that for both AMD and Nvidia. What exactly are you wanting to do, that you want to use the same gpu on both the host and a guest vm?
 
Looking at the linked website in that superuser reply it seems you would need a high-end enterprise gpu in order to do that for both AMD and Nvidia. What exactly are you wanting to do, that you want to use the same gpu on both the host and a guest vm?
I want to support Linux Gaming by playing on Linux with compatible Games. But have the posibillity to run Games that are for Windows only right now
 
I want to support Linux Gaming by playing on Linux with compatible Games. But have the posibillity to run Games that are for Windows only right now
You have probably three options:
1. Buy a second graphics card and use that for your vm.
2. Dual-boot with Windows.
3. Just decide to only play games that you can run on Linux and don't play games that you can't, currently those are the ones that have some type of kernel level Anti-Cheat enabled.
If you don't want to go for option 3 then option 2 is probably the one to go for since you won't have to buy a new graphics card for that option. I have been gaming for quite a long time on Linux now even before Proton and I can say there are more than enough games to play to keep me entertained and don't make me miss any of the ones with kernel level Anti-Cheat.
 

Members online


Top