== KVM(rhel7.6) ¿¡ vm2´ë ¼³Ä¡ ÇÏ¿©, nvidia passthrough ¼³Á¤Çϱâ==
## HOST ¼¹ö ¼³Á¤
- grub ¼öÁ¤
[root@nvidia-host ~]# cat /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet intel_iommu=on "
[root@nvidia-host ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
or
==>EFI ¶ó¸é
[root@nvidia-host ~]# grub2-mkconfig -o /etc/grub2-efi.cfg
- Host¿¡¼ nvidia ¸¦ ÀÎ½Ä ¸øÇÏ°Ô(»ç¿ë¸øÇÏ°Ô) ºí·¢¸®½ºÆ® ó¸®
[root@nvidia-host ~]# cd /etc/modprobe.d/
[root@nvidia-host modprobe.d]# cat blacklist.conf
blacklist nouveau
blacklist nvidia
blacklist nvidia_drm
- nvidia ¸¦ vifo-pci ·Î »ç¿ëÇÏ°Ô²û ¼³Á¤
[root@nvidia-host modprobe.d]# cat vfio.conf
options vfio-pci ids=10de:1eb8
==> À§ ³»¿ëÀº ¾Æ·¡ ÀÛ¾÷À» ÅëÇØ ¾Ë¾Æ³¿
=========================================
[root@nvidia-host modprobe.d]# lspci -nn | grep -i nvidi
06:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1eb8] (rev a1)
2f:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1eb8] (rev a1)
30:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1eb8] (rev a1)
86:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1eb8] (rev a1)
af:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1eb8] (rev a1)
[root@nvidia-host modprobe.d]# lspci -s 06:00.0 -k
06:00.0 3D controller: NVIDIA Corporation Device 1eb8 (rev a1)
Subsystem: NVIDIA Corporation Device 12a2
Kernel modules: nouveau, nvidia_drm, nvidia
=> ¿©±â¼ Audio µµ ³ª¿À¸é ±×°Íµµ °°ÀÌ ³Ö¾îÁà¾ßÇÔ
===========================================
[root@nvidia-host modprobe.d]# dracut -f
[root@nvidia-host modprobe.d]# reboot
## È®Àιæ¹ý
# dmesg | grep vfio
# dmesg | grep -i iommu
# virsh nodedev-list | grep 06_00_
È®ÀÎÇÑ ³ëµå À̸§À¸·Î host¿¡¼ device Å»Âø
(Host¿¡ ºÎÂøµÇ¾î ÀÖ´Â nodedev´Â °¡»ó¸Ó½Å¿¡ ÀåÂøÀÌ ºÒ°¡´ÉÇÏ¿© Å»ÂøÇÊ¿ä)
# virsh nodedev-detach <DeviceName>
# virsh nodedev-detach pci_0000_30_00_0
# virsh nodedev-detach pci_0000_06_00_0
ÀÌ ÀÛ¾÷ÀÌ ¸ðµÎ ¸¶¹«¸®µÇ¸é, virt-manager ¸¦ ¿¾î¼ VM¿¡ HWÃß°¡¸¦ ÅëÇØ PCI¸¦ ÇÒ´çÇØÁÖ¸éµÈ´Ù.
Âü°í·Î ³ª´Â ¾Ö¸ÔÀº ÀÌÀ¯°¡ ½Ã½ºÅÛÀÌ efi Àε¥, ½À°üÀûÀ¸·Î grub ¸¦ ±×³ÉÇØÁà¼..¾ÈµÆ¾úÀ½...¤Ì,¤Ì