Skip to main content

Debian: NVIDIA GPU Passthrough

Install Proxmox Linux VM

VM Configuration

Edit the VM configuration file:

/etc/pve/qemu-server/<VMID>.conf

Add the following settings:

args: -cpu 'host,+kvm_pv_unhalt,+kvm_pv_eoi,hv_vendor_id=NV43FIX,kvm=off'
bios: ovmf
machine: q35
vga: none

Note: You might need to set vga: std for the initial installation. If so, change it to none right after installation and reboot.

Update GRUB

  1. Edit the GRUB configuration file:
    sudo nano /etc/default/grub
    
  2. Modify the file to look like this:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet"
    GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"
    
  3. Update GRUB:
    sudo update-grub
    

Update Package Sources

  1. Edit the sources list:
    sudo nano /etc/apt/sources.list
    
  2. Update the content to:
    deb http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free
    deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free
    deb http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
    deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
    deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
    deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
    
  3. Update and upgrade packages:
    sudo apt update
    sudo apt upgrade
    

Install NVIDIA Driver

Install the NVIDIA driver:

sudo apt install nvidia-driver

Secure Boot Configuration

Before rebooting, choose one of the following options:

Option A: Disable Secure Boot (Easier)

  1. Run the following command:
    mokutil --disable-validation
    
  2. Follow the prompts on the first reboot.

Option B: Sign the Driver (More Secure)

Refer to the Debian documentation for instructions on signing the driver:

Reboot

After completing all steps, reboot your system to apply the changes.