Proxmox | GPU Passthrough to unRAID VM

Running unRAID as a VM in Proxmox and passthrough the GPU to unRAID to be used for Docker containers (Plex, Frigate, etc.).

Proxmox | GPU Passthrough to unRAID VM

Proxmox Node

Run Shell in Proxmox Node

Enable IOMMU in GRUB

# edit GRUB
nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream multifunction nofb nomodeset video=vesafb:off efifb:off"

# CRTL + x to save and exit

# update grub

# verify that IOMMU is enabled
dmesg | grep -e DMAR -e IOMMU

# output should show something like
# [    0.236701] DMAR: IOMMU enabled

# reboot the node | shutdown VMs

Add Virtual Function IO (vfio) kernel modules to load in boot

# edit /ect/modules
nano /ect/modules

# check that these lines exist already, if not add them

# CRTL + x to save and exit

# reboot the node | shutdown VMs

IOMMU interrupt remapping

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

Prevent Proxmox from loading drivers

Blackist drivers, so that Proxmox does not load these, you want to use VFIO

# edit blacklist
nano /etc/modprobe.d/pve-blacklist.conf

# add lines
blacklist nvidiafb
blacklist nvidia
blacklist radeon
blacklist nouveau

Adding GPU to VFIO & Verify which driver is loaded

lspci -v
# The first device is the Graphics controller 17:00.0
# Second device is the GPU Cards Audio device 17:00.1

# you should see something like

Kernel Driver in use: vfio-pci

lspci -n -s 17:00

# you should see something like

17:00.0 0300: 10de:1f82 (rev a1)
17:00.1 0403: 10de:10fa (rev a1)
# Add the GPU’s vendor id’s to the VFIO (remember to replace the id’s with your own!):

echo "options vfio-pci ids=10de:1f82,10de:10fa disable_vga=1"> /etc/modprobe.d/vfio.conf

# Run
update-initramfs -u

# And reboot

Add the GPU to unRAID VM

Note: unRAID won't boot if there is no display defined

My unRAID VM settings

Add hardware

Select the Device

Check "All Functions", "ROM-Bar" and "PCI-Express"

and start the unRAID VM

Check below how to install NVIDIA drivers in unRAID and how to unlock the drivers.

UnRAID | Nvidia GPU & Unlocking the drivers

Proxmox | unRAID as a VM