GPU passthrough to an appVM as opposed to standalone?

I want to use my gpu run run AI models. All the guides I’ve seen regarding gpu passthrough say to make a standalone qube. Is there a known way to do this but with a typical template+appVM setup as opposed to using a standalone qube?

I have managed to attach my gpu to my appVM but installing the drivers into the template is where I’m having issues. I plan on running Ollama/open webui. Not running agents or anything like that.

Yes, there’s no reason why it shouldn’t work with an AppVM. Just install the drivers in the TemplateVM and then create an AppVM HVM with the PCI devices attached.

I would argue if its even worth to create a separate template for it.

I think the base template for all the others vms should also be expanded to allow for hvm/gpu boots. Same as locker docker installs, let all vm’s have it …

Sure, but you have to keep two things in mind:

  1. In certain situations (all in my case), the Template/AppVM’s GUI would just simply not work at all without the GPU when GPU drivers are installed: Cannot launch application in TemplateVM after installing `nvidia-driver-full` (unless GPU is passed through) · Issue #10485 · QubesOS/qubes-issues · GitHub . Maybe it’s possible to make some funky X11 config that would fix that.
  2. GPU driver installation (at least for Nvidia) requires you to use the in-VM kernel, which necessitates using a HVM. Using PVH qubes is better unless you really have to use HVM, so I wouldn’t do that for all my Qubes.