Had commit f04352397e18c7bcdf2e625f23c623f82cf01f72 from the ubuntu
branch Tue Mar 1 21:55:03 2022 +1100 however it is so far out of date at
this point (And the check so basic) it's not worth porting.
Made this check which responds if /dev/kvm is missing as the script
needs it. If the script can't get the kvm modules going it'll comb dmesg
for pointers to help the user solve the issue when applicable.
Add -tpm argument to start a software TPM.
Add -secureboot argument to autosearch for an OVMF_CODE.
Still only applicable for Archlinux but maybe I can poke
/etc/os-release and have a lookup table to better support
other Distros without people having to do manual arguments.
Add -biosvars to specify a unique OVMF_VARS copy for a guest to boot
with.
Add -win11 which activates both -tpm and -secureboot to get started
quickly.
Move dependency checker to own function, only check for certain deps
when a user actually uses flags relevant to them.
+ Cleaned up some hyperlinks in README.md
+ Added new documentation area regarding helpful config info and tips on how to do VFIO on a PC with two GPUs without killing X on the primary GPU.
Including an xorg.conf example for Nvidia and coverage regarding certain configurations
+ Remade some of the subfunctions in `enumeratePCIs` to better handle unbinding a GPU dynamically, when IN USE by the host's X server, or a child process of one.
+ Added new flag -killX for when a user is OK with killing X to start their VM (Would be needed for Single GPU Passthrough anyway)
Some important changes:
1. The script now checks for all open handles on a GPU dynamically and doesn't necessarily have to kill Xorg if your X server has been configured to only use one GPU and leave others alone (Sample xorg configuration included in README.md!).
This is designed to support graphical sessions which have been configured to use only one card and leave the other alone (Or however many cards you have).
Taking advantange of this update means you can have two GPUs (same model even; doesn't matter), both bound to the NVIDIA driver but your X session is only using one. With this configuration you can still use both cards in CUDA operations, but can also unbind your second GPU at any time without losing your graphical environment!
2. The script will however kill any processes that are using a GPU intended for the guest which are not Xorg (Firefox, Chrome, xdg-desktop-portal-gnome, others love to touch hardware X was told to ignore). The script attempts to start these back up for you after your guest GPU is successfully bound to vfio-pci, if it gets there.
0. A couple function name changes here and there. Script documentation brushup too.
1. added flags [-avoidVirtio/-noVirtio] to use generic virtual hardware such as e1000e for guest Ethernet among other comprompises for special cases.
* If you don't have the virtio ISO handy during installation or are booting a kernel/initrd directly without virtio drivers baked in, this is a savior.
2. Added flags [-cputhreads / -showpairs / -showthreads / -showcpu] to easily and quickly show host CPU core thread pairings on the fly.
4. Added flags [-ignorevtcon / -ignoreframebuffer / -leavefb / -leaveframebuffer / -leavevtcon] optional workaround for kernel Bug 216475 on Nvidia cards.
* (Unbinding and rebinding vtcon0/1 causes a null pointer dereference in fbcon.c with certain video drivers).
* With this my 2080Ti can go from guest to host login screen again as many times as I want in a boot,
* at the cost of the virtual consoles on my single gpu setup.
* I like my virtual consoles though so hopefully this is fixed soon.
5. Squashed vcpu pinning bug introduced in earlier commit (Had the ampersand in the wrong spot, damn)