PVE configuration GPU graphics card passthrough (available for personal testing)

PVE configuration GPU graphics card passthrough (available for personal testing)

1. Enter the website
2. Enter username and password
Please add image description

3. Click local to upload the image
Please add image description
Please add image description

4. Enter the command line mode shell
Please add image description

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.
Please add image description
Select the image file uploaded before.
Please add image description
Select q35 as the model and enable the Qemu agent. Allocate the
Please add image description
disk
Please add image description
size. Configure the number of CPU cores and allocate it according to the CPU of your physical machine. Configure
Please add image description
the virtual machine memory. The physical size is 32GB. Here The memory capacity of 24X1024MB is allocated.
Please add image description
Be sure to uncheck the firewall option
Please add image description
and confirm the installation
. 8. Add the graphics card device.
Please add image description
Find your GPU device model in the PCI device,
Please add image description
then check the All Functions, ROM-Bar, and PCI-Express checkboxes, and click Add.
Please add image description

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)
Please add image description
and add it to the hardware of the virtual machine.
Please add image description

Guess you like

Origin blog.csdn.net/yyhyoung/article/details/130708894