Post

Resolving Conflicting Nvidia Drivers After Ollama Installation on Fedora 39

Symptoms:

  • Graphical glitches or system instability after Ollama installation.
  • Difficulty installing or updating Nvidia drivers using dnf.

Cause

Ollama might install a different version of the Nvidia driver that conflicts with the standard Fedora driver management system.

Solution

1. Find the conflicting drivers:

In terminal, run the following command:

1
sudo dnf list installed | grep nvidia

This command will show us what NVIDIA packages are already installed. you need to make sure you note down the version numbers so you can tell the difference with rpm non free NVIDIA packages (assuming you are okay with the proprietary NVIDIA Driver)

Here is what was installed on my system:

1
2
3
4
5
NVML.x86_64                           3:550.54.15-1.fc39                 @cuda-fedora39-x86_64  
nvidia-driver-NvFBCOpenGL.x86_64                    3:550.54.15-1.fc39                 @cuda-fedora39-x86_64  
nvidia-driver-cuda-libs.x86_64                      3:550.54.15-1.fc39                 @cuda-fedora39-x86_64  
nvidia-driver-devel.x86_64                          3:550.54.15-1.fc39                 @cuda-fedora39-x86_64  
nvidia-driver-libs.x86_64                           3:550.54.15-1.fc39                 @cuda-fedora39-x86_6

this showed that i had a different version of the drivers installed (3:550.54.15) than the one from rpmfusion-nonfree-nvidia-driver repository. the available of the driver on RPM fusion repository (at the time of writing this) is 3:550.67-1.fc39

2. Decide on Preferred Driver:

  • Ollama driver (if working, but potential update issues)
  • Fedora Driver (latest, managed by dnf)

3. Remove Ollama Driver (if switching):

Make sure you have a way to access your system in case removing the Nvidia driver results in graphical issues (e.g., using the built-in graphics if available).

1
sudo dnf remove <package_name>  # Replace with actual package names

in my case, it would be :

1
sudo dnf remove nvidia-driver-NVML nvidia-driver-NvFBCOpenGL nvidia-driver-cuda-libs nvidia-driver-devel nvidia-driver-libs

this got rid of all of the existing NVIDA packages installed and gave me a chance to reinstall it all from scratch.

4. Install Fedora Driver (if switching):

1
2
3
sudo dnf config-manager --set-enabled rpmfusion-nonfree-nvidia-driver
sudo dnf update
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia

these commands will

  1. add rpmfusion-nonfree-nvidia-driver repository to your system (if not added already).
  2. update the system
  3. install akmod-nvidia and xorg-x11-drv-nvidia
Reboot
1
Reboot
This post is licensed under CC BY 4.0 by the author.