Skip to content

Instantly share code, notes, and snippets.

@fguisso
Last active May 29, 2023 17:36
Show Gist options
  • Save fguisso/b6ef0d387d80cf048a763d8418596ed4 to your computer and use it in GitHub Desktop.
Save fguisso/b6ef0d387d80cf048a763d8418596ed4 to your computer and use it in GitHub Desktop.
PVE Windows Passthu GPU Radeon

edit grub

vi /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"
or
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

then restart grub update-grub command

Remmaping/blocklist drivers

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/backlist.conf
echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf

Adding the GPU

lsbpci -v list your hardware and get the VGA id

lspvi -n -s <id> example lspci -n -s 04:00.0

echo "options vfio-pci ids=<id>,<idN> disable_vga=1" > /etc/modprobe.d/vfio.conf

refreshs this configs update-initramfs -u

Reset

reset

Create VM

Download ISOs

Windows and virtio-win

Initial Setup

image image image image image

VM config

vi /etc/pve/qemu-server/<vm-id>.conf

# add two lines
cpu: host,hidden=1,flags=+pcid
args: -cpu 'host,+kvm_pv_unhalt,+kvm_pv_eoi,hv_vendor_id=NV43FIX, kvm=off'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment