Can you install nvidia drivers on linux

NvidiaDriversInstallation

This page shows how to install the NVIDIA drivers from the command line, using either the ubuntu-drivers tool (recommended), or apt.

NVIDIA drivers releases

  • UDA (Unified Driver Architecture) drivers — which are recommended for the generic desktop use, and which you can also find here: https://www.nvidia.com/en-us/drivers/unix/
  • ERD (Enterprise Ready Drivers) — which are recommended on servers, and for computing tasks. Their packages can be recognised by the -server suffix. You can read more about these drivers here: https://docs.nvidia.com/datacenter/tesla/index.html

Additionally, we package the NVIDIA Fabric Manager and the NVIDIA Switch Configuration and Query (NSCQ) Library, which you will only need if you have NVswitch hardware. The Fabric Manager and NSCQ library are only available with the ERDs or -server driver versions.

Check driver versions

To check the version of your currently running driver:

cat /proc/driver/nvidia/version

The ubuntu-drivers tool relies on the same logic as the «Additional Drivers» graphical tool, and allow more flexibility on desktops and on servers.

The ubuntu-drivers tool is recommended if your computer uses Secure Boot, since it always tries to install signed drivers which are known to work with Secure Boot.

Читайте также:  Linux zip files using tar

Check the available drivers for your hardware

sudo ubuntu-drivers list --gpgpu

You should see a list such as the following:

nvidia-driver-418-server nvidia-driver-515-server nvidia-driver-525-server nvidia-driver-450-server nvidia-driver-515 nvidia-driver-525

Installing the drivers for generic use (e.g. desktop and gaming)

You can either rely on automatic detection, which will install the driver that is considered the best match for your hardware:

sudo ubuntu-drivers install

Or you can tell the ubuntu-drivers tool which driver you would like installed. If this is the case, you will have to use the driver version (such as 525) that you saw when you used the ubuntu-drivers list command.

Let’s assume we want to install the 525 driver:

sudo ubuntu-drivers install nvidia:525

Installing the drivers on servers and/or for computing purposes

You can either rely on automatic detection, which will install the driver that is considered the best match for your hardware:

sudo ubuntu-drivers install --gpgpu

Or you can tell the ubuntu-drivers tool which driver you would like installed. If this is the case, you will have to use the driver version (such as 525) and the -server suffix that you saw when you used the ubuntu-drivers list --gpgpu command.

Let’s assume we want to install the 525-server driver (listed as nvidia-driver-525-server):

sudo ubuntu-drivers install --gpgpu nvidia:525-server

You will also want to install the following additional components:

sudo apt install nvidia-utils-525-server

[Optional] If your system comes with NVswitch hardware, then you will want to install Fabric Manager and the NVSwitch Configuration and Query library. You can do so by running the following:

sudo apt install nvidia-fabricmanager-525 libnvidia-nscq-525

NOTE: while nvidia-fabricmanager and libnvidia-nscq do not have the same -server label in their name, they are really meant to match the -server drivers in the Ubuntu archive. For example, nvidia-fabricmanager-525 will match the nvidia-driver-525-server package version (not the nvidia-driver-525 package).

Читайте также:  Linux файловая система read only

Manual driver installation (using APT)

Installing the NVIDIA driver manually means installing the correct kernel modules first, then installing the metapackage for the driver series.

Installing the kernel modules

If your system uses Secure Boot (as most x86 modern systems do), your kernel will require the kernel modules to be signed. There are two ( mutually exclusive ) ways to achieve this:

Installing the pre-compiled NVIDIA modules for your kernel

Install the metapackage for your kernel flavour (e.g. generic, lowlatency, etc) which is specific to the driver branch (e.g. 525) that you want to install, and whether you want the compute vs general display driver (e.g. -server or not):

sudo apt install linux-modules-nvidia-$$-$

Check that the modules for your specific kernel/ABI were installed by the metapackage:

sudo apt-cache policy linux-modules-nvidia-$$-$(uname -r)

(e.g. sudo apt-cache policy linux-modules-nvidia-525-$(uname -r) )

If the modules were not installed for your current running kernel, upgrade to the latest kernel or install them by specifying the running kernel version:

sudo apt install linux-modules-nvidia-$$-$(uname -r)

(e.g. sudo apt install linux-modules-nvidia-525-$(uname -r) )

Building your own kernel modules using the NVIDIA DKMS package

Install the relevant NVIDIA DKMS package and linux-headers to build the kernel modules, and enroll your own key to sign the modules.

Install the linux-headers metapackage for your kernel flavour (e.g. generic, lowlatency, etc):

sudo apt install linux-headers-$

Check that the headers for your specific kernel were installed by the metapackage:

sudo apt-cache policy linux-headers-$(uname -r)

If the headers for your current running kernel were not installed, install them by specifying the running kernel version:

sudo apt install linux-headers-$(uname -r)

Finally, install the NVIDIA DKMS package for your desired driver series (this may automatically guide you through creating and enrolling a new key for Secure Boot):

Читайте также:  Astra linux kernel version

sudo apt install nvidia-dkms-$$

Installing the user-space drivers and the driver libraries

After installing the correct kernel modules (see the relevant section of this document), install the correct driver metapackage:

sudo apt install nvidia-driver-$$

[Optional] Installing Fabric Manager and the NVSwitch Configuration and Query library

If your system comes with NVswitch hardware, then you will want to install Fabric Manager and the NVSwitch Configuration and Query library. You can do so by running the following:

sudo apt install nvidia-fabricmanager-$ libnvidia-nscq-$

Note: while nvidia-fabricmanager and libnvidia-nscq do not have the same -server label in their name, they are really meant to match the -server drivers in the Ubuntu archive. For example, nvidia-fabricmanager-525 will match the nvidia-driver-525-server package version (not the nvidia-driver-525 package).

Switching between pre-compiled and DKMS modules

Uninstalling the NVIDIA drivers

Remove any NVIDIA packages from your system:

sudo apt --purge remove '*nvidia*$*'

Remove any additional packages that may have been installed as a dependency (e.g. the i386 libraries on amd64 systems) and which were not caught by the previous command:

Transitional packages to new driver branches

When NVIDIA stops support on a driver branch, then Canonical will transition you to the next supported driver branch automatically if you try to install that driver branch.

NvidiaDriversInstallation (последним исправлял пользователь victorvavan 2023-04-04 18:46:45)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Оцените статью
Adblock
detector