Driver install fails with the error [An error occurred while performing the step: "building kernel modules". See /var/log/nvidia-installer.log...]

System Specs:
GPU: GTX 1660
OS: Ubuntu 22.04 LTS
Kernel: 6.5.0-15-generic

Just recently, I have tried to update my graphics drivers from version 535.146.02 to 535.154.05 and while the uninstallation of the old driver was successful, the installation of the new one is not. Attempted installation of the old driver also resulted in failure with the same error.

I have tried purging all Nvidia packages from my system, looking for Nvidia files and deleting them by hand, and even running apt-upgrade but, still no success.

My log file is attached below.

nvidia-installer.log (166.2 KB)

That’s an issue with the Ubuntu kernel. For whatever reasons, the ubuntu kernel team decided to use gcc-12 for kernel compilation while the 22.04 system compiler is gcc-11. Please install gcc-12 from ubuntu repo to be able to compile the nvidia modules again.

3 Likes

That’s strange though. I’ve tried installing older drivers down to the one that I’ve first installed on August 2022 when I built my computer and they all failed. Funny enough, I’ve only had up to GCC 11 in my system and all drivers installed with no problems until today.

Problem solved though. I installed GCC 12 and driver 535.154.05 is now installed successfully. Much thanks.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.