Listen to this Post
In this article, we explore how to dedicate a GPU to a Virtual Machine (VM) in Proxmox, a popular open-source server virtualization management solution. This is particularly useful for tasks requiring high graphical performance, such as gaming, AI model training, or image generation.
You Should Know:
1. Enable IOMMU in Proxmox:
- Edit the GRUB configuration file to enable IOMMU.
sudo nano /etc/default/grub
- Modify the `GRUB_CMDLINE_LINUX_DEFAULT` line to include:
intel_iommu=on # For Intel CPUs amd_iommu=on # For AMD CPUs
- Update GRUB and reboot:
sudo update-grub sudo reboot
2. Identify the GPU:
- Use the `lspci` command to identify the GPU.
lspci | grep -i vga
- Note the PCI device ID (e.g.,
01:00.0).
3. Pass the GPU to the VM:
- Edit the VM configuration file in Proxmox:
sudo nano /etc/pve/qemu-server/<VM-ID>.conf
- Add the GPU PCI device:
hostpci0: 01:00.0,pcie=1
4. Install GPU Drivers in the VM:
- For Windows VMs, download and install the appropriate GPU drivers from NVIDIA or AMD.
- For Linux VMs, use the following commands:
sudo apt update sudo apt install nvidia-driver-<version> # For NVIDIA GPUs sudo apt install mesa-utils # For AMD GPUs
5. Verify GPU Passthrough:
- Check if the GPU is recognized in the VM:
lspci | grep -i vga
- Test GPU performance using tools like `glxgears` or
nvidia-smi.
What Undercode Say:
Dedicating a GPU to a VM in Proxmox can significantly enhance performance for graphics-intensive tasks. By enabling IOMMU, identifying the GPU, and configuring the VM, you can seamlessly pass through the GPU to your virtual environment. This setup is ideal for AI workloads, gaming, or any application requiring high graphical processing power. Below are additional commands to further optimize your setup:
- Check IOMMU Groups:
sudo dmesg | grep -i iommu
- Monitor GPU Usage:
nvidia-smi # For NVIDIA GPUs radeontop # For AMD GPUs
- Backup VM Configurations:
sudo tar -czvf /backup/vm-configs.tar.gz /etc/pve/qemu-server/
For more detailed instructions, refer to the Proxmox Documentation.
This guide provides a comprehensive approach to GPU passthrough in Proxmox, ensuring optimal performance for your virtual machines.
References:
Reported By: Activity 7304261039288700929 – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅



