Can i switch the GPU between host and guest + Oculus rift

I’m a novice linux user but never fiddled with vfio.

As in the title I’m wondering whether I can switch the gpu between the host (Manjaro) and guest (windows 10) so that i can utilise the full power of my system without having to comprimise one os to use a weaker gpu. Right now I only have a gtx 1070 and a ryzen 7 2700x which has no igpu, but from what I understand I have to invest in a secondary gpu to actualy display things while my 1070 does all the processing. I would be glad if I could switch the gpu between host and guest so that I can play native/proton games on linux with my 1070 and windows games also on my 1070.

Also more of a side question but would I be able to use my Oculus Rift cv1 aswell in the guest enviroment, as of right now there is no linux support. I would probably have to get a pcie usb controller which is no problem. However there is a very promising project called openhmd which are open source vr hmd drivers for various headsets, but as of now there is no positional tracking however they are close to implementing it from what I could see on their twitter feed.

assuming your GPU resets perfectly every single time: yes, what you ask is entirely possible.
the scripts to run such a setup might get rather complex, but its possible.
im not sure about occulus, but my Valve Index works perfectly in a VM, once i got the USB controller and GPU properly passed through.

Could you please elaborate on the whole reseting properly if you could, and for the script do you know of a guide to follow as I’m not familiar with bash scripts.

You can only use the 1070 for either the Host Linux OS OR the Windows guest OS, not both at the same time or switching between them on the fly while both are still running.

The Windows guest takes control of the 1070 and at that point Linux can not use it for its own output.

So you can load Linux host and do things there,
Then load Windows guest giving it total control of the 1070 and do things there,
Then end the Windows guest and go back to the Linux host and resume doing things there assuming the windows guest correctly gives up control of the 1070 (resetting it) letting Linux reinitialise the 1070 for its own use again.

If that last part fails in some way you then have no video output at all until you reset the machine.

EDIT: This is just my basic understanding of the process, I do not do this stuff myself, so someone please correct me if I am wrong.

Moved to VFIO as this is not a Looking Glass specific issue/topic.

A different possibility will be to run a lightweight hypervisor on your system and have your linux WS and the gaming W10 as VMs. I think it will be easier to pass the card between VMs than between host and a VM.
For example you can get the proxmox android app and switch the VMs from your phone.