Pci gpu passthrough idiots guide?

genesis1

Member
Feb 3, 2022
99
3
8
I've been reading up on how to setup pci pass through. As I mentioned before in other posts, I'm totaly new to all this. I'm running the latest proxmox version and after checking it seems most of the settings are already set for the gpu to pass through. There is one more setting I haven't typed in yet on the host, but before I go further I wanted to ask a few questions. I've read that for it to work, I can't have the gpu enabled on the host if I want the gpu enabled in the guest.
What I'm nervous of is if I disable in the host will this mean there will be no image to the screen of my host pc anymore?
I wouldn't want to make changes that mess up my proxmox server so I cannot see the host login info.

I guess what I need, and anyone else totaly new to this is an idiots step by step guide.
A lot of the info on here and other websites automatically assumes your experienced and know a lot about the commands you need to type in first to get to certain folders and how to save etc.

If anyone can point me to a step by step guide that would be a big help. Thanks in advance.
 
PCI(e) passthrough is dependent on so many things that I think such a one guide fits all is impossible. It's always trial and error and updates can sometimes break a working setup.

If you are (planning to) passing through the same GPU that is used to boot the Proxmox host, it is always more complex and some might never work. You are right to worry about having access to the Proxmox host console in case anything goes wrong. Do you have another computer that can access the Proxmox host via SSH and web GUI?

Maybe you can tell us what motherboard you are using and what GPU? People here can then maybe explain the steps needed for your particular setup.
 
Also don't set the VM that is using passthrough to autostart after boot until you know that everything is working fine.

And yes, if you passthrough your only GPU your host cant use it anymore so you wont get local access to the console.
 
Last edited:
  • Like
Reactions: leesteken
Thanks for that info. We'll don't laugh, but as this is my very first experiment using a pc as a server it's a very old system. It's a socket 775 dx2400 motherboard running a core2 quad q9450. Gpu is a gt710.

In answer to the other question, yes I have other pc's that can access via ssh through cmd prompt in Windows.
 
The Q9450 does support VT-d but I don't know anything about that motherboard. There have been issues with HP stuff not supporting IOMMU in (older) BIOS (versions), but I have no experience.

I guess you want to enable IOMMU via the bootloader. Do you have a ZFS rpool and boot in UEFI mode? Otherwise, add intel_iommu=on to the Linux kernel command line in /etc/default/grub. Run update-grub or proxmox-boot-tool refresh and reboot to activate.
Next, check the IOMMU groups, which will also tell us if IOMMU is enabled in BIOS and the Linux kernel: for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nns "${d##*/}"; done. Maybe you can attach the output as a file?
 
Most of whats listed to add under a tutorial is already present in the grub file (etc/default/grub) except for this part 'pcie_acs_override=downstream,multifunction nofb nomodeset' mine reads like this '

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=vesafb:eek:ff video=efifb:eek:ff"

If i add anything and i get it messed up can i revert back to how it was originaly by removing what i added? iIs there any default back up?

The other items listed in the tut im following show this to be added '
edit the file /etc/modules
nano /etc/modules

Add the following (copy/paste) to the /etc/modules file:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

I checked and they are already present.

(Sorry for some reason wierd smileys appear when i write the code on here.)
 
Last edited:
video=vesafb:off video=efifb:off might be necessary but it is also what will prevent you from seeing boot messages and a host console when things go wrong.
Please don't use pcie_acs_override until you have had a close look at the IOMMU groups.
Blacklisting drivers and interrupt remapping might not even be necessary. iommu=pt has nothing to do with passthrough and nofb nomodeset are also not needed.

I you are still seeing boot messages and a console, then it did not activate. What does cat /proc/cmdline show? Are all BIOS settings about IOMMU and ACS Enabled (not just on Auto)? Are you on the latest BIOS version?
 
Last edited:
BOOT_IMAGE=/boot/vmlinuz-5.13.19-2-pve root=/dev/mapper/pve-root ro quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction nofb nomodeset video=vesafb:eek:ff video=efifb:eek:ff

nofb nomodeset and iommu=pt are already set I didnt add them. Its how proxmox 7 was from the start.
 
