Automatic Bind and Unbind of Vfio drivers?

The title is self explanatory. To the best of my understanding the vfio drivers are slipped in during boot, but is it possible to unbind them and then rebind them after boot or even vice versa? So that if I wanted to use my gpu to game on linux natively? And then switch back if need be.

Thank you,
Any response is appreciated

Technically, you should be able to send a bind or unbind to the hardware address.

But I don’t think the graphics stack would pick up the newly available hardware; I think it only initiates the PCIE GPU devices at boot time. (Or not, if they are isolated)

Maybe a bind/unbind and restart of WM/DE? But then you might as well reboot

1 Like

if you assume all your hardware rresets correctly. this is entirely possible.
the scripting to achieve this would be very complex and there’s no big effort to help with this scripting because most consumer hardware you’d want to do this with misbehaves and can’t do a proper IOMMU reset. this is the sole reason it’s advised to do your vfio binding’s at boot time, and not to change them without a reboot.

blame manufacturers for being lazy with device firmwares. the biggest offenders are AMD, Nvidia, and Intel.

notable exceptions are SR-IOV virtual functions. i have an SR-IOV Ethernet card that i frequently change the bindings of. the sad thing is, no SR-IOV graphics card that is adequate for playing modern games exists.

1 Like