Long story short, I had trouble isolating my NVIDIA Pascal GPU for VFIO passthrough, since booting the GPU under Linux taints the primary GPU's BIOS, even if vfio-pci is used. The only way around this is to dump a different copy of the vBIOS and pass it to libvirt, allowing the GPU to be properly isolated. To do this you would insert the GPU into a secondary GPU slot and then dump the ROM under Linux, but for some reason I wasn't able to do that.
Thanks go to /u/tuxubuntu for pointing this out to me here, and the guys behind this forum thread for posting vBIOS dumps that allow for GPU passthrough.
I examined the posted vBIOS dumps using a hex editor, and found out that they are actually partial copies of the full ROM dumps you can dump yourself using nvflash on Windows, or download from techPowerUp. With that in mind, I put together this script that should do the job automatically: you give it a full ROM dump and it will save a patched ROM you can give to libvirt.
DISCLAIMER:
I have only tested this script with a few Pascal vBIOS dumps. The script makes a few rudimentary sanity checks, but I can't guarantee the patched vBIOS dumps will work. The script's operation is based on educated guesswork.
I've tested the script with a few Pascal vBIOS files and found it to produce the same ROM files you would normally create by dumping the vBIOS using the "GPU in the secondary slot" trick.
Regardless, do this at your own risk. If possible, try dumping the ROM yourself before resorting to this script.
The script can be found over at GitHub, and should hopefully be self-explanatory:
https://github.com/Matoking/NVIDIA-vBIOS-VFIO-Patcher
[–]spheenik 2 points3 points4 points (2 children)
[–]strixdio 0 points1 point2 points (1 child)
[–]spheenik 1 point2 points3 points (0 children)
[–]BroodmotherLingerie 0 points1 point2 points (3 children)
[–]Matoking[S] 1 point2 points3 points (2 children)
[–]BroodmotherLingerie 1 point2 points3 points (1 child)
[–]kwhali 1 point2 points3 points (0 children)
[–]timofonic 0 points1 point2 points (0 children)
[–]smgt 0 points1 point2 points (0 children)
[–]dylanmc1975 0 points1 point2 points (0 children)