Skip to content

How-ToMotherboard

How to Pass Through a GPU in Proxmox VE for Local AI

How to pass a graphics card through to a Proxmox VE virtual machine for local AI: enabling IOMMU, loading VFIO, checking IOMMU groups, stopping the host using the GPU, q35/OVMF VM settings, then installing drivers and Ollama, plus fixes for Code 12, Error 43 and the AMD reset bug.

By , Systems & Technical Editor

8 min read

How to Pass Through a GPU in Proxmox VE for Local AI

The steps below follow the official Proxmox VE documentation (the Administration Guide's PCI(e) passthrough and kernel command line sections) and the Proxmox wiki's PCI Passthrough page, read on 24 November 2026. Passthrough depends heavily on your motherboard, CPU and graphics card, so not every system will behave the same way.

Proxmox VE is a free, open-source platform for running virtual machines (VMs) and containers on a home server. If you've got a spare PC with a decent graphics card, a popular setup is to run Proxmox on the bare metal and create a dedicated VM for local AI, with the graphics card passed straight through to it. The VM then sees the real GPU and can run CUDA, ROCm or Vulkan workloads such as Ollama, llama.cpp or ComfyUI, while the rest of the server carries on running your other VMs.

There's one big trade-off to understand first. According to the Proxmox documentation, once you pass a device through to a VM, you can't use it on the host or in any other VM. The Proxmox wiki also notes that VMs with passed-through devices can't be migrated to another node.

What you need

  • A CPU and motherboard with IOMMU support. Proxmox says your hardware needs IOMMU with interrupt remapping. On Intel this is VT-d and on AMD it's AMD-Vi. Most modern platforms support it, but Proxmox warns that consumer hardware doesn't always work perfectly and server-grade hardware often has better support.

  • A graphics card you can dedicate to the VM. It's much easier if the Proxmox host has another way to display a console, such as integrated graphics or a basic second card, although you'll usually manage the server through its web interface anyway.

  • A GPU with a UEFI-capable ROM if you want to use OVMF (UEFI) firmware for the VM, which Proxmox recommends for the best compatibility. Most modern GPUs have one.

  • Enough RAM and storage for the VM. Local AI models are large, so give the VM plenty of disk space for model files. Our guide to how much RAM you need for local AI helps with sizing.

Step 1: Enable IOMMU in the BIOS

Reboot into your motherboard's BIOS or UEFI setup and enable IOMMU support. Proxmox says the setting is usually called IOMMU or VT-d, but the exact name depends on your board, so check its manual. The Proxmox wiki also notes that your CPU has to support hardware virtualisation, so make sure the CPU virtualisation option is enabled too if your board lets you turn it off.

According to the Proxmox documentation, IOMMU is enabled by default with AMD CPUs, and with recent kernels (6.8 or newer) this is also true for Intel CPUs. On older kernels, Intel systems need intel_iommu=on adding to the kernel command line.

Step 2: Optionally enable IOMMU passthrough mode

Proxmox says enabling IOMMU passthrough mode may improve performance, because VMs bypass the default DMA translation done by the hypervisor. To use it, add iommu=pt to the kernel command line.

Where you edit the kernel command line depends on the bootloader:

  • GRUB: add the option to the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub, then run update-grub.

  • systemd-boot: add it to the single line in /etc/kernel/cmdline, then run proxmox-boot-tool refresh.

Step 3: Load the VFIO modules

VFIO is the Linux framework that hands a device over to a VM. Proxmox's documentation says to make sure these three modules load at boot by adding them, one per line, to a file such as /etc/modules-load.d/vfio.conf:

vfio
vfio_iommu_type1
vfio_pci

Then refresh the initramfs and reboot:

update-initramfs -u -k all

After the reboot, lsmod | grep vfio should list all three modules.

Step 4: Check that IOMMU is working

Run this on the Proxmox host:

dmesg | grep -e DMAR -e IOMMU -e AMD-Vi

Proxmox says you should see a message showing that IOMMU, Directed I/O or Interrupt Remapping is enabled; the exact wording varies by hardware and kernel. The wiki explains that interrupt remapping is required, and you can check for it with dmesg | grep 'remapping', looking for a line such as AMD-Vi: Interrupt remapping enabled or DMAR-IR: Enabled IRQ remapping in x2apic mode.

Step 5: Check the GPU's IOMMU group

For passthrough to work, the graphics card needs to be in its own IOMMU group. You can check with the Proxmox API (replace {nodename} with your node's name):

pvesh get /nodes/{nodename}/hardware/pci --pci-class-blacklist ""

Proxmox says it's fine if the GPU shares a group with its own functions, such as the card's HDMI audio device, or with its root port or PCIe bridge. If it's grouped with unrelated devices, the documentation suggests trying the card in a different PCIe slot, as some platforms handle their slots differently. This is where motherboard choice matters: if you're buying hardware for a Proxmox AI server, look for owners' reports of clean IOMMU grouping on the board you're considering.

Step 6: Stop the host from using the GPU

Proxmox tries to make a passed-through device unavailable to the host automatically. If that doesn't work, the documentation gives two options.

First, find the card's vendor and device IDs with:

lspci -nn

The IDs appear in square brackets at the end of each line, for example [10de:1d01]. Remember to note the IDs for the card's audio function too.

Then either:

  • Pass the IDs to vfio-pci by adding a line like options vfio-pci ids=1234:5678,4321:8765 to a .conf file in /etc/modprobe.d/, or

  • Blacklist the host driver by finding its name with lspci -k and adding blacklist DRIVERNAME to a .conf file in /etc/modprobe.d/.

For either method, update the initramfs and reboot. Proxmox adds that if the host driver still grabs the card first, you can add a soft dependency so vfio-pci loads before it, for example softdep DRIVERNAME pre: vfio-pci.

To confirm it worked, run lspci -nnk and check the GPU's entry. If it says Kernel driver in use: vfio-pci, or there's no "in use" line at all, the card is ready for passthrough.

Step 7: Create the VM and add the GPU

When you create the VM, Proxmox recommends these settings for the best compatibility with GPU passthrough:

  • Machine type: q35

  • BIOS: OVMF (UEFI), which needs an EFI disk. If your GPU's ROM isn't UEFI-capable, use SeaBIOS instead.

Then add the graphics card in the VM's Hardware tab as a PCI device (Proxmox's documentation calls it a "Host PCI" device). Tick All Functions so the card's audio device goes with it, and enable the PCIe option, which Proxmox says is only available on q35 machines. You can do the same from the command line:

qm set VMID -hostpci0 02:00,pcie=on

Replace VMID with your VM's number and 02:00 with your card's address from lspci. Using the short address without the .0 passes through all of the card's functions together. Proxmox's own example adds x-vga=on to make the card the VM's primary GPU, but you only need that if you want the card to drive a display for the VM.

For a local AI server you usually don't. The documentation points out that you can't see a passed-through GPU's output in the Proxmox web console. If you just want to use the card as an accelerator for CUDA or similar workloads, you don't need a monitor attached; you can manage the VM over SSH or remote desktop instead.

Step 8: Install drivers and your AI tools in the VM

Once the VM boots with the GPU attached, install its drivers just as you would on a physical PC. For an Ubuntu VM with an NVIDIA card, follow our guide to installing NVIDIA drivers on Ubuntu for local AI. For an AMD card, see running local AI on an AMD Radeon GPU.

Then install your AI software. Installing Ollama on Linux is a good place to start, and you can add Open WebUI for a browser-based chat interface. To use the AI VM from other PCs in your home, see how to share Ollama on your local network. Finally, check that Ollama is using your GPU rather than quietly falling back to the CPU.

Troubleshooting

The Proxmox wiki lists several common problems and fixes:

  • "BAR0 is 0M" in a Linux VM, or Code 12 in Windows Device Manager: this one is especially relevant to AI cards. The wiki explains it happens when a GPU with a large amount of VRAM is passed to a VM using OVMF, because OVMF's default 32GB window for 64-bit PCI memory isn't enough for GPUs with 24GB of VRAM or more. Its suggested fixes are to use the host CPU type, to set phys-bits to host (possibly with the pdpe1gb flag), to set a larger MMIO window manually, or to use SeaBIOS instead of OVMF.

  • Error 43 in a Windows VM: if Resizable BAR (also called Smart Access Memory) is enabled in your BIOS, the wiki says you may need to disable it. Trying a different vBIOS can also help.

  • AMD card doesn't work after the VM restarts: some AMD cards suffer from the "AMD reset bug", where the GPU doesn't reset properly. The wiki points to the vendor-reset patch as a remedy.

  • "Interrupt Remapping hardware not found" errors: the wiki explains that you can allow unsafe interrupts with options vfio_iommu_type1 allow_unsafe_interrupts=1, but the Proxmox documentation warns this can make your system unstable, so treat it as a last resort.

  • NVIDIA software refuses to run in a VM: the wiki says this should no longer be an issue with NVIDIA drivers 465 and newer.

  • Black screen in the web console: the Proxmox documentation says the web console can't show a passed-through GPU's output, so use remote access or a monitor connected to the card. If you're only using the GPU for compute, the wiki suggests you can leave the "primary GPU" option off.

Our verdict

GPU passthrough in Proxmox VE is a good way to turn a home server into a dedicated local AI machine while keeping your other VMs running on the same hardware. The process boils down to enabling IOMMU, loading the VFIO modules, making sure the graphics card sits in its own IOMMU group and stopping the host from claiming it, then adding it to a q35 VM with OVMF and PCI-Express ticked. Once it's working, the VM uses the card much like a normal PC would, so you can install Ollama, Open WebUI or ComfyUI as usual. Just remember that the card belongs to that one VM, and that IOMMU grouping and reset behaviour vary between motherboards and GPUs, so check reports for your hardware before you start.

The bottom line

GPU passthrough in Proxmox VE is a good way to turn a home server into a dedicated local AI machine while keeping your other VMs running on the same hardware. The process boils down to enabling IOMMU, loading the VFIO modules, making sure the graphics card sits in its own IOMMU group and stopping the host from claiming it, then adding it to a q35 VM with OVMF and PCI-Express ticked. Once it's working, the VM uses the card much like a normal PC would, so you can install Ollama, Open WebUI or ComfyUI as usual. Just remember that the card belongs to that one VM, and that IOMMU grouping and reset behaviour vary between motherboards and GPUs, so check reports for your hardware before you start.

Sources

  1. 01Proxmox VE Administration Guide, QEMU/KVM Virtual Machines: PCI(e) Passthrough
  2. 02Proxmox VE Administration Guide, Host System Administration: Editing the Kernel Commandline
  3. 03Proxmox VE wiki, PCI Passthrough

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Set Up a UPS to Shut Down Your PC Automatically

How-To

How to Set Up a UPS to Shut Down Your PC Automatically

How to make a UPS shut your PC down automatically in a power cut: connect the UPS's USB data cable, install the maker's software (CyberPower PowerPanel Personal as the example), choose Keep Computer Running or Preserve Battery Power, pick shutdown or hibernation, then test it.

Marcus Thorne7 min

Clonezilla vs Rescuezilla: Which Free Disk Imaging Tool Should You Use?

Versus

Clonezilla vs Rescuezilla: Which Free Disk Imaging Tool Should You Use?

Clonezilla vs Rescuezilla: both are free bootable disk imaging and cloning tools that share an image format. Clonezilla adds network destinations, encryption, scripting and mass deployment; Rescuezilla offers a point-and-click desktop, image browsing and extra rescue tools.

Callum Reid6 min

ShareX vs Snipping Tool: Which Free Screenshot Tool Should You Use?

Versus

ShareX vs Snipping Tool: Which Free Screenshot Tool Should You Use?

ShareX vs Snipping Tool: Windows' built-in Snipping Tool is quick and now does local OCR and video snips, while free, open-source ShareX adds scrolling captures, richer annotation, automated after-capture tasks, uploads and many extra tools. Here's which suits you.

Callum Reid7 min

How to Set Up SillyTavern with a Local LLM Using KoboldCpp

How-To

How to Set Up SillyTavern with a Local LLM Using KoboldCpp

How to set up SillyTavern with a local LLM: installing it on Windows or Linux, loading a GGUF model in KoboldCpp, connecting the two, tuning GPU layers to fit your graphics card's VRAM, adjusting context settings and fixing common problems.

Marcus Thorne8 min