4

In my new laptop with dual boot (Ubuntu 22.04 with kernel 6.7 + Windows 11), I tried installing the most recent production-branch Nvidia driver (version 535) available for my GPU (GeForce 4070). While no error seems to be thrown during installation, when I try nvidia-smi I get the infamous error:

NIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

To solve that, I have gone through dozens of previous questions/answers asked here in the past. I tried:

  1. disabling Secure Boot as suggested in this question.

  2. purging + reinstalling as suggested in this prior question:

    sudo apt-get remove --purge '^nvidia-.*'   
    sudo apt-get remove --purge '^libnvidia-.*'  
    sudo apt-get remove --purge '^cuda-.*'  
    sudo apt install nvidia-driver-535  
    

(I also tried purging and then installing via Software & Updates, or purging and then installing via the terminal at Ubuntu recovery terminal as root).

  1. issuing prime-select nvidia as suggested in this question.

  2. making sure I have Wayland disabled, as suggested in multiple places.

Nothing helped. What else could I try?

karel
  • 122,292
  • 133
  • 301
  • 332
YzSun
  • 43
  • 1
  • 1
  • 3

1 Answers1

6

The present Kernel version you have installed, it seems to be missing the headers for it. Since you are using a mainline kernel version 6.7.2-060702, you should download both the headers and modules from https://kernel.ubuntu.com/mainline/v6.7.2/

Note that mainline Kernels are still in development and can be prone to errors and missing components. Any bugs and errors should be reported to launchpad for tracking.

To install them is just done by running sudo dpkg -i *.deb

After they are installed I recommend a reboot.

Since the driver installation only added the driver to the Kernel but not installed it by checking dkms status it will still need to be built and installed.

$ dkms status
nvidia/535.154.05: added

You can build it and install it now because the headers are installed so all you should have to run is the following to get it to complete the installation from the current Kernel of 6.7:

sudo dkms build nvidia/535.154.05
sudo dkms install nvidia/535.154.05 --force

Then reboot again so that the driver loads.

Hope this helps!

Terrance
  • 43,712