Skip to main content

NVIDIA GPU Passthrough

Install

This Proxmoxguide walks you through creating a Linux VM

in Proxmox (with GPU pass-through or related capabilities) and installing the NVIDIA driver on both Arch Linux and Debian (Bookworm).


1. Proxmox VM Configuration

Edit

  1. Locate and edit the VM configuration file:

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

  1. Add the following settings:

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

  1. Note:Note about VGA: You
      might
    • For the initial operating system installation, you may need to setset:
    vga: std
    
    for
      the
    • After initial installation. If so,installation, change it toto:
    vga: none
     right after installation
    and reboot.

    then reboot the VM.

2. Update GRUB

2.1 For Arch Linux

  1. Edit the GRUB configuration:
  2. file:
sudo nano /etc/default/grub
  1. Modify the fileGRUB_CMDLINE_LINUX_DEFAULT line to lookinclude:
  2. like
this:
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet splash nvidia-drm.modeset=1"

(Add any other parameters you need for your setup here.) 3. Regenerate the GRUB configuration:

sudo grub-mkconfig -o /boot/grub/grub.cfg

2.2 For Debian (Bookworm)

  1. Edit the GRUB configuration:
sudo nano /etc/default/grub
  1. Modify or add these lines:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"
  1. Update GRUB:
  2. Update GRUB:
sudo update-grub

3. Update Package Sources

3.1 For Arch Linux

Arch Linux uses rolling releases, so you typically do not need to edit package sources. Simply keep your system up to date:

sudo pacman -Syu

3.2 For Debian (Bookworm)

  1. Edit the sources list:list:
sudo nano /etc/apt/sources.list
  1. Ensure it contains something like:
  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
  1. Update and upgrade packages:your packages:
sudo apt update
sudo apt upgrade

4. Install the NVIDIA Driver

4.1 For Arch Linux

  1. Install the NVIDIA driver:

    driver
    :
sudo pacman -S nvidia
  1. Create/edit the modprobe configuration file:
sudo nano /etc/modprobe.d/nvidia.conf
  1. Add the following lines:
options nvidia_drm modeset=1
options nvidia_drm fbdev=1
  1. Save and close the file.

4.2 For Debian (Bookworm)

  1. Install the NVIDIA driver:
sudo apt install nvidia-driver
  1. Depending on your hardware and kernel, Debian may automatically create the appropriate modprobe files. If additional configuration is needed, you can place them in /etc/modprobe.d/.

5. Secure Boot Configuration

Before rebooting, choosedecide onehow ofyou thewant followingto handle Secure Boot. If your VM or host uses UEFI with Secure Boot enabled, you have two main options:

Option A: Disable Secure Boot (Easier)

  1. RunDisable thevalidation:
  2. following command:
mokutil --disable-validation
  1. Follow the on-screen prompts on the first reboot.reboot to complete the process.

Option B: Sign the Driver (More Secure)

  • Refer to theyour Debiandistribution’s documentation for instructions on signinghow theto driver:

    sign kernel modules:
  • This process involves creating or importing a Machine Owner Key (MOK), signing the NVIDIA kernel module, and enrolling the key with your firmware.

6. Reboot

After completing all steps,the rebootsteps relevant to your distribution and Secure Boot configuration:

  1. Reboot your system:
sudo reboot
  1. Verify that the NVIDIA drivers are in use by checking:
    • Arch Linux:
    nvidia-smi
    
    • Debian:
    nvidia-smi
    
    If the command shows information about your NVIDIA GPU, the driver is successfully loaded.

Final Notes

  • VM Performance: If you are using this VM for GPU pass-through, make sure your Proxmox host IOMMU groups and passthrough settings are properly configured.
  • Troubleshooting:
    • Check kernel messages (e.g., dmesg) for signs of driver load failures.
    • Ensure your VM configuration (qemu-server/<VMID>.conf) properly masks the CPU vendor (hv_vendor_id=NV43FIX) if you are trying to applyhide the changes.

      virtualization from the driver (useful in some GPU pass-through scenarios).