A project to simplify setting up GPU passthrough on your Linux host for libvirt/virt-manager
You can use it by simply downloading the latest release and run it inside a terminal or by downloading and compiling it yourself with the commands below.
This project is aimed at systems with 2 GPUs and headless servers, where the only GPU is not needed.
Note: Quickpassthrough is not designed to be installed by a package manager! As you would usually have to only run it once, unless you change the GPU.
git clone https://github.com/HikariKnight/quickpassthrough.git
cd quickpassthrough
go mod download
CGO_ENABLED=0 go build -ldflags="-X github.com/HikariKnight/quickpassthrough/internal/version.Version=$(git rev-parse --short HEAD)" -o quickpassthrough cmd/main.go
git clone https://github.com/HikariKnight/quickpassthrough.git
cd quickpassthrough
go mod download
go get -u ./cmd
CGO_ENABLED=0 go build -ldflags="-X github.com/HikariKnight/quickpassthrough/internal/version.Version=$(git rev-parse --short HEAD)" -o quickpassthrough cmd/main.go
Currently no, however Bazzite, Bluefin and Aurora has an ujust
command that does a very similar job.
In Bazzite you run ujust setup-virtualization
and follow the prompts to Enable Virtualization
and Enable VFIO drivers
.
In Bluefin and Aurora you run ujust setup-vfio
and follow the prompts.
There is a backup/
folder generated on the first run that will have a copy of all your files (and their paths) from before we edited anything.
Compare that folder with the config/
folder to see which files you need to delete in addition to copying the files from backup/
to your system before rebuilding your initramfs and updating your bootloader config.
Remove the vfio kernel arguments from your bootloader by pressing E on the boot menu. The kernel arguments added to the bootloader can be found in the config/kernel_args
file.
NOTE: You can also just remove them from your bootloader permanently and update your bootloader if you want to keep the config files on your system.
This project originally started out as a bash only project, upon completing the proof of concept it became very clear that bash would become very messy with all the weird quirks and regex and inline editing of files.
So the project moved over to golang, this lets us utilize TUI toolkits to build a proper menu system for the project.
If you know golang, passthrough or qemu, you are welcome to help! Just make a pull request!
Just remember to add comments to document the work and explain it for people who are less familiar with the golang syntax or anything else you use. 😄
Also if you know English, you can help by just proof reading. English is not my native language, plus I have dyslexia so I often make spelling mistakes. Proof reading is still contribution!
I wanted to learn it, while also using a language that would potentially not create system dependencies. GO fits this criteria when you compile using CGO_ENABLED=0 as this will statically link the libraries and still produce a fairly small (when compressed with upx) binary.