Mastering PCI and GPU Passthrough on Proxmox VE
In this comprehensive guide, we will dive deep into PCI and GPU passthrough on Proxmox VE. Whether you’re a beginner or an experienced user, this article will equip you with the necessary steps and troubleshooting tips needed to successfully configure passthrough for your virtual machines. Read on to unlock the full potential of your Proxmox VE server!
Understanding PCI and GPU Passthrough on Proxmox VE
What is PCI Passthrough?
PCI passthrough allows users to directly attach physical PCI/PCIe devices, such as GPUs, network cards, or storage controllers, to a virtual machine (VM). This offers near-native performance, enabling tasks like gaming or computational workloads.
Why Use GPU Passthrough?
GPU passthrough is particularly useful for running graphics-intensive applications on virtual machines. It allows VMs to utilize the GPU directly, providing enhanced performance for tasks such as video rendering, gaming, or data processing.
Configuring PCI Passthrough on Proxmox VE
Enabling IOMMU
First, verify that your CPU supports IOMMU. Check your BIOS settings and enable the feature. You can usually find it under settings labeled as “Intel VT-d” or “AMD-Vi.”
Adding Unsafe Interrupts
If IOMMU interrupt remapping is unsupported on your processor, configure unsafe interrupts on your Proxmox VE server to passthrough PCI/PCIe devices:
options vfio_iommu_type1 allow_unsafe_interrupts=1
Save the file and update the initramfs with:
update-initramfs -u -k all
Troubleshooting Passthrough Issues
What to Do if Your GPU is Not in Its Own IOMMU Group?
If your GPU is not in its own IOMMU group, try relocating it to a different PCI/PCIe slot. If unsuccessful, enable the ACS override kernel patch:
pcie_acs_override=downstream
Modify the GRUB file:
nano /etc/default/grub
Once you’ve made changes, update GRUB for the configurations to take effect.
Blacklisting GPU Drivers
To passthrough AMD, NVIDIA, or Intel GPUs, blacklist their respective drivers in /etc/modprobe.d/blacklist.conf
.
- AMD:
blacklist radeon
blacklist amdgpu
blacklist nouveau
blacklist nvidia
blacklist nvidiafb
blacklist nvidia_drm
blacklist snd_hda_intel
blacklist snd_hda_codec_hdmi
blacklist i915
After blacklisting, remember to update the initramfs.
Advanced Configuration Options
Check if Your GPU is Using the VFIO Driver
Run the following command to verify if the GPU is using the VFIO driver:
lspci -nnk
You should see Kernel driver in use: vfio-pci
.
Setting Up Correct Driver Dependencies
If after blacklisting, your GPU is still not using the VFIO driver, configure the driver to load after it:
softdep radeon pre: vfio-pci
softdep amdgpu pre: vfio-pci
After completing these configurations, update the initramfs again.
Common Issues and Solutions
Black Screen on the Monitor After GPU Passthrough
If you encounter a black screen after passthrough, ensure that you’ve set a default graphics card before starting the VM. This facilitates driver installation which is vital for display output.
AMD Vendor Reset Bug
AMD GPUs may experience a vendor reset issue post VM shutdown. You may need to perform a reset to recover functionality. Refer to dedicated threads in the community or the GitHub page for a robust solution.
Audio Issues in Linux VMs
If audio is crackling, enable MSI for the audio device in your VM settings. Open the config file as follows:
nano /etc/modprobe.d/snd-hda-intel.conf
Add:
options snd-hda-intel enable_msi=1
Frequently Asked Questions (FAQ)
How do I update the Proxmox VE initramfs?
To update, use the command update-initramfs -u -k all
after making changes in /etc/modules-load.d/
or /etc/modprobe.d/
.
How do I check if passthrough is working correctly?
Look for Kernel driver in use: vfio-pci
when running lspci -nnk
for the GPU in question.
What to do if my GPU passthrough fails?
Firstly, ensure correct driver blacklisting. If issues persist, check if the GPU is properly isolated in its IOMMU group. If not, consider modifying ACS override settings.
Conclusion
Configuring PCI and GPU passthrough on Proxmox VE can significantly enhance performance for your virtual machines. By following the steps outlined above and troubleshooting common issues, you’ll be well on your way to maximizing your Proxmox VE server’s capabilities.