A project to remove the complexity of setting up GPU passthrough for qemu
Find a file
2023-12-26 19:20:29 +01:00
.github Add funding 2022-02-27 20:00:12 +01:00
cmd Refactor and split tui into smaller files 2023-12-26 19:20:28 +01:00
internal Implement Set_Kernelstub and attempt to elevate to sudo using STDIN and then attempt to remove the password from the program memory 2023-12-26 19:20:29 +01:00
old_bash_version initial commit to prepare for rewrite into golang for actual use 2023-12-26 19:20:28 +01:00
pkg implement backup system 2023-12-26 19:20:29 +01:00
.gitignore Start logging to file for debugging 2023-12-26 19:20:29 +01:00
go.mod cleanup of the code and add more data to config 2023-12-26 19:20:28 +01:00
go.sum cleanup of the code and add more data to config 2023-12-26 19:20:28 +01:00
LICENSE Initial commit 2022-02-25 13:08:46 +01:00
README.md update readme for the golang version 2023-12-26 19:20:29 +01:00

QuickPassthrough

A project to simplify setting up GPU passthrough on your Linux host for QuickEMU(vfio support not developed yet) and libvirt/virt-manager

You can use it by simply downloading the latest release and run it inside a terminal/shell or by downloading and compiling it yourself with the commands below.

git clone https://github.com/HikariKnight/quickpassthrough.git
cd quickpassthrough
go mod download
go build -o quickpassthrough cmd/main.go

Features

  • General warning and info about what you will be needing
  • Enable and configure vfio modules
  • Configure 2nd GPU for GPU Passthrough (1 for host, 1 for VM)
  • Generate script to use for dumping the vbios rom (as some cards require a romfile for passthrough to work), however no rom patching support planned.
  • Enable and configure the correct kernel modules and load them early (initramfs-tools, dracut and mkinitcpio)
  • Configure kernel arguments for systemd-boot (using kernelstub)
  • Configure kernel arguments for grub2
  • Provides you with the correct kernel arguments to add to your bootloader entry if a supported bootloader is not found

Contributing

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 like Bubble Tea to build a proper menu system for the project.

If you know golang, bubbletea, passthrough or qemu, you are welcome to help! Just make a pull request to the dev branch with your changes!
Just remember to add comments to document the work and explain it for people who are less familiar with the bash 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!

Features

  • Show general warning to user and inform about making a backup and general expectations
  • Detect if user has an amd or intel CPU and provide the correct IOMMU kernel args based on that
  • Use ls-iommu to find PCI devices like graphic cards, usb controllers, etc and see what IOMMU group they are in
  • Enable and configure vfio modules
  • Generate the correct kernel arguments for grub and systemd-boot~~
  • Dump the GPU rom, just in case it will be needed for passthrough~~ (no rom patching planned due to complexity)
  • A system you can navigate through, built using Bubble Tea (Help appreciated to make this menu better!)
  • Coloured highlight/text for important information? (not implemented yet)
  • Make sure vendor-reset module is loaded before vfio, check the repository for the list of cards that require it!

Features now handled by ls-iommu

  • Automatically handle GPUs where parts of it might be in separate IOMMU groups (ex: RX6600XT)
  • Fetch the ID and PCI Address of devices
  • Locate the vbios rom path on the system
  • Tell the user to enable IOMMU (VT-d/AMD-v) on their motherboard and bootloader
  • Get a list of devices, their IOMMU groups and various other information

Why GO?

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.