Disclaimer: This guide may not work for you because of the differences between motherboards or GPUs.
My computer specs are :
– Ryzen 5 1600
– Asus Rog Strix X370F-Gaming Motherboard,
– Asus Cerberus Nvidia GTX 1070 Ti (For Host),
– Sapphire Radeon RX 5600 XT Pulse (For Guest),
– 240 GB SSD (For Host. Here, it is for Pop!_Os),
– 1 TB NVMe SSD (for Storing Windows, Linux and OSX VMs),
– 2 TB + 1 TB HDD for rest.
First things first…
1– Check BIOS
Check the BIOS for virtualization and IOMMU Groups for using KVM and enable them. If the system is running and before checking BIOS, if you try to understand the situation or after changing the parameters, you can check with terminal with following code. [For intel use VT-d instead of AMD-Vi]
sudo dmesg | grep AMD-Vi
2 – DETERMINE THE PCIs
Unlike Ubuntu, Pop!_OS doesn’t have grub2 pre-installed. Therefore, we need to stub the kernel for manipulating it. Before stubbing the kernel, we need to identify to pci slots which are going to be passed. Because of this purpose, identify the PCI which is GPU in this case with:
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
Just paste the code to terminal or create a file such as iommu.sh file, paste in it and make it executable. Result of the code will give you IOMMU groups and a part of my output which gonna pass:
IOMMU Group 19 0d:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev ca)
IOMMU Group 20 0d:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio [1002:ab38]
I don’t need ACS Patching so i just isolate the pci-numbers with stabbing the kernel. ACS Patching process is not explained yet.
3 – STABBING THE KERNEL
Now i will stub the kernel with using following code then reboot the system. Note that 1002:731f, 1002:ab38 are the PCI numbers of my GPU and HDMI Audio, you need to change it with your GPU and audio’s ids.
sudo kernelstub --add-options "amd_iommu=on kvm.ignore_msrs=1 vfio-pci.ids=1002:731f,1002:ab38"
Reboot Now.
After reboot, check the devices with the following code by terminal.
lspci -nnk
and the result of RX5600XT kernel driver in use must be vfio-pci.

4 – INSTALL THE SOFTWAREs
Now, i need to install qemu, libvirt and ovmf with following code.
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager ovmf
I find that Virtual Machine Manager (libvirt) is quite usefull and makes the qemu easier, so i prefer to use my qemu with VMM.
Please share your ideas about this installation if it helps or doesn’t mean anything to your system.
echo "Si yu !"