Swap Host and Guest GPU

I have a windows VM set up and working correctly with no issues. I’d like to switch the GPU that is currently being used by the host for the guest and vice versa ( permanently, so no on the fly reassigning or anything like that ).

I’m running Manjaro and currently my hardware is:
Guest Card: Nvidia GTX 970
Host Card: Nvidia RTX 2060

Currently this is my plan.

  • Uninstall drivers on guest and host machines
  • Remove current host card
  • Reinstall drivers and set old guest GPU as the new Host CPU
  • Put old host card back in and:
    - Edit /etc/modprobe.d/vfrio.conf to use the ID of the new card
    - Change PCI passthrough to the new device on the guest VM

Looking for any comments, suggestions, or possible issues as I’m a bit rusty with all this.

My ultimate goal is to not redo the whole guest VM.

No need to make hardware changes if you can change primary/boot gpu in UEFI.

Also if GTX 970 is working on latest drivers, then you can easily switch between reboots, I do it pretty often. (I have 2x 10xx so no need to change driver between them)

So I have both gpus added to modprobe, and workflow is:

  1. Comment out GPU for host and uncomment GPU for VM
  2. run mkinitramfs
  3. reboot and change primary gpu in bios
  4. boot Manjaro and define/clone new VM. Change passtrough card.
    No need to delete old one if you decide to switch back :slight_smile:

Hopefully I didn’t forgot anything…

Good to know!
I quickly tried switching the GPU boot ( Asus Prime X470-PRO) with no change.
I stumbled upon another post where people needed to switch some settings around to get Asus boards working with GPU boot selection (Seemingly having everything set to UEFI supported options without any legacy support) . I’ll look around and see what I find.

Yeah UEFI-only boot makes things way easier than CSM. Point is that secondary card doesn’t initialize at boot time.
I have GB x470 Aorus Something and bios has option to select PCIe slot from which to boot. Works without issues.

Oh, just one correction, its mkinitcpio in Manjaro, not mkinitramfs. I was logged into my Ubuntu through ssh and I didn’t notice when i was checking spelling :confused:

Haha yeah, unfortunately I don’t think the Asus board can switch the gpu’s on boot. :frowning: