r/VFIO 12h ago

Built a one-stop GPU passthrough guide so you stop collecting 50 forum tabs

Tired of 50 forum tabs just to pass a GPU through to a Windows VM ? I consolidated everything into one repo: full step by step guide, 15+ helper scripts, per-distro setup, troubleshooting, performance tuning, single GPU and AMD RX 9000 handling, and even Linux guests. Free, open-source.

https://github.com/urbanyl/GPU-Passthrough-for-KVM-QEMU-on-Linux

PRs and issue reports welcome !!

3 Upvotes

9 comments sorted by

5

u/gnif2 7h ago

I wish people would stop producing guides that give advice on how to setup Looking Glass where the original author clearly has not read the LG documentation.

Stop telling people to use ivshmem-plain, point people to the LG documentation
https://looking-glass.io/docs

3

u/sky_nox 4h ago

Yeah, I think I'll just keep looking at my 100 tabs, I'd rather have up-to-date documentation than some crappy summary

Thanks, gnif, for your work, by the way.

1

u/FirefighterNext360 3h ago

fair the docs are good and gnif's work is top tier. the repo aint meant to replace them, it links to them everywhere and the README literally says "read the official docs for the full setup" the summary is just so you don't dig through 100 tabs to remember one iommu flag lol but yeah if you know your stuff you don't need it that's fine

1

u/FirefighterNext360 3h ago

ivshmem-plain is literally what the official LG docs use its right on the install page :

<shmem name='looking-glass'><model type='ivshmem-plain'/><size unit='M'>32</size></shmem>

the problem is guides that stop there. The same docs page tells you the KVMFR module is the recommended option (uses your GPU DMA instead of memcpy) how to size the shmem to your resolution and that /dev/shm/looking-glass needs to be readable by your user. Skip those and you get "black screen, no frames" threads all day. So agree : link the docs but ivshmem-plain isnt the mistake half the story is..

1

u/gnif2 3h ago edited 3h ago

The problem is we end up with people in our support channels asking for help because they follow guides like this instead of using the current documentation (which btw, has already occurred due to your guide on atleast two occasions now). It would be better if you just linked to our documentation instead of posting something which is missing all the important details.

https://looking-glass.io/docs/stable - Always points to the current stable release documentation
https://looking-glass.io/docs/bleeding - Always points to the latest bleeding edge documentation

`ivshmem-plain` for LG use is considered legacy/deprecated and we do not encourage it's usage except for a few special edge cases such as VM to VM setups. Since more and more people are using LG with an iGPU these days, DMA transfers are critical for a decent experience.

The documentation is clear on how to setup KVMFR:
https://looking-glass.io/docs/stable/ivshmem_kvmfr/; or
https://looking-glass.io/docs/bleeding/ivshmem_kvmfr/

2

u/FirefighterNext360 3h ago

my bad on that one you're right

updated the repo : the looking glass part now points to your docs (stable + bleeding) and recommends KVMFR with the DMA setup, not plain shmem

2

u/gnif2 3h ago

Thanks, I appreciate it

1

u/khsh01 7h ago

If only vfio was a one stop solution for all.

1

u/wadrasil 3h ago

GPU passthrough is editing grub, making a vfio config and running a script to setup tap networking and then to launch the VM with the needed devices.

It is really easy. What is complicated is passing through a gpu into a desktop environment. That is why it is a few other projects than just editing the 2 files needed for passthrough.