Here is the current example of GPU pass-through. I will clean this up more in the future.

Setting Up NVIDIA GPU Passthrough in Proxmox

Prerequisites

  • Hardware Requirements: Ensure your CPU and motherboard support virtualization (Intel VT-d or AMD-V/SVM).
  • Proxmox Version: Use the latest version of Proxmox VE for better compatibility and features.

BIOS Configuration

  1. Enable Virtualization: Access your BIOS settings and enable VT-d (for Intel) or AMD-V/SVM (for AMD).
  2. Disable Secure Boot: This is necessary for GPU passthrough to work correctly.
  3. Enable IOMMU: This allows the system to manage the GPU’s memory.

Proxmox Configuration

  1. Update Proxmox: Run the following commands in the terminal:
Code
apt-get update
apt-get dist-upgrade

Then reboot your system.

Edit GRUB Configuration: Modify the GRUB settings to enable IOMMU:

Code
nano /etc/default/grub

Add intel_iommu=on or amd_iommu=on to the GRUB_CMDLINE_LINUX_DEFAULT line. Update GRUB:

Code
update-grub

Load Required Modules: Create or edit the modules file:

Code
nano /etc/modules-load.d/modules.conf

Add the following lines:

Code
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

Blacklist NVIDIA Drivers: Prevent the host from using the NVIDIA drivers:

Code
nano /etc/modprobe.d/blacklist.conf

Add:

Code
blacklist nouveau
blacklist nvidia

Configure VFIO: Create a configuration file for VFIO:

Code
nano /etc/modprobe.d/vfio.conf

Add your GPU’s vendor and device IDs (found using lspci -nn | grep NVIDIA):

Code
options vfio-pci ids=10de:xxxx

Update Initramfs: Run:

Code
  1. update-initramfs -u

Creating the Virtual Machine

  1. Create a New VM: In the Proxmox web interface, create a new VM.
  2. Configure VM Settings:
    • Machine Type: Set to q35.
    • BIOS: Use UEFI (OMVF).
    • CPU Type: Set to host.
    • Add PCI Device: Select your GPU, enable ROM Bar, and set it as the primary GPU.
  3. Install OS and Drivers: Install your desired operating system (Windows or Linux) and the appropriate NVIDIA drivers.

Verification

After installation, check if the GPU is recognized in the VM. You can use tools like nvidia-smi to verify the GPU status.

This setup allows you to utilize your NVIDIA GPU within a virtual machine, enhancing performance for applications that require high graphics processing power.

Leave a Reply

Your email address will not be published. Required fields are marked *