Skip to content

0.6 - vbios and 1G hugepage support with cleanup as usual.

Compare
Choose a tag to compare
@ipaqmaster ipaqmaster released this 06 Jun 11:31
· 98 commits to master since this release

Enough changes since 0.5b with stability on two machines to tag a release for it.

Fluff:
Fired up previous desktop (Sabertooth x79, 3930K GTX660 [host] GTX780[Guest] to test some dual GPU support scenarios. Not the most responsive environment however useful for testing the script.

Some changes in 0.6 since 0.5b:

  1. "Script cleanup" as usual this time featuring better echoing, some improved function return logic, catches for driver unbind hangs and other redundancies to exit early if it thinks something went wrong.

  2. Better detection for a GPU device and the script will only attempt to kill a display-manager service if the GPU device is found currently bound to anything other than vfio-pci, rather than always. The kill is only kept in the script to try and avoid a possible deadlock during gpu unbinding.

  3. Added a -lookingglass/-looking-glass/-lg flag to support the Looking Glass project in this script. Adds some shared memory and spice devices to qemu when specified.

    • Anyone trying to use this flag will still need to install the looking glass host software in their VM and add the VirtIO IVSHMEM driver to the "PCI standard RAM Controller" which appears in Device Manager under System Devices before Looking Glass will function.
  4. Added a -romfile/-vbios added which will be shoehorned into the qemu pci argument for any GPU device on detection

  5. -hugepages/-huge improved to detect the system's hugePageSize better and support optional custom mountpoints when specified after the argument. Otherwise falls back to default /dev/hugepages, but will no longer automount it (though, it should be automounted on modern distros anyway). On top of all this, if it detects hugepages are already allocated AND there's enough for how much memory the VM wants, it will use the existing free pages instead of allocating freshly. Otherwise, it will drop caches, compact memory and allocate its own as usual.

    • Made this change to support 1GB hugepages which may not always be mounted at /dev/hugepages and may have its own mount options modifying the page size, which the script should detect dynamically.

    • With this I was able to add hugepagesz=1G hugepages=16 to my kernel boot parameters to sactifice 16GB at system startup to hugepages, and mount those pages with mount -t hugetlbfs hugetlbfs -o rw,relatime,pagesize=1G /dev/1gb_hugepages and start my VM with -hugepages /dev/1gb_hugepages included to use the pages which are already present. Even if not preallocated the script would be capable of allocating 1GB hugepages instead of 2MB sized ones on the fly worst case.