pve硬體直通(顯卡篇)
-
禁用host加載顯示卡
例如:
echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidiafb" >> /etc/modprobe.d/blacklist.conf
echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf
echo "blacklist snd_hda_intel" >> /etc/modprobe.d/blacklist.conf
echo "blacklist snd_hda_codec_hdmi" >> /etc/modprobe.d/blacklist.conf
echo "blacklist i915" >> /etc/modprobe.d/blacklist.conf
#查找自己的顯示卡硬體ID
lspci
output:83:00.0 3D controller: NVIDIA Corporation GP106 [P106-090] (rev a1)
lspci -n -s 01:00
output:
01:00.0 0300: 10de:1381 (rev a2)
01:00.1 0403: 10de:0fbc (rev a1)
#添加顯卡ID到直通組
echo "options vfio-pci ids=10de:1381,10de:0fbc" > /etc/modprobe.d/vfio.conf
之後在PVE web ui中創建虛擬機,並且添加顯卡設備即可. 注意事項:
- 虛擬機的bios需要ovmf會有較好的efi相容性.
- cpu類型最好選擇host,記憶體不要選擇浮動大小
- 硬碟的類型可以使用iscsi或者sata皆可