服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - 服务器知识 - PVE配置GPU显卡直通(亲测可用)

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

2023-08-26 10:34MoYoung、 服务器知识

本文主要为大家介绍下PVE配置GPU显卡直通的方法,亲测可用,需要的朋友可以学习下

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

1.进入网址

2.输入用户名密码

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

3.点击local上传镜像

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

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

4.进入命令行模式 shell

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

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.创建虚拟机

自己命名虚拟机名称

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

选择之前上传的镜像文件

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

机型选择q35并开启Qemu代理

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

分配磁盘大小

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

配置CPU核心数,按照自己物理机的CPU进行分配

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

配置虚拟机内存,物理为32GB,这里给分配了24X1024MB的内存容量

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

一定要取消勾选防火墙选项

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

确认安装

8.添加显卡设备

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

在PCI设备中找到自己的GPU设备型号

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

然后勾选所有功能、ROM-Bar、PCI-Express复选框,点击添加

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

9.打开虚拟机正常换源装显卡驱动

10.重启后使用终端命令nvidia-smi测试显卡是否正常

11.添加虚拟网卡(非必要)

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

添加后在虚拟机的硬件中添加

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

到此这篇关于PVE配置GPU显卡直通(亲测可用)的文章就介绍到这了,更多相关内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文地址:https://blog.csdn.net/yyhyoung/article/details/130708894

延伸 · 阅读

精彩推荐