Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat /proc/cmdline
- initrd=\amd-ucode.img initrd=\initramfs-linux.img root=UUID=myuuid rw iommu=1 amd_iommu=on iommu=pt
- $ cat /boot/loader/entries/arch.conf #using systemd-boot
- title Arch Linux
- linux /vmlinuz-linux
- initrd /amd-ucode.img
- initrd /initramfs-linux.img
- options root=UUID=myuuid rw iommu=1 amd_iommu=on iommu=pt
- $ sudo dmesg | grep IOMMU # I've already activated it in BIOS :)
- [ 0.318760] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
- [ 0.319589] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
- [ 0.320060] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
- [ 0.333308] AMD-Vi: AMD IOMMUv2 driver by Joerg Roedel <[email protected]>
- $ cat mypcinfo
- OS: Arch Linux x86_64
- Kernel: 5.12.8-arch1-1
- CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz
- GPU: NVIDIA GeForce RTX 2060 SUPER
- $ cat ./qemu.d/win10/prepare/begin/start.sh
- #!/bin/bash
- # set debugging
- set -x
- # load variables
- source "/etc/libvirt/hooks/kvm.conf"
- # stop display manager
- #systemctl stop sddm.service
- systemctl stop i3wm.service --user
- # unbind VTConsoles
- echo 0 > /sys/class/vtconsole/vtcon0/bind
- echo 0 > /sys/class/vtconsole/vtcon1/bind
- # unbind efi framebuffer
- echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
- # avoid race condition
- sleep 12
- # unload nvidia
- modprobe -r nvidia_uvm
- modprobe -r nvidia_drm
- modprobe -r nvidia_modeset
- modprobe -r drm_kms_helper
- modprobe -r drm
- modprobe -r nvidia
- # unbind the GPU
- virsh nodedev-detach $VIRSH_GPU_VIDEO
- virsh nodedev-detach $VIRSH_GPU_AUDIO
- # load vfio
- modprobe vfio_pci
- $ cat /etc/libvirt/hooks/kvm.conf
- ## Virsh devices
- VIRSH_GPU_VIDEO=pci_0000_07_00_0
- VIRSH_GPU_AUDIO=pci_0000_07_00_1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement