Howto gpu passthrough: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
No edit summary
Line 25: Line 25:
find your gpu and ensure that under “Kernel driver in use:” vfio-pci is displayed:
find your gpu and ensure that under “Kernel driver in use:” vfio-pci is displayed:
  lspci -nnk
  lspci -nnk
= configure libvirtd =
install virt-manager and ovmf:
install virt-manager and ovmf:
  pacman -S libvirt virt-manager ovmf qemu
  pacman -S libvirt virt-manager ovmf qemu
Line 38: Line 39:
add yourself to the libvirt group:
add yourself to the libvirt group:
  usermod -a -G libvirt username
  usermod -a -G libvirt username
= references =
= references =
* https://github.com/vanities/GPU-Passthrough-Arch-Linux-to-Windows10
* https://github.com/vanities/GPU-Passthrough-Arch-Linux-to-Windows10

Revision as of 23:59, 3 March 2023

configure grub

add the following to /etc/default/grub:

for intel:

GRUB_CMDLINE_LINUX_DEFAULT="quiet ... intel_iommu=on"

for amd:

GRUB_CMDLINE_LINUX_DEFAULT="quiet ... amd_iommu=on"

re-configure your grub:

grub-mkconfig -o /boot/grub/grub.cfg

isolating gpu

find the device id of the gpu:

lspci -nn

edit /etc/modprobe.d/vfio.conf file and adding the following line with your ids:

options vfio-pci ids=10de:13c0,10de:0fbb

edit /etc/mkinitcpio.conf and add the following:

MODULES="vfio vfio_iommu_type1 vfio_pci vfio_virqfd"

In the same file, also add modconf to the HOOKS line:

HOOKS="modconf"

backup your existing initramsfs image:

cp /boot/initramfs-linux.img /boot/default-initramfs-linux.img

rebuild initramfs:

mkinitcpio -g /boot/initramfs-linux.img

reboot your system:

reboot now

find your gpu and ensure that under “Kernel driver in use:” vfio-pci is displayed:

lspci -nnk

configure libvirtd

install virt-manager and ovmf:

pacman -S libvirt virt-manager ovmf qemu

edit /etc/libvirt/qemu.conf and add the following:

nvram = [
	"/usr/share/ovmf/x64/OVMF_CODE.fd:/usr/share/ovmf/x64/OVMF_VARS.fd"
]

start and enable the following services:

systemctl start libvirtd.service 
systemctl start virtlogd.socket
systemctl enable libvirtd.service
systemctl enable virtlogd.socket

add yourself to the libvirt group:

usermod -a -G libvirt username

references