Advertisement
Guest User

Untitled

a guest
Jun 5th, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. $ cat /proc/cmdline
  2. initrd=\amd-ucode.img initrd=\initramfs-linux.img root=UUID=myuuid rw iommu=1 amd_iommu=on iommu=pt
  3.  
  4. $ cat /boot/loader/entries/arch.conf #using systemd-boot
  5. title Arch Linux
  6. linux /vmlinuz-linux
  7. initrd /amd-ucode.img
  8. initrd /initramfs-linux.img
  9. options root=UUID=myuuid rw iommu=1 amd_iommu=on iommu=pt
  10.  
  11. $ sudo dmesg | grep IOMMU # I've already activated it in BIOS :)
  12. [ 0.318760] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
  13. [ 0.319589] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
  14. [ 0.320060] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
  15. [ 0.333308] AMD-Vi: AMD IOMMUv2 driver by Joerg Roedel <[email protected]>
  16.  
  17. $ cat mypcinfo
  18. OS: Arch Linux x86_64
  19. Kernel: 5.12.8-arch1-1
  20. CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz
  21. GPU: NVIDIA GeForce RTX 2060 SUPER
  22.  
  23. $ cat ./qemu.d/win10/prepare/begin/start.sh
  24. #!/bin/bash
  25.  
  26. # set debugging
  27. set -x
  28.  
  29. # load variables
  30. source "/etc/libvirt/hooks/kvm.conf"
  31.  
  32. # stop display manager
  33. #systemctl stop sddm.service
  34. systemctl stop i3wm.service --user
  35. # unbind VTConsoles
  36. echo 0 > /sys/class/vtconsole/vtcon0/bind
  37. echo 0 > /sys/class/vtconsole/vtcon1/bind
  38.  
  39. # unbind efi framebuffer
  40. echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
  41.  
  42. # avoid race condition
  43. sleep 12
  44.  
  45. # unload nvidia
  46. modprobe -r nvidia_uvm
  47. modprobe -r nvidia_drm
  48. modprobe -r nvidia_modeset
  49. modprobe -r drm_kms_helper
  50. modprobe -r drm
  51. modprobe -r nvidia
  52.  
  53. # unbind the GPU
  54. virsh nodedev-detach $VIRSH_GPU_VIDEO
  55. virsh nodedev-detach $VIRSH_GPU_AUDIO
  56.  
  57. # load vfio
  58. modprobe vfio_pci
  59. $ cat /etc/libvirt/hooks/kvm.conf
  60. ## Virsh devices
  61. VIRSH_GPU_VIDEO=pci_0000_07_00_0
  62. VIRSH_GPU_AUDIO=pci_0000_07_00_1
  63.  
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement