We will cover how to enable Proxmox GPU passthrough to a virtual machine in VE. As part of our Server Management Services, Bobcares offers solutions to every query that comes our way.
Configuring Proxmox GPU passthrough
GPU passthrough is a technology that permits the Linux kernel to present the internal PCI GPU directly to the virtual machine(VM). The device behaves as powered directly by the virtual machine, and the virtual machine detects the PCI device as if it were physically connected.
Step 1: Configuring the Grub
You can SSH directly into your Proxmox server, or utilize the noVNC Shell terminal under “Node” and open up the /etc/default/grub file using nano or any preferable text editor.
nano /etc/default/grub
Once you access the file search for the below command line :
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
Then change it to look like this:
For Intel CPUs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
For AMD CPUs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"
Once you are done editing /etc/default/grub run this command:
update-grub
Step 2: VFIO Modules
Next, you need to add a few VFIO modules to your Proxmox system, for that edit the file /etc/modules
nano /etc/modules
Add the following code to the /etc/modules file, then save and exit:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
Step 3: IOMMU interrupt remapping
Run the following commands in your Shell:
echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
Step 4: Blacklisting Drivers
Here we need to blacklist the drivers so that the Proxmox host system does not utilize our GPU(s), so run the below commands in your Shell:
echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf
Step 5: Adding GPU to VFIO
Run the command:
lspci -v
Check for the lines that show your video card. It'll look similAR like this:
01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1) (prog-if 00 [VGA controller])
01:00.1 Audio device: NVIDIA Corporation GP104 High Definition Audio Controller (rev a1)
Make note of the first set of values i.e “01:00.0 and 01:00.1, you will need that for next step.
Run the below command and replace 01:00 with the received value that you got next to your GPU when you ran the previous command:
lspci -n -s 01:00
Executing this command will output your GPU card’s Vendor IDs. Usually, one ID for the GPU and one more ID for the Audio bus. will show similar like this:
01:00.0 0000: 10de:1b81 (rev a1)
01:00.1 0000: 10de:10f0 (rev a1
We want to keep vendor id codes: 10de:1b81 and 10de:10f0.
Now, we will add GPU vendor ID to the VFIO:
echo "options vfio-pci ids=10de:1b81,10de:10f0 disable_vga=1"> /etc/modprobe.d/vfio.conf
Finally, update and restart by running the below command:
update-initramfs -u
To restart:
reset
Now your Proxmox host is successfully ready to pass through GPUs!
[Looking for a solution to another query? We are just a click away.]
Conclusion
To sum up, this guide is aimed at virtualization, particularly for Proxmox users. It is intended as an overall guide for passing through a GPU or multiple GPUs to Virtual Machine Proxmox GPU passthrough.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
Hi, i didn’t read good enough and i want to revert this. Can you help explaining how to revert?
Step 1 and Step 2 reverting was no problem. Step 3, 4 and 5 don’t know how to do this properly. System is running ok. Just a message on the screen:
[25.555353] kvm [1840]: ignored rdmsr: 0x10f data 0x0
[25.555395 kvm [1840]: ignored rdmsr: 0x123 data 0x0
[25.555422 kvm [1840]: ignored rdmsr: 0xc0011020 data 0x0
Thanks! Next time i use another test system 🙂
Hi,
Please contact our support team via live chat(click on the icon at right-bottom)
I’ve been struggling with GPU Passthru on Proxmox for… so long I’m embarrassed to admit. THANK YOU for this. I’ve got PLEX running in a VM and it’s *finally* utilizing the little Nvidia 1050Ti I’ve got in my PLEX server. Truly, thank you for this!
Hello Emil,
Thanks for the feedback.We are glad to know that our article helps you solves the issue.
Can you explain the doing for the igpu (Radeon Graphics) to passthrough?
Hi,
Please contact our support through live chat(click on the icon at right-bottom).
Thank you so much, worked perfectly with my Nvidia Quadro P600.
Hi Charles,
Thanks for the feedback.We are glad to know that our article was helpful for you.
Is it possible to use a passed through GPU as a display for a VM in proxmox. IE if I plug in a monitor to this GPU HDMI port will it work as a display for that VM? I’m wanting to use an i9 9900k as a proxmox node with a basic VM of win11 for basic tasks while having other VMs running in the background (TrueNAS, pfsense, PiHole, etc)
Hi,
Please contact our support team via live chat(click on the icon at right-bottom).