Last edited:
Looks like the settings are applied. Do you no longer have a console on the Proxmox system, just a black screen?

Probably a BIOS setting related to IOMMU, ACS or VT-d is not set to Enabled. Or maybe the motherboard does not support VT-d? Do you have a link to more information about the motherboard?

If it is this motherboard with a Intel G33 chipset, then it does not support VT-d. PCI(e) passthrough will not work.
 
Last edited:
I still have console on Proxmox system. Motherboard:
CPU

  • Intel Core 2 Quad (Y) Q9xxxx
  • Intel Core 2 Duo (W) E8xxx
  • Intel Core 2 Quad (K) up to Q6600
  • Core 2 Duo E6x00 (C) up to E6700
  • Core 2 Duo E4x00 (C) up to E4400
Memory

  • Dual channel memory architecture
  • Four 240-pin DDR2 DIMM sockets
  • Supported DIMM types:
  • PC2-5300 (667 MHz)
  • PC2-6400 (800 MHz)
  • Non-ECC memory only, unbuffered
  • Supports 2GB DDR2 DIMMs
  • Supports up to 8 GB on 64 bit PCs
  • Supports up to 4 GB* on 32 bit PCs
Expansion Slots

  • One PCI
  • One PCI Express x16
  • Two PCI Express x1
I/O Ports

  • PS/2 mouse port (green)
  • RJ45 Network (LAN)
  • Audio: Line In (light blue)
  • Audio: Line put (lime)
  • Audio: Microphone (pink)
  • 4 x USB 2.0 ports
  • 14 - PS/2 keyboard (purple)
Form Factor

  • Micro-ATX: 24.5 cm (9.6 inches) x 24.5 cm (9.6 inches)
 
There is a VT-d setting in the bios. That was the first thing enabled before installing proxmox.
 
Done a bit more reading and it states- 'To have separate IOMMU groups, your processor needs to have support for a feature called ACS (Access Control Services). Make sure you enable the corresponding setting in your BIOS for this.'

When i run this command: find /sys/kernel/iommu_groups/ -type l i get no list of groups, so i guess this old processor doesnt support ACS so even though passthrough is activated it wont work. Damn, i guess thats the end of my experiment with Proxmox, as using an OS with no graphics acceleration gives poor performance.
 
I forgot that the motherboard (of that era) might have a built-in GPU, which makes GPU passthrough easier.
Are you on the newest HP BIOS? Maybe a newer version has support for ACS?
Are you sure you have a Q35, Q45, X38 or X48 chipset on the motherboard? Maybe you can check the part-number of the chip(s) on the motherboard or find out via lspci -nn?
Indeed a GPU or a faster CPU with more cores do give a better VM experience, but running Linux VMs with a lighter desktop environment might also help.
Or use the Proxmox host to run Linux containers for services. Some people have gotten containers to work with a GPU as well.
 
I forgot that the motherboard (of that era) might have a built-in GPU, which makes GPU passthrough easier.
Are you on the newest HP BIOS? Maybe a newer version has support for ACS?
Are you sure you have a Q35, Q45, X38 or X48 chipset on the motherboard? Maybe you can check the part-number of the chip(s) on the motherboard or find out via lspci -nn?
Indeed a GPU or a faster CPU with more cores do give a better VM experience, but running Linux VMs with a lighter desktop environment might also help.
Or use the Proxmox host to run Linux containers for services. Some people have gotten containers to work with a GPU as well.
I could try a converted E5 5450 that converted to run on socket 775. Maybe that would have ACS??? I dont know. I will try and check the chipset.
 
I could try a converted E5 5450 that converted to run on socket 775. Maybe that would have ACS??? I dont know. I will try and check the chipset.
I don't think so; you need motherboard (chipset and BIOS) support. But unless you insist on running Windows, you might be better off with a lighter alternative anyway.
 
Well I have Win 11 and a Mac High Sierra running at the moment on Proxmox. I just wanted to get GPU acceleration, but I may have to give up on that untill maybe i invest in a newer motherboard and cpu.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!