Installing NVIDIA Graphics Card Drivers on Proxmox VE 9 (manual procedure)

Guides~30 min

Manual installation and configuration of NVIDIA drivers on a Proxmox VE 9 host, plus the LXC wiring needed to expose the GPU to one or more containers. Covers driver install, persistence service, optional NVENC patch and the per-container setup.

Note

This is the manual procedure preserved as a reference. For most users the recommended path is the automated ProxMenux flow: Install NVIDIA Drivers (Host) in the GPUs and Coral-TPU menu, and Add GPU to LXC (or Add GPU to VM) for the per-guest wiring. The automated flow handles the same steps documented here (with extra safety checks: kernel-headers compatibility, IOMMU validation, VFIO conflict resolution). This page is for users who want to understand each command, or who need to deviate from the standard flow.

Targeted at Proxmox VE 9 (Debian Trixie). PVE 7 (Bullseye) and PVE 8 (Bookworm) are no longer covered.

What you'll do

  1. Prepare the Proxmox VE 9 host (blacklist nouveau, repos, prerequisites).
  2. Install the NVIDIA driver on the host.
  3. Install the NVIDIA persistence service.
  4. (Optional) Apply the keylase patch to lift the NVENC concurrent-session limit on consumer GPUs.
  5. Wire the GPU into one or more LXC containers and install the matching driver inside each.

1. Prepare the host (PVE 9)

1.1 Blacklist nouveau

Check whether the open-source nouveau driver is already blacklisted:

cat /etc/modprobe.d/blacklist.conf

If blacklist nouveau does not appear, add it and reboot:

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
update-initramfs -u -k all
reboot
Blacklist check

1.2 Verify repositories (PVE 9 / Trixie)

Post-install tools may already have configured the repositories. Inspect the existing sources first and skip changes that are already in place; do not create duplicate entries.

Otherwise, on a vanilla PVE 9 install with no enterprise subscription:

nano /etc/apt/sources.list.d/proxmox.sources

Make sure it contains the no-subscription source for Trixie:

Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg

And the Debian sources at /etc/apt/sources.list.d/debian.sources:

Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

1.3 Update the system and install prerequisites

apt update && apt dist-upgrade -y

Install the build tools and kernel headers needed to compile the NVIDIA kernel module:

apt-get install -y git
apt-get install -qqy pve-headers-$(uname -r) gcc make

2. Install the NVIDIA driver on the host

2.1 Pick a driver version

Choose a driver branch that supports your GPU and running kernel. The newest branch may not support older GPU models; check NVIDIA’s supported-products list for the chosen release:

https://download.nvidia.com/XFree86/Linux-x86_64/latest.txt

Heads up

If you plan to apply the NVENC patch (step 4), verify the patch supports your chosen driver version first: github.com/keylase/nvidia-patch

Replace latest.txt in the URL with the version number to find the installer file ending in .run. The full driver list is at:

https://download.nvidia.com/XFree86/Linux-x86_64/
NVIDIA driver download

Throughout the rest of this guide, replace <VERSION> with the actual version (for example 580.95.05).

2.2 Download and run the installer

mkdir -p /opt/nvidia
cd /opt/nvidia
wget https://download.nvidia.com/XFree86/Linux-x86_64/VERSION/NVIDIA-Linux-x86_64-VERSION.run
chmod +x NVIDIA-Linux-x86_64-VERSION.run

Run the installer. The option below can disable nouveau if necessary; installation may need a reboot before it can finish:

./NVIDIA-Linux-x86_64-VERSION.run --no-questions --ui=none --disable-nouveau
reboot

After the host comes back, run the installer again to compile and install the kernel module:

/opt/nvidia/NVIDIA-Linux-x86_64-VERSION.run --no-questions --ui=none

2.3 Load NVIDIA modules at boot

Edit the modules-load configuration:

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

Add the NVIDIA modules needed for host/LXC use. VFIO modules are for VM passthrough and are not required for this LXC setup:

nvidia
nvidia_uvm

Save (Ctrl+X) and rebuild initramfs:

update-initramfs -u -k all

2.4 Create udev rules

So that /dev/nvidia* device nodes are created when the modules load:

nano /etc/udev/rules.d/70-nvidia.rules
# /etc/udev/rules.d/70-nvidia.rules
KERNEL=="nvidia", RUN+="/bin/bash -c '/usr/bin/nvidia-smi -L'"
KERNEL=="nvidia_uvm", RUN+="/bin/bash -c '/usr/bin/nvidia-modprobe -c0 -u'"

Save (Ctrl+X).

3. NVIDIA driver persistence service

The persistence daemon keeps the GPU initialized when no other application is using it. This reduces repeated initialization latency and preserves GPU-initialization state between clients:

cd /opt/nvidia
git clone https://github.com/NVIDIA/nvidia-persistenced.git
cd nvidia-persistenced/init
./install.sh
reboot

Verify the driver is loaded and the service is running after reboot:

nvidia-smi
NVIDIA SMI output
systemctl status nvidia-persistenced
NVIDIA persistence service status

4. (Optional) Lift the NVENC concurrent-session limit

