国际草包
国际草包

Proxmox amdgpu: Fatal error during GPU init 解决方案

Proxmox amdgpu: Fatal error during GPU init 解决方案

报错内容:

[    8.511123] amdgpu 0000:03:00.0: amdgpu: amdgpu_device_ip_init failed
[    8.511124] amdgpu 0000:03:00.0: amdgpu: Fatal error during GPU init

Guest 开机报错

转载声明:
本段机翻自 Nicholas Sherlock 的博文 Working around the AMD GPU Reset bug on Proxmox using vendor-reset, 略懂英文的同学可以点击原文阅读体验更好.

介绍

大多数现代AMD GPU都受到AMD重置错误的影响:无法正确地重置显卡,因此每次只能在主机上电时使用一次。第二次尝试使用该显卡时,Linux将尝试对其进行重置并失败,导致虚拟机启动失败,或者 Guest、Host 两者都死机。

如果您的系统中只有一张GPU,这将特别成为一个问题,因为它将是您的 Main GPU,因此在启动期间将由主机UEFI初始化, 所以你甚至第一次 Passthrough 都会失败。

gnif’s new vendor-reset project 试图通过使用供应商特定的重置技巧替换AMD缺失的FLR支持来解决这个AMD重置问题。

当前支持的GPU系列包括各种Polaris、Vega和Navi型号,包括与RX 480、RX 540、RX 580、Vega 56/64、Radeon VII、5500XT、5700XT、Pro 5600M相同系列的GPU(有关支持的芯片组的完整列表,请参见该 repo)。

解决方案

首先,将内核更新到最新版本并重新启动(即执行apt update && apt dist-upgrade)。否则,pve-headers获取的内核头文件将不匹配当前运行的内核,导致dkms无法构建包。

现在可以按以下方式安装vendor-reset:

# Get latest Proxmox kernel headers:
apt install pve-headers

# Did that fail? If so make sure you have Proxmox repository set up properly! https://pve.proxmox.com/wiki/Package_Repositories

# Get required build tools:
apt install git dkms build-essential

# Perform the build:
git clone https://github.com/gnif/vendor-reset.git
cd vendor-reset
dkms install .

# Enable vendor-reset to be loaded automatically on startup:
echo "vendor-reset" >> /etc/modules
update-initramfs -u

# Reboot to load the module:
shutdown -r now

完成上述骚操作之后, 你下次开虚拟机应该就能看到下面的信息:

vfio-pci 0000:03:00.0: AMD_POLARIS10: version 1.0
vfio-pci 0000:03:00.0: AMD_POLARIS10: performing pre-reset
vfio-pci 0000:03:00.0: AMD_POLARIS10: performing reset
vfio-pci 0000:03:00.0: AMD_POLARIS10: GPU pci config reset
vfio-pci 0000:03:00.0: AMD_POLARIS10: performing post-reset
vfio-pci 0000:03:00.0: AMD_POLARIS10: reset result = 0

Host 开机报错

如果你是 Proxmox 开机碰到问题, 需要手动禁用 amdgpu 驱动

# 先备份文件
cp /etc/modprobe.d/blacklist.conf /etc/modprobe.d/blacklist.conf.bak

# 在文件结尾加一行禁用驱动
echo "blacklist amdgpu" >>  /etc/modprobe.d/blacklist.conf

# 更新内核, 重启
update-initramfs -u -k all
reboot

参考

  • https://www.nicksherlock.com/2020/11/working-around-the-amd-gpu-reset-bug-on-proxmox/
  • https://pve.proxmox.com/wiki/PCI(e)_Passthrough

Thumbnail: Reno by Alex Tass
If using the image violates your rights, or there’s anything related to copyright laws, please contact me at [email protected], I will deal with them immediately.

发表回复

textsms
account_circle
email

国际草包

Proxmox amdgpu: Fatal error during GPU init 解决方案
报错内容: [ 8.511123] amdgpu 0000:03:00.0: amdgpu: amdgpu_device_ip_init failed [ 8.511124] amdgpu 0000:03:00.0: amdgpu: Fatal error during GPU init Guest…
扫描二维码继续阅读
2023-03-19