PVE configuration GPU graphics card passthrough (available for personal testing)
1. Enter the website
2. Enter username and password
3. Click local to upload the image
4. Enter the command line mode shell
5.Change source
apt install apt-transport-https ca-certificates
nano /etc/apt/sources.list
Save and replace the following:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
Save and exit, enter the following command
nano /etc/apt/sources.list.d/pve-enterprise.list
Replace the original code with the following content and save and exit
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription
Update source file
apt-get update
6. Configure graphics card pass-through
nano /etc/default/grub
One of the lines is GRUB_CMDLINE_LINUX_DEFAULT="quiet", modify this line as follows, save and exit
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=efifb:off "
Open the file you want to modify using the following command
nano /etc/modules
Add the following content
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
Update service after saving and exiting
update-initramfs -u
update-grub
Then restart the pve system
reboot
7. Create a virtual machine.
Name the virtual machine name yourself.
Select the image file uploaded before.
Select q35 as the model and enable the Qemu agent. Allocate the
disk
size. Configure the number of CPU cores and allocate it according to the CPU of your physical machine. Configure
the virtual machine memory. The physical size is 32GB. Here The memory capacity of 24X1024MB is allocated.
Be sure to uncheck the firewall option
and confirm the installation
. 8. Add the graphics card device.
Find your GPU device model in the PCI device,
then check the All Functions, ROM-Bar, and PCI-Express checkboxes, and click Add.
9. Open the virtual machine and change the source normally to install the graphics card driver.
10. After restarting, use the terminal command nvidia-smi to test whether the graphics card is normal.
11. Add a virtual network card (not necessary)
and add it to the hardware of the virtual machine.