Blog post about installing NVidia drivers.

This commit is contained in:
daniel 2025-03-02 19:08:40 +01:00
parent 2d2e1866fa
commit 8f71737822
2 changed files with 119 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -0,0 +1,119 @@
---
title: "Nvidia Drivers on Fedora"
description: >
My own up-to-date instructions for installing Nvidia drivers on a Fedora Linux system.
date: 2025-03-02T08:28:26Z
draft: false
# ShowLastmod: true
toc: false
scrolltotop: true
images: []
tags:
- nvidia
- fedora
- linux
---
My [Thinkpad P14s]({{< relref "p14s" >}}) has a dedicated Nvidia GPU, which
requires proprietary drivers. There is a gazillion of instructions on the web
for installing theses drivers on a Fedora system. Every now and then (with
kernel updates, I guess), my drivers stop working and I have to research _again_
how to (re-)install these drivers. Usually I notice this when developing raw
images with [Darktable][]. It gets dead slow and then I find out that OpenCL is
not working.
This post mainly serves as a reminder for myself how to re-install the NVidia
drivers on a Fedora laptop. It should be fairly up to date, because as I wrote,
I keep running into this problem over and over again.
The prerequisite is to have the [RPM Fusion][] repositories enabled.
{{< figure src="discover-settings-rpm-fusion.png" >}}
## Installing the NVidia drivers
I found out that I basically only need two packages:
- `nvidia-settings` and
- `xorg-x11-drv-nvidia-cuda`
The first one suffices to pull in the actual drivers and other packages as
dependencies. The latter is required in order for Darktable to make use of OpenCL.
```fish
sudo dnf install nvidia-settings xorg-x11-drv-nvidia-cuda
```
```plain
Updating and loading repositories:
Repositories loaded.
Package Arch Version Repository Size
Installing:
nvidia-settings x86_64 3:570.86.16-1.fc41 rpmfusion-nonfree-updates 4.4 MiB
Installing dependencies:
akmod-nvidia x86_64 3:570.86.16-3.fc41 rpmfusion-nonfree-updates 92.4 KiB
egl-gbm x86_64 2:1.1.2^20240919gitb24587d-3.fc41 fedora 29.3 KiB
egl-wayland x86_64 1.1.18~20250114git26ba0e3-2.fc41 updates 80.9 KiB
egl-x11 x86_64 1.0.1~20241213git61e70b0-1.fc41 updates 161.1 KiB
nvidia-modprobe x86_64 3:570.86.16-1.fc41 rpmfusion-nonfree-updates 51.0 KiB
xorg-x11-drv-nvidia x86_64 3:570.86.16-5.fc41 rpmfusion-nonfree-updates 190.2 MiB
xorg-x11-drv-nvidia-kmodsrc x86_64 3:570.86.16-5.fc41 rpmfusion-nonfree-updates 75.4 MiB
xorg-x11-drv-nvidia-libs x86_64 3:570.86.16-5.fc41 rpmfusion-nonfree-updates 361.9 MiB
Installing weak dependencies:
xorg-x11-drv-nvidia-cuda-libs x86_64 3:570.86.16-5.fc41 rpmfusion-nonfree-updates 273.2 MiB
xorg-x11-drv-nvidia-power x86_64 3:570.86.16-5.fc41 rpmfusion-nonfree-updates 233.7 KiB
Transaction Summary:
Installing: 11 packages
Total size of inbound packages is 351 MiB. Need to download 114 KiB.
After this operation, 906 MiB extra will be used (install 906 MiB, remove 0 B).
Is this ok [y/N]:
```
## Testing the installation
```fish
inxi -G
```
This will output the following if everything is configured correctly.
```plain
Graphics:
Device-1: Intel Meteor Lake-P [Intel Arc Graphics] driver: i915 v: kernel
Device-2: NVIDIA AD107GLM [RTX 500 Ada Generation Laptop GPU]
driver: nvidia v: 570.86.16
Device-3: Syntek Integrated Camera driver: uvcvideo type: USB
Display: wayland server: Xwayland v: 24.1.6 compositor: kwin_wayland
driver: gpu: i915 resolution: 1: 3840x2160~60Hz 2: 3072x1920
API: EGL v: 1.5 drivers: iris,nvidia
platforms: gbm,wayland,x11,surfaceless,device
API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: intel mesa v: 25.0.0
renderer: Mesa Intel Arc Graphics (MTL)
API: Vulkan v: 1.4.304 drivers: N/A surfaces: xcb,xlib,wayland
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor gpu: nvidia-settings,nvidia-smi
wl: wayland-info x11: xdriinfo, xdpyinfo, xprop, xrandr```
```
If the drivers aren't installed and loaded properly, the graphics card's name
will be some generic term, not the exact name of the model.
To test if Darktable can use the CUDA driver, start if from the commandline
like so:
```fish
darktable -d opencl
```
This should output a lot of technical information about the graphics card.
If it doesn't, but instead complains along the lines of
> FINALLY: opencl is NOT AVAILABLE on this system
then there is something wrong.
[Darktable]: https://www.darktable.org
[RPM fusion]: https://rpmfusion.org