:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
:~$ nvidia-settings
ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system
(nvidia-settings:6325): GLib-GObject-CRITICAL **: 14:25:07.035: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 14:25:07.039: PRIME: No offloading required. Abort
** Message: 14:25:07.039: PRIME: is it supported? no
:~$ sudo apt install nvidia-prime
[sudo] password for shankha:
Reading package lists... Done
Building dependency tree
Reading state information... Done
nvidia-prime is already the newest version (0.8.16~0.20.04.1).
The following package was automatically installed and is no longer required:
libllvm10
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.14.11-051411-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p8
I: (UUID=6d51188c-78f7-4e33-b8e8-d36e47ce532d)
I: Set the RESUME variable to override this.
There is no sign of the kernel modules being built. There is no sign of the driver trying to load.
So I guess the module build failed.
Do you have the kernel-headers for your kernel installed? linux-image-$(uname-r) would be the name of the package.
What does dkms status say?
If the kernel headers are not installed, do install them. Then run sudo apt install --reinstall nvidia-driver-470 .
After that don’t forget to set your prime profile with prime-select.
HI, @Mart thanks for the response. you are right, something is wrong with my kernel
:~$ sudo apt-get install linux-headers-$(uname -r)
[sudo] password for shankha:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-headers-5.14.11-051411-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'linux-headers-5.14.11-051411-generic' has no installation candidate
I am facing similar issue. I have ROG Zephrus G14 GA401QC with AMD Ryzen 7 5800HS and GeForce 3050 RTX. Installed a fresh Ubuntu 20.04 and since wifi is not supported, updated the kernel to 5.14.
Installed nvidia driver 470 using sudo apt install nvidia-driver-470
$ apt list --installed | grep 'linux-headers-'
linux-headers-5.11.0-27-generic/focal-updates,focal-security,now 5.11.0-27.29~20.04.1 amd64 [installed,automatic]
linux-headers-5.11.0-37-generic/focal-updates,focal-security,now 5.11.0-37.41~20.04.2 amd64 [installed,automatic]
linux-headers-5.14.11-051411-generic/focal,now 5.14.11-051411.202110100930 amd64 [installed,automatic]
linux-headers-5.14.11-051411/focal,focal,now 5.14.11-051411.202110100930 all [installed,automatic]
linux-headers-generic-hwe-20.04/focal-updates,focal-security,now 5.11.0.37.41~20.04.16 amd64 [installed,automatic]
$ apt list --installed | grep 'linux-image-'
linux-image-5.11.0-27-generic/focal-updates,focal-security,now 5.11.0-27.29~20.04.1 amd64 [installed,automatic]
linux-image-5.11.0-37-generic/focal-updates,focal-security,now 5.11.0-37.41~20.04.2 amd64 [installed,automatic]
linux-image-generic-hwe-20.04/focal-updates,focal-security,now 5.11.0.37.41~20.04.16 amd64 [installed,automatic]
linux-image-unsigned-5.14.11-051411-generic/focal,now 5.14.11-051411.202110100930 amd64 [installed,automatic]
$ uname -r
5.14.11-051411-generic
$ grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*
/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb
/lib/modprobe.d/nvidia-kms.conf:# This file was generated by nvidia-prime
/lib/modprobe.d/nvidia-kms.conf:options nvidia-drm modeset=1
/lib/modprobe.d/nvidia-runtimepm.conf:options nvidia "NVreg_DynamicPowerManagement=0x02"
$ sudo prime-select nvidia
Info: the nvidia profile is already set
$ dkms status
nvidia, 470.74, 5.14.11-051411-generic, x86_64: installed