参考官方文档: https://pve.proxmox.com/wiki/NVIDIA_vGPU_on_Proxmox_VE_7.x#Prerequisites
apt-get update apt-get install gcc apt install make apt-get install linux-headers-$(uname -r) lspci -nn | grep -i nvidia nvidia-smi nano /etc/default/grub
登录PVE后台,进入shell管理终端 开启iommu: vim /etc/default/grub #找到 GRUB_CMDLINE_LINUX_DEFAULT="quiet" #intel cpu 改为: GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt" #amd cpu改为: GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
更新grub: update-grub
加载vfio模块: echo vfio >> /etc/modules echo vfio_iommu_type1 >> /etc/modules echo vfio_pci >> /etc/modules echo vfio_virqfd >> /etc/modules 更新内核参数 update-initramfs -k all -u 屏蔽系统中的开源显卡驱动避免开启显卡被系统加载 #AMD显卡 echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf #NVIDIA显卡 echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf echo "blacklist nvidiafb" >> /etc/modprobe.d/blacklist.conf #INTEL核显 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 更新内核并重启 update-initramfs -k all -u
将PVE需要安装的驱动传如PVE中,方法很多,可以通过scp或者ssh工具软件或者修改后缀名为iso,直接用pve后台传进去。 2.安装显卡驱动需要用到的依赖 apt install build-essential dkms mdevctl pve-headers-$(uname -r) 安装驱动并重启 #进入驱动所在目录 #r如果安装了显卡驱动,先卸载 ./NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run --uninstall sudo apt-get remove --purge nvidia-* ###卸载后安装 chmod +x NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run ./NVIDIA-Linux-x86_64-535.54.06-vgpu-kvm.run #重启pve reboot 验证是否安装成功,若正常显示下图所示,证明安装成功 nvidia-smi
Would you like to run the nvidia-xconfig utility to automatically updata your X onfiguration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up.
yes
apt --fix-broken install apt install build-essential dkms mdevctl pve-headers-$(uname -r) -y
本文作者:来自火星
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!