Skip to content

Instantly share code, notes, and snippets.

@Cyberes
Last active January 17, 2025 23:17
Show Gist options
  • Save Cyberes/bc33b3f4d36742ea7a036a8c7c37061e to your computer and use it in GitHub Desktop.
Save Cyberes/bc33b3f4d36742ea7a036a8c7c37061e to your computer and use it in GitHub Desktop.

How to Install Nvidia Drivers on Proxmox

  1. Your /etc/apt/sources.list should look like something like this:
deb http://ftp.us.debian.org/debian [bullseye, bookworm, etc] main contrib non-free

deb http://ftp.us.debian.org/debian [bullseye, bookworm, etc]-updates main contrib non-free

# security updates
deb http://security.debian.org [bullseye, bookworm, etc]-security main contrib

# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve [bullseye, bookworm, etc] pve-no-subscription

Don't blindly replace your /etc/apt/sources.list with the above contents!!

  1. apt update
  2. apt upgrade
  3. apt install pve-headers
  4. apt install libnvidia-cfg1 nvidia-kernel-source nvidia-kernel-common nvidia-driver
  5. Reboot
  6. nvidia-smi should print something like this:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.141.03   Driver Version: 470.141.03   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA RTX A4000    On   | 00000000:42:00.0 Off |                  Off |
| 41%   44C    P8     7W / 140W |      1MiB / 16117MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
@mrkongster
Copy link

Do you've an updated instruction? When I try to execute #5 (apt install libnvidia-cfg1 nvidia-kernel-source nvidia-kernel-common nvidia-driver), I get the following error.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libegl-mesa0 : Depends: libgbm1 (= 20.3.5-1) but 22.3.6-1+deb12u1 is to be installed
libice6 : Depends: x11-common but it is not installable
xserver-common : Depends: x11-common but it is not installable
Recommends: xfonts-base but it is not installable
E: Unable to correct problems, you have held broken packages.

@Cyberes
Copy link
Author

Cyberes commented Nov 12, 2024

Did you replace your /etc/apt/sources.list with the contents above? You shouldn't have blindly done that because you probably set it to the incorrect repo. If you're on Proxmox 8.2.2 the correct repo is bookworm

@seeker2294
Copy link

seeker2294 commented Nov 13, 2024

Do you've an updated instruction? When I try to execute #5 (apt install libnvidia-cfg1 nvidia-kernel-source nvidia-kernel-common nvidia-driver), I get the following error.

Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: libegl-mesa0 : Depends: libgbm1 (= 20.3.5-1) but 22.3.6-1+deb12u1 is to be installed libice6 : Depends: x11-common but it is not installable xserver-common : Depends: x11-common but it is not installable Recommends: xfonts-base but it is not installable E: Unable to correct problems, you have held broken packages.

@mrkongster here's the content of my /etc/apt/sources.list file:

deb http://ftp.ro.debian.org/debian bookworm main contrib non-free non-free-firmware

deb http://ftp.ro.debian.org/debian bookworm-updates main contrib non-free non-free non-free-firmware

# security updates
deb http://security.debian.org bookworm-security main contrib

deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription

Step #5 worked for me with this config (proxmox-ve: 8.2.0).
Obviously replace "ftp.ro" with your preference.

@Cyberes, thanks a lot for the guide!

@profucius
Copy link

profucius commented Dec 5, 2024

I am having a different issue currently. I ran the guide and used the two ftp repos in the comment by seeker above, which allowed installation. I rebooted and now this is what I'm getting. I re-ran all the commands to show their results:

root@pve:~# apt update
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                                     
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease                             
Hit:4 http://ftp.us.debian.org/debian bookworm InRelease                           
Hit:5 http://ftp.us.debian.org/debian bookworm-updates InRelease
Hit:6 http://download.proxmox.com/debian/pve bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@pve:~# apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pve:~# apt install pve-headers
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pve-headers is already the newest version (8.3.0).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pve:~# apt install libnvidia-cfg1 nvidia-kernel-source nvidia-kernel-common nvidia-driver
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libnvidia-cfg1 is already the newest version (535.183.01-1~deb12u1).
nvidia-kernel-source is already the newest version (535.183.01-1~deb12u1).
nvidia-kernel-common is already the newest version (20220217+3~deb12u1).
nvidia-driver is already the newest version (535.183.01-1~deb12u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pve:~# nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Update: I decided to reinstall Proxmox in addition to other reasons, and I followed a different guide for this: https://gist.github.com/egg82/90164a31db6b71d36fa4f4056bbee2eb#containerlxc

@dsaderholm
Copy link

I am having a different issue currently. I ran the guide and used the two ftp repos in the comment by seeker above, which allowed installation. I rebooted and now this is what I'm getting. I re-ran all the commands to show their results:

root@pve:~# apt update
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                                     
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease                             
Hit:4 http://ftp.us.debian.org/debian bookworm InRelease                           
Hit:5 http://ftp.us.debian.org/debian bookworm-updates InRelease
Hit:6 http://download.proxmox.com/debian/pve bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@pve:~# apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pve:~# apt install pve-headers
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pve-headers is already the newest version (8.3.0).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pve:~# apt install libnvidia-cfg1 nvidia-kernel-source nvidia-kernel-common nvidia-driver
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libnvidia-cfg1 is already the newest version (535.183.01-1~deb12u1).
nvidia-kernel-source is already the newest version (535.183.01-1~deb12u1).
nvidia-kernel-common is already the newest version (20220217+3~deb12u1).
nvidia-driver is already the newest version (535.183.01-1~deb12u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pve:~# nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I am also having the same problem.

@profucius
Copy link

I am also having the same problem.

I decided to reinstall Proxmox in addition to other reasons, and I followed a different guide for this: https://gist.github.com/egg82/90164a31db6b71d36fa4f4056bbee2eb#containerlxc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment