PVE配置GPU显卡直通(亲测可用)

PVE配置GPU显卡直通(亲测可用)

1.进入网址
2.输入用户名密码
请添加图片描述

3.点击local上传镜像
请添加图片描述
请添加图片描述

4.进入命令行模式 shell
请添加图片描述

5.换源

apt install apt-transport-https ca-certificates 
nano /etc/apt/sources.list

保存并替换如下内容:

# 默认注释了源码镜像以提高 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

保存并退出,输入以下命令

nano /etc/apt/sources.list.d/pve-enterprise.list

用以下内容替换原代码并保存退出

deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription

更新源文件

apt-get update

6.配置显卡直通

nano /etc/default/grub

其中一行是GRUB_CMDLINE_LINUX_DEFAULT=”quiet“,修改这一行为如下内容,保存并退出

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=efifb:off "

使用以下命令打开要修改的文件

nano /etc/modules

添加如下内容

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

保存退出后更新服务

update-initramfs -u
update-grub

然后重启pve系统

reboot

7.创建虚拟机
自己命名虚拟机名称
请添加图片描述
选择之前上传的镜像文件
请添加图片描述
机型选择q35并开启Qemu代理
请添加图片描述
分配磁盘大小
请添加图片描述

9.打开虚拟机正常换源装显卡驱动
10.重启后使用终端命令nvidia-smi测试显卡是否正常
11.添加虚拟网卡(非必要)
请添加图片描述
添加后在虚拟机的硬件中添加
请添加图片描述

版权声明:本文为博主作者:MoYoung、原创文章,版权归属原作者,如果侵权,请联系我们删除!

原文链接:https://blog.csdn.net/yyhyoung/article/details/130708894

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2024年2月19日
下一篇 2024年2月19日

相关推荐