Install the NVIDIA driver on the Proxmox host
All commands in this section are run on the Proxmox host.
Important: With Secure Boot enabled, the NVIDIA driver usually doesn't load its kernel module. Disable Secure Boot in the BIOS before installing the driver. You can check the status with
apt install mokutil -yfollowed bymokutil --sb-state. Signing the module is not covered in this guide.
1.1 Update Proxmox
Log in to the Proxmox web interface and open the host's shell. Alternatively, you can connect via SSH.
First check the installed version:
pveversion -v
Then update the package lists and install available updates:
apt update && apt full-upgrade -y
If a kernel update was installed, a reboot is required so that the new kernel is actually running.
1.2 Detect the NVIDIA GPU
Before installing any NVIDIA drivers, we first check
whether Proxmox detects the graphics card at all.
lspci | grep -i nvidia
If the RTX 3060 is detected correctly, you should see output similar to this:
01:00.0 VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA106 High Definition Audio Controller (rev a1)
This tells us the graphics card is detected at the PCIe level.
1.3 Install the required packages
Before installing the NVIDIA driver, we first set up the required tools. These include the compiler tools for building the NVIDIA kernel module, DKMS and a few utilities we'll need later in the installation.
Install the packages with:
apt install build-essential dkms pciutils wget curl nano mc btop nvtop
The individual packages do the following:
- build-essential โ contains compilers and tools needed to build the NVIDIA kernel module.
- dkms โ manages kernel modules and automatically builds them for the running kernel when needed.
- pciutils โ provides lspci, among others, which we use to check the detected NVIDIA GPU.
- wget โ used to download files.
- curl โ also used for downloads and retrieving information.
- nano โ simple editor for editing configuration files.
- mc โ convenient file manager for the terminal.
- btop โ shows CPU load, RAM usage, running processes and system resources.
- nvtop โ shows GPU load, VRAM usage, temperatures and running GPU processes in real time.
Then we check which kernel the Proxmox host is currently using:
uname -r
To build the NVIDIA kernel module, the matching kernel headers must be installed. On Proxmox VE 9 we use the header meta package of the current Proxmox 7.0 kernel branch:
apt install proxmox-headers-7.0
This installs the header version matching the installed Proxmox kernel.
Finally, we check whether the required build directory exists:
ls -ld /lib/modules/$(uname -r)/build
If a valid directory is shown here, the required kernel headers are present and the prerequisites for the NVIDIA driver installation are met.
If the directory is missing, don't run the NVIDIA driver installation yet. First the kernel headers for the currently running Proxmox kernel must be installed correctly.
1.4 Download the NVIDIA driver
Download the matching Linux driver for your NVIDIA RTX graphics card from the official NVIDIA website:
For the RTX 3060, in this example we use the production branch version 595.99.02.
Then open the NVIDIA driver page in the browser and copy the direct download link of the .run file.
Paste this link into the following command:
wget
Example for the version used:
wget https://download.nvidia.com/XFree86/Linux-x86_64/595.99.02/NVIDIA-Linux-x86_64-595.99.02.run
Then check whether the file was downloaded successfully:
ls -lh NVIDIA-Linux-x86_64-*.run
Make the downloaded file executable. Ideally, use the exact file name:
chmod +x NV*
Note: chmod +x NV* works if the downloaded NVIDIA .run file is the only file in /root starting with NV. If several files there start with NV, use the full file name instead.
1.5 Install the NVIDIA driver with DKMS
Start the installer:
./NV* --dkms
Several prompts are shown during the installation.
Select the kernel module:
โ NVIDIA proprietary
The proprietary kernel module is the classic NVIDIA kernel driver. The MIT/GPL variant is NVIDIA's open kernel module and is used especially with newer GPU generations (RTX 50xx etc.) and current NVIDIA drivers. For our setup with the RTX 3060 we use the proprietary variant.
Further prompts:
- Disable Nouveau โ Yes
- Continue the installation even though Nouveau is currently loaded โ Continue installation
- 32-bit compatibility libraries โ OK; these aren't needed
- Register the kernel module with DKMS โ Yes
- Rebuild initramfs โ Rebuild initramfs
- Run nvidia-xconfig โ No
The --dkms option ensures that the NVIDIA kernel module is managed via DKMS. This allows the module to be built automatically for the new kernel during later kernel updates, provided the matching kernel headers are present.
Since Nouveau is still loaded in the running kernel at the time of installation, the Proxmox host must be rebooted afterwards. Disabling Nouveau only takes effect after the reboot.
1.6 Set up automatic NVIDIA device initialization
On headless servers, the NVIDIA driver only creates the device files (/dev/nvidiactl etc.) on first access. So that Proxmox LXC containers don't abort at boot with TASK ERROR: Device /dev/nvidiactl does not exist, we create a small systemd service. It runs nvidia-smi before Proxmox starts the containers:
Register the kernel modules:
cat <<EOF > /etc/modules-load.d/nvidia.conf
nvidia
nvidia_uvm
EOF
Create the systemd service:
cat <<EOF > /etc/systemd/system/nvidia-init.service
[Unit]
Description=Initialize NVIDIA Device Nodes
DefaultDependencies=no
After=systemd-modules-load.service
Before=pve-guests.service
[Service]
Type=oneshot
ExecStart=/usr/bin/nvidia-smi
[Install]
WantedBy=multi-user.target
EOF
Enable the service:
systemctl daemon-reload
systemctl enable nvidia-init.service
1.7 Check the driver
After the reboot, open the host shell again and check:
nvidia-smi
Then:
lsmod | grep nvidia
If nvidia-smi shows the RTX 3060 with 12 GB of VRAM and the installed driver version, and the NVIDIA kernel module is loaded, the host is ready for the next step.