VM Setup: Proxmox GPU (PCI) Passthrough

Proxmox VM setup

Table of contents

  1. Background and Warnings
  2. Source Information
  3. In Proxmox GUI, add GPU to VM PCI devices
  4. Turn off VM Display
  5. Verify iGPU hardware passthough is working in the Ubuntu VM

Background and Warnings

  1. First, only perform these steps after you have confirmed that Proxmox GPU passthrough is working on your Proxmox host server.

    Detailed instructions are in this doc at Proxmox GPU Passthrough: Host Setup.

  2. Second, only perform these steps after you have set up the Linux VM.

    For detailed instructions, see Create Ubuntu VM: Cloud-Init Ubuntu Install in this doc.

  3. Third, these instuctions only work for Intel integrated GPUs, also known as iGPUs.

    These VM steps will not work as written below with Intel discrete, AMD, or Nvidia GPUs.

  4. Fourth, these instructions do not work with Proxmox LXCs, only VMs.

    These VM steps are only for passthrough to a VM, not an LXC.

    Anand has detailed instructions for LXC passthrough in his excellent article and video, UDMS Part 11: GPU passthrough on Proxmox LXC for Superior HW Transcoding!

  5. Finally, these instructions are for Linux OS VMs, specifically Ubuntu, and will not work on a Windows OS VM.

    For enabling passthrough in a Windows VM, see Derek Seaman’s great tutorial, Proxmox VE 8.3: Windows 11 vGPU (VT-d) Passthrough with Intel Alder Lake

Source Information

Sources:

  1. Craft Computing’s Proxmox 8.0 - PCIe Passthrough Tutorial video is the best explainer I have seen of this process.
  2. Proxmox PCI(e) Passthrough documentation

In Proxmox GUI, add GPU to VM PCI devices

These steps can only be done after you have created a VM and only affect that VM.

Do

  1. In Proxmox GUI, open the VM’s “PCI Device” settings:

    pve[VM#]HardwareAddPCI Device images

  2. In popup, select the following:

     Raw Device: YES
     Device: Select your GPU
    

    Then click the following:

     All Functions: YES
     ROM-Bar: YES
     Primary GPU: YES
     PCI-Express: YES (requires 'machine: q35' in VM config file)
    

    images

  3. Check the results images

Turn off VM Display

  1. Turn off the VM “Display” so it will not use the GPU hardware that we have passed through:

    pve[VM#]HardwareDisplayEditGraphic Cardnone

    This will mean that the VM “>_ Console” button on the left sidebar will no longer work. However, you can still access the VM terminal by using the “>_ Console” button on the top nav bar or through SSH.

  2. Reboot the VM

Verify iGPU hardware passthough is working in the Ubuntu VM

Run the following commands to confirm your GPU hardware is available for use by your Ubuntu VM.

  1. Check to see if your VGA adapter is available:

     lspci -k | grep VGA
    
     lspci -n -s 01:00 -v
    
     lspci -nnv | grep VGA
    
  2. Check to confirm Kernel driver in use: i915:

     lspci -n -s 01:00 -v
    
  3. Check to see that you have renderD128 in /dev/dri

     ls -l /dev/dri/by-path/
    

That’s it. If all the above check out, your GPU is available within your Ubuntu VM to use for functions like Plex HW transcoding.