報錯內容:
[ 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.
發表回復