Skip to content

Instantly share code, notes, and snippets.

@igorzg
Last active July 11, 2022 09:05
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/eaecc5764228dd9738f6022694c1c01f to your computer and use it in GitHub Desktop.
Save igorzg/eaecc5764228dd9738f6022694c1c01f to your computer and use it in GitHub Desktop.
AMD Fedora GPU Passthrough

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

packages

sudo dnf group install virtualization

Verify IOMMU is enabled

dmesg | grep IOMMU

Find out GPU ids

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

change -> /etc/default/grub

GRUB_CMDLINE_LINUX="rhgb quiet amd_iommu=pt pci-stub.ids=1002:66af,1002:ab20,12ab:0710"

update grub

grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)"

reboot!

append with correct ids -> /etc/modules-load.d/vfio-pci.conf

softdep amdgpu pre: vfio vfio_pci

vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_amd

append -> /etc/dracut.conf.d/gpu-passthrough.conf

add_drivers+=" vfio vfio_iommu_type1 vfio_pci vfio_virqfd "

update dracut

sudo dracut --force /boot/initrd $(uname -r)

reboot!

verify setup --->

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

https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-virtualization/

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