Hello everyone, I am currently building my small homelabs system using my old AMD FX-8350 processor. I am running the latest Proxmox 6.2.4 and it works very well. But lately, I want to do something different. Proxmox supports the GPU passthrough which is interesting. We can assign and use the power of our GPU to one of the virtual machine. There are some steps to do the GPU passthrough. It is not super simple but doable. We will get through there in a moment.
This tutorial is based on the AMD processor. There are some pretty basic differences between AMD and Intel processor. You can visit the official guide on Proxmox website. If you are new to Proxmox and GPU passthrough things, it is better to read it first.
Steps to Enable GPU Passthrough on Proxmox 6.2
Step 1. BIOS Settings
It is important to set the BIOS prior to the GPU passthrough. You will need to enable the VT-d, Virtualization as well as UEFI.
Step 2. Enable the IOMMU
This step will enable the IOMMU by editing the Grub. I would recommend you to connect to the server via ssh from other computer.
On the host machine, we are going to edit the grub.
Now find the following line
And then change the line into this one
Close and save the editor and reboot Proxmox server. After reboot, connect via SSH again and run this command to confirm.
dmesg | grep -e DMAR -e IOMMU
You should see something like this:
If it returns nothing, then something is wrong. You need to check your hardware configuration and/or maybe there are some unsupported hardware.
Step 3. Load Additional Kernel Modules
Here we are going to add some modules to our Proxmox server. Add the following lines to /etc/modules
vfio vfio_pci vfio_virqfd
Close and save the file. And then reboot the server again.
Step 4. Verify the IOMMU Interrupt Remapping
It is important to make sure that our system supports the Interrupt Remapping. To check, use this command
dmesg | grep 'remapping'
You should see something like this
AMD-Vi means the interrupt remapping is enabled so we are good to go from here. And you can also use this command for more results.
dmesg | grep -e DMAR -e IOMMU
Step 5. Get GPU id
Now we need to get our GPU id and configure the Proxmox. Execute this command to get the GPU id and the associated vendor id.
As you can see, my Graphic card id is 01:00. Now lets run another command to get the vendor id
lspci -n -s 01:00
01:00.0 0300: 1002:67df (rev ef)
01:00.1 0403: 1002:aaf0
Due take a note of the vendor id shown. In this case, 1002:67df and 1002:aaf0
With this vendor id, we need to assign these two values to vfio. Use this command and don’t forget to change the vendor ids with yours.
echo "options vfio-pci ids=1002:67df,1002:aaf0" > /etc/modprobe.d/vfio.conf
Reboot Proxmox VE. So basically, we were done configuring the Proxmox host to provide the GPU passthrough feature. Next, we are going to create a new VM that will be used for Windows 10.
Step 6. Create a New VM
Here we are going to create a new VM. But do not start it because we will add some configuration to this new VM manually.
Create a new VM from the Proxmox web interface. But make sure you choose or use the following settings:
- BIOS: OMVF (UEFI)
- Machine: q35
Follow the wizard until it completes and then install Windows 10 completely. Make sure you set the Remote Desktop on the newly installed Windows 10 because after we configure GPU passthrough, you won’t be able to use the console from the Proxmox web dashboard. Once you set up the remote desktop. Shutdown the VM.
Step 7. Additional Configuration for Windows 10 VM
Now lets SSH to the Proxmox server once again and edit the new Windows 10 vm conf. In this example, my new Windows 10 conf file is in /etc/pve/qemu-server/102.conf. Add the following lines to the config file.
Here is my full config screenshot
If we switch to the Proxmox web console in the hardware section, it looks like this.
As you can see, there is a PCI Device (hostpci0) at the end of my hardware list.
Now start the Windows 10 VM and remote desktop to it. Check if the Graphic card is detected and active in your Windows 10 VM.
Alternatively, you can also use a monitor connected to your VGA card and use the Windows 10 VM on that monitor. If you do this, you may also want to passthrough the mouse and keyboard as well.