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
- Locate and edit the VM configuration
file:file:
/etc/pve/qemu-server/<VMID>.conf
- 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
Note:Note about VGA:You- For the initial operating system installation, you may need to
setset:
mightvga: std
for- After
initial installation. If so,installation, change ittoto:
the
andvga: none
right after installationreboot.then reboot the VM.- For the initial operating system installation, you may need to
2. Update GRUB
2.1 For Arch Linux
- Edit the GRUB configuration:
sudo nano /etc/default/grub
- Modify the
fileGRUB_CMDLINE_LINUX_DEFAULT
line tolookinclude:
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)
- Edit the GRUB configuration:
sudo nano /etc/default/grub
- Modify or add these lines:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"
- Update GRUB:
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)
- Edit the sources
list:list:
sudo nano /etc/apt/sources.list
- Ensure it contains something like:
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
- Update and upgrade
packages:your packages:
sudo apt update
sudo apt upgrade
4. Install the NVIDIA Driver
4.1 For Arch Linux
- Install the NVIDIA
driver:driver:
sudo pacman -S nvidia
- Create/edit the modprobe configuration file:
sudo nano /etc/modprobe.d/nvidia.conf
- Add the following lines:
options nvidia_drm modeset=1
options nvidia_drm fbdev=1
- Save and close the file.
4.2 For Debian (Bookworm)
- Install the NVIDIA driver:
sudo apt install nvidia-driver
- 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)
RunDisablethevalidation:
mokutil --disable-validation
- Follow the on-screen prompts on the first
reboot.reboot to complete the process.
Option B: Sign the Driver (More Secure)
- Refer to
theyourDebiandistribution’s documentationfor instructionsonsigninghowthetodriver: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:
- Reboot your system:
sudo reboot
- Verify that the NVIDIA drivers are in use by checking:
- Arch Linux:
nvidia-smi
- Debian:
If the command shows information about your NVIDIA GPU, the driver is successfully loaded.nvidia-smi
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 toapplyhide thechanges.virtualization from the driver (useful in some GPU pass-through scenarios).
- Check kernel messages (e.g.,