Skip to content

Instantly share code, notes, and snippets.

@SimonTod
Last active February 23, 2024 20:27
Show Gist options
  • Save SimonTod/72945457c4d7e741a382ba9ce9c4731b to your computer and use it in GitHub Desktop.
Save SimonTod/72945457c4d7e741a382ba9ce9c4731b to your computer and use it in GitHub Desktop.

Proxmox GPU Passthrough

Config :

  • Motherboard : ASUS PRIME B450M-A
  • CPU : AMD Ryzen 7 2700x
  • GPU : EVGA AMD RADEON R9 380 Series
  • Ram : DDR4 2133 MHz

Setting it all up

Update packages

apt update
apt ugrade

Change boot parameters Inside of /etc/default/grub change the following line to include:

GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt amd_iommu=on video=efifb:off"

update grub then reboot

update-grub
reboot

check IOMMU is enabled

dmesg | grep -e DMAR -e IOMMU

blacklist drivers from loading

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf
echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf 

enable modules

echo vfio >> /etc/modules
echo vfio_iommu_type1 >> /etc/modules
echo vfio_pci >> /etc/modules
echo vfio_virqfd >> /etc/modules

enable configuration

update-initramfs -u

find GPU PCI's IDs

lspci -v

find vendor's ID

lspci -n -s 08:00

configure module

echo "options vfio-pci ids=1002:6939,1002:aad8 disable_vga=1" > /etc/modprobe.d/vfio.conf

reboot

reboot

Create a new virtual machine inside of Proxmox. During the wizard make sure to select these things:

  • Create the VM using “SCSI” as the Hard Disk controller
  • Under CPU select type “Host”
  • Under Netwerk select Model “VirtIO”

After the wizard completes, we need to change a few things:

  • Next to linking the default DVD-ROM drive to a Windows 10 ISO (if you are passing through to windows), create a second DVD-ROM drive and link the VFIO driver ISO , you will need it while installing windows. Make sure the second DVD-ROM drive is assigned IDE 0
  • Under Options, change the BIOS to “OVMF (UEFI)”
  • Then under Hardware click Add and select “EFI Disk”
echo machine: q35 >> /etc/pve/qemu-server/110.conf

Now return to the web GUI and install Windows as normal. Because of the Hard Disk controller selected it won’t find a drive to install to during the install wizard but just select the ISO we linked to the second DVD-ROM drive and select the “vioscsi” directory.

Make sure you can remote control

GPU passthrough

echo "hostpci0: 08:00,x-vga=on,pcie=1" >> /etc/pve/qemu-server/110.conf

Sources

@fahadshery
Copy link

Hi very nice tutorial, could you feel me adjusting it for Ryzen 7 5700U iGPU? Much please

were you able to set it up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment