Skip to content
VRAM Lab

A homelab for local AI: hardware, Proxmox and GPU passthrough

How to build a server for language models that will not bankrupt you on power, and how to pass a graphics card through to a Proxmox virtual machine step by step.

4 minutes read Czytaj po polsku

Share
A row of drives in a server rack with green status LEDs
A row of drives in a server rack with green status LEDs. Photo Domaintechnik / Unsplash
On this page (13)
  1. Key takeaways
  2. Choosing the hardware
  3. Graphics card: VRAM above all
  4. Everything else
  5. Proxmox: GPU passthrough step by step
  6. 1. BIOS
  7. 2. Kernel parameters
  8. 3. VFIO modules
  9. 4. Bind the card to vfio-pci
  10. 5. The virtual machine
  11. Alternative: an LXC container
  12. Summary
  13. FAQ

Key takeaways

  • For language models, the amount of VRAM decides what you can run, not raw compute.
  • A used RTX 3090 with 24 GB is still the best memory-to-price ratio.
  • Passthrough needs IOMMU in the BIOS, the VFIO modules and the card in its own IOMMU group.
  • LXC lets several containers share one GPU at the cost of isolation.

A gaming PC can handle an 8B model. But when you want a model available 24/7 for the whole household, next to Home Assistant, a NAS and a few other services, a proper server with virtualisation makes sense. This is the one used for the articles on this blog.

Server
Hypervisor
Proxmox VE 9
CPU
AMD Ryzen 9 5950X
GPU
NVIDIA RTX 3090 24 GB (used)
RAM
128 GB DDR4 ECC
Storage
ZFS mirror 2× 2 TB NVMe
PSU
1000 W, 80+ Gold
Power draw
~95 W idle, ~420 W under load

Choosing the hardware

Graphics card: VRAM above all

With language models, the amount of memory decides what you can run, and raw compute comes second. That is why a used RTX 3090 with 24 GB is still one of the most sensible choices for a home lab. Newer cards with the same amount of memory cost several times more, and for text generation they are faster by far less than gaming benchmarks suggest.

OptionVRAMProsCons
RTX 3060 12 GB12 GBcheap, efficientmodels up to ~14B only
RTX 3090 (used)24 GBbest GB per dollar350 W, runs hot
2× RTX 309048 GB70B models at Q4PSU, board, cooling
Mac / APU with unified memory64–128 GBhuge models, silentslower prompt processing

Everything else

  • RAM: at least as much as VRAM, ideally twice as much. Models load from disk through RAM, and with offloading some layers stay in system memory.
  • Storage: NVMe. Loading a 40 GB model from a SATA drive is painfully slow.
  • PSU: with headroom. 30-series cards can spike well above their nominal TDP for short moments.

Proxmox: GPU passthrough step by step

Passthrough hands the whole physical card to a virtual machine. The VM sees it as if it were plugged directly into its own motherboard, and you install the regular NVIDIA drivers inside it.

1. BIOS

Enable:

  • SVM / AMD-V (Intel: VT-x),
  • IOMMU (Intel: VT-d),
  • Above 4G Decoding and preferably Resizable BAR.

2. Kernel parameters

On AMD, IOMMU is on by default, on Intel you have to enable it. In both cases it is worth adding iommu=pt. If the system boots with GRUB:

/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt"

On Intel also add intel_iommu=on. Then:

update-grub

If your root is on ZFS and you boot with systemd-boot, the parameters go to /etc/kernel/cmdline and instead of update-grub you run proxmox-boot-tool refresh.

3. VFIO modules

/etc/modules
vfio
vfio_iommu_type1
vfio_pci

4. Bind the card to vfio-pci

Find the IDs of the card and its audio controller:

lspci -nn | grep -i nvidia
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3090] [10de:2204]
01:00.1 Audio device [0403]: NVIDIA Corporation GA102 High Definition Audio Controller [10de:1aef]

Assign both IDs to vfio-pci and keep the host's graphics drivers away from the card:

echo "options vfio-pci ids=10de:2204,10de:1aef" > /etc/modprobe.d/vfio.conf
echo "softdep nvidia pre: vfio-pci" >> /etc/modprobe.d/vfio.conf
printf "blacklist nouveau\nblacklist nvidia\n" > /etc/modprobe.d/blacklist-gpu.conf
update-initramfs -u -k all
reboot

After the reboot check that the card got the right driver:

lspci -nnk -s 01:00

The Kernel driver in use line must say vfio-pci.

5. The virtual machine

When creating the VM in Proxmox set:

  • Machine: q35,
  • BIOS: OVMF (UEFI) with an EFI disk,
  • CPU: type host,
  • Memory: disable ballooning, because passthrough requires all memory to be reserved.

Then Hardware → Add → PCI Device, select the card and tick All Functions and PCI-Express. Leave Primary GPU unticked if the VM runs headless.

Inside the guest you install the NVIDIA drivers as on any regular computer, and nvidia-smi should show the card. From there you can set up everything from the article on Ollama and Open WebUI.

Alternative: an LXC container

Passthrough reserves the card for a single VM. If you want several containers to use the GPU at once (for example Ollama, Jellyfin for transcoding and Frigate), install the NVIDIA driver on the host and pass the /dev/nvidia* devices through to LXC containers. The driver version on the host and in the containers must match exactly. You get less isolation but more flexibility.

Summary

A well-configured passthrough performs almost exactly like bare metal, and in return you get snapshots, backups and the freedom to run several systems on one machine. Most of the trouble usually comes from the BIOS and IOMMU groups, not from Proxmox itself.

FAQ

Does GPU passthrough slow the model down?

Practically not. The VM uses the card directly, so the difference compared to bare metal is within measurement error.

Can I use the same card in several VMs at once?

Not with regular passthrough. Several LXC containers can share a card, and virtual GPUs (vGPU) require enterprise cards and licences.

What if the card shares an IOMMU group with other devices?

Move it to another PCIe slot, ideally one wired directly to the CPU. On some boards a BIOS update helps too.

Found it useful? Pass it on.

Share
Esc
↑↓ select↵ openCtrl K or / to search