Skip to content

Instantly share code, notes, and snippets.

@igorzg
Last active July 8, 2022 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorzg/14d0e9416f986bfe9397f092e1243c1f to your computer and use it in GitHub Desktop.
Save igorzg/14d0e9416f986bfe9397f092e1243c1f to your computer and use it in GitHub Desktop.
AMD Ubuntu / Debian GPU Passthrough

It's correct vfio configuration for GPU Passthrough, you will need to change ids to your GPU pci slot.

packages

sudo apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-daemon-system libvirt-clients bridge-utils

Verify IOMMU is enabled

dmesg | grep IOMMU

Find out GPU ids

lspci -nn | grep -iP "VGA|audio"

change -> /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=pt vfio-pci.ids=1002:66af,1002:ab20"

update grub reboot!

append with correct ids -> /etc/initramfs-tools/modules

softdep amdgpu pre: vfio vfio_pci

vfio
vfio_iommu_type1
vfio_virqfd
vfio_pci

append with correct ids -> /etc/modules

vfio
vfio_iommu_type1
vfio_pci 

update initramfs reboot!

verify setup --->

lspci -vnn | grep -iP "vga|amdgpu|nvidia|nouveau|vfio-pci|audio"

Video -> https://www.youtube.com/watch?v=3yhwJxWSqXI

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