I have another question about this. Can I also use the GPU that is passed-through to the guest from the host, once the guest is shut down?
For example, say I build a linux host with IGP + powerful discrete GPU. Can I use KVM to pass the discrete GPU to Windows if I want to play a game (using the IGP for the linux desktop) but also use the discreet GPU for Linux CUDA programming after the Windows guest is shut down?
I think that generally works these days. When GPU passthrough first became possible, there were widespread issues with GPUs that could not be easily reset and reinitialized after VM shutdown, and GPU drivers don't like taking control of hardware that's been left in an indeterminate state.
I did some searching and it seems that there is indeed a way to bind/unbind the GPU from the host by writing to /proc/bus/cpu, but apparently this is (was?) not always very stable as some GPU firmwares (AMD in particular it seems) do (did?) not allow resetting the device through any firmware interfaces.
If anyone knows if this is still the case and if the same holds for modern NVidia cards as well that would be great! Is GPU reset a documented/officially supported feature on NVidia/AMD these days?
For example, say I build a linux host with IGP + powerful discrete GPU. Can I use KVM to pass the discrete GPU to Windows if I want to play a game (using the IGP for the linux desktop) but also use the discreet GPU for Linux CUDA programming after the Windows guest is shut down?