NVENC session limits depend on the GPU model and driver version; consult NVIDIA’s support matrix rather than assuming a fixed limit by GPU generation. The keylase patch removes the software limit for supported driver versions. It can help encoding workloads such as Plex or Jellyfin transcoding.

cd /opt/nvidia
git clone https://github.com/keylase/nvidia-patch.git
cd nvidia-patch
./patch.sh
NVIDIA patch application

The patch must be re-applied after every driver update. The keylase repo also includes patch-fbc.sh for the FBC (frame buffer capture) limit if you need it.

5. Configure an LXC container to use the GPU

5.1 Identify the device numbers

On the host:

ls -l /dev/nv*
NVIDIA device list

Note the major numbers — they vary between systems. Typical values:

DeviceTypical major
/dev/nvidia0, /dev/nvidiactl195
/dev/nvidia-uvm, /dev/nvidia-uvm-tools509 (varies)
/dev/dri/*226
/dev/nvidia-modeset195 (shares with nvidia)

5.2 Edit the LXC config

Stop the container first if it's running. Open its config file (replace <CTID> with the container ID):

nano /etc/pve/lxc/CTID.conf

Comment out any pre-existing lxc.cgroup2.devices.allow or /dev/dri lines that conflict, then append the NVIDIA wiring (adjust the major numbers to match what ls -l /dev/nv* showed on your host):

lxc.cgroup2.devices.allow: c 195:* rwm
lxc.cgroup2.devices.allow: c 509:* rwm
lxc.mount.entry: /dev/nvidia0 dev/nvidia0 none bind,optional,create=file
lxc.mount.entry: /dev/nvidiactl dev/nvidiactl none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm dev/nvidia-uvm none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-modeset dev/nvidia-modeset none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm-tools dev/nvidia-uvm-tools none bind,optional,create=file
LXC configuration

Save (Ctrl+X) and start the container.

5.3 Install the driver inside the container

Important

This part runs inside the container, not on the host.

The kernel module is already loaded by the host — the container only needs the userland libraries that match the same driver version:

mkdir -p /opt/nvidia
cd /opt/nvidia
wget https://download.nvidia.com/XFree86/Linux-x86_64/VERSION/NVIDIA-Linux-x86_64-VERSION.run
chmod +x NVIDIA-Linux-x86_64-VERSION.run
./NVIDIA-Linux-x86_64-VERSION.run --no-kernel-module

Review the prompts and keep this installation limited to user-space libraries. Do not build or install a kernel module inside the LXC.

NVIDIA driver installation

5.4 Verify inside the container

nvidia-smi
NVIDIA SMI in LXC
ls -l /dev/nv*
NVIDIA devices in LXC

You should see the GPU listed and the device nodes mounted into the container's filesystem.

5.5 Confirm a real workload picks up the GPU

Enable NVIDIA hardware acceleration in Plex or Jellyfin, start a video transcode and check its dashboard or logs for actual GPU use. Installing the driver alone does not enable acceleration in the application.

Plex using NVIDIA GPUPlex using NVIDIA GPU - active session

Repeat section 5 for each additional container that needs GPU access. Keep the user-space driver libraries in every container aligned when the host driver is updated.

6. (Optional) NVIDIA Docker inside an LXC

If Docker already runs inside the LXC, install nvidia-container-toolkit there to expose the GPU to its Docker containers. GPU access from the LXC must work first. The following commands are for a rootful Docker installation:

apt-get update
apt-get install -y ca-certificates curl gnupg
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor --yes -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' > /etc/apt/sources.list.d/nvidia-container-toolkit.list
apt-get update
apt-get install -y nvidia-container-toolkit
nvidia-ctk runtime configure --runtime=docker
systemctl restart docker

These commands configure NVIDIA’s repository, install the toolkit, configure the Docker runtime and restart Docker. LXC device permissions and cgroup restrictions still apply; verify GPU use with a test workload.

Troubleshooting

  • nvidia-smi works on the host but reports "No devices found" in the container: check device mounts, permissions and matching driver libraries. If versions differ, install the host’s <VERSION> in the container with --no-kernel-module.
  • Driver compilation fails: inspect the build log. "No precompiled kernel interface was found" can simply mean the installer must compile locally. Install headers matching uname -r using apt-get install pve-headers-$(uname -r), or the equivalent proxmox-headers package for that kernel.
  • NVENC sessions remain limited: confirm the patch supports the active driver. A driver update can overwrite it. For a supported version, reapply ./patch.sh from /opt/nvidia/nvidia-patch and review its output.
  • GPU stops responding after idle: check systemctl status nvidia-persistenced and enable the service if intended. Also inspect kernel and driver logs; a stopped persistence daemon is not the only possible cause.
  • Container starts but ls /dev/nv* shows no NVIDIA devices: check the bind-mount entries and host device paths. Use ls -l /dev/nv* on the host to verify NVIDIA major numbers, then check the lxc.cgroup2.devices.allow rules and permissions.

Sponsor

If you would like to support the project.

Support me on Ko-fi

Connect

Join the community discussions on GitHub to get help, share ideas, and contribute to the project. Every idea is welcome!

Join the Discussion

ProxMenux, an open-source and collaborative project by MacRimi.