Installing NVIDIA Graphics Card Drivers on Proxmox (PVE 8)

Install and config NVIDIA drivers on Proxmox VE host and enable GPU usage in LXC containers.

Before we begin, I want to thank my colleague @juanlu13 for providing the original source on which this manual is based.

In this guide, we will install the Nvidia drivers, the persistent service, and an optional patch to remove the maximum encoding sessions limit.

  • We will install Nvidia drivers on the Proxmox host.
  • We will configure the drivers for use in any LXC.

To perform the installation, we must:

  1. Blacklist the "nouveau" driver if we haven't already. If we have already done this, we can skip this step.

We can check it like this:

The example image shows that "blacklist nouveau" is already added to the blacklist.

Blacklist check

If in our case it doesn't show: blacklist nouveau

We add it like this so it's not used and we can install the Nvidia driver.

  1. Make sure we have these repositories added:

(If we have installed the post-installation script from tteck or xshok, we can skip this step as it's not necessary since these repositories are already added.)

Proxmox 7

Proxmox 8

Update the packages and Proxmox

Before we start, let's install two packages we'll need, git and the kernel headers to install the drivers:

1 - Install Nvidia drivers on the Proxmox host

- Driver:

To begin, we need to know what the latest stable driver available is:*

(If we're going to install the patch to bypass the maximum encoding limit, we need to make sure that patch is available for the driver version we're going to install.) We can check it here.

We can check the complete list of Drivers here

When it shows us the result, we copy the number and replace "/latest.txt" with it.

For example, like this:

Once inside the directory, we copy the link of the installer that ends with the .run extension

NVIDIA driver download

For example:

Let's start with the installation:

We download the driver we copied earlier.

We give it execution permissions.

We execute.

Once finished, we reboot.

After Proxmox has rebooted, we continue with the installation. We execute:

Now we add to etc/modules:

We save: ctrl + x.

We update initramfs:

Next, we create rules to load the drivers at boot for nvidia and nvidia_uvm:

We paste:

We save: ctrl + x

- NVIDIA driver persistence:

Now we install NVIDIA driver persistence:

We check that the driver is installed and the service is running:

NVIDIA SMI output

NVIDIA persistence service status

- Patch:

Now as an option, we patch the nvidia driver to remove the maximum encoding sessions. According to the developer, the NVENC patch removes the restriction on the maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia on consumer-level GPUs.

NVIDIA patch application

2- Configure the drivers to be able to use them in any LXC.

First, we need to obtain this data:

NVIDIA device list

Let's say, for example, that we're going to use the Plex LXC from tteck's script with ID100. If we have it running, we turn it off.

If there are any, we comment out all lines where it appears:

  • lxc.cgroup2.devices.allow...
  • /dev/dri...

and we paste this inside the LXC configuration file, which corresponds to the data we obtained with: ls -l /dev/nv*

(the numbers may vary from one system to another)

LXC configuration

We save: ctrl + x.

We run the LXC and we're going to install the Nvidia driver inside it. IMPORTANT: we do this installation from the LXC console, not from Proxmox

When this screen appears, we select everything by default, each time it asks us.

NVIDIA driver installation

Once the installation is finished, we check that everything is correct

NVIDIA SMI in LXC

NVIDIA devices in LXC

We check that Plex uses the graphics card.

As we can see, the Plex LXC container makes use of the Nvidia graphics card from our Proxmox host.

Plex using NVIDIA GPU 1

Plex using NVIDIA GPU 2

If we want any LXC to use our graphics card, we simply follow the same steps.

If we want to use the Nvidia graphics card in Docker, we need to install nvidia-docker2 as an extra.

Inside the LXC where we have Docker, we can do it with this simple script:


If you found this tutorial helpful and useful, you can buy me a Ko-fi! Thank you! 😊