Nvidia drivers are not running in ubuntu 20.04 + RTX 3050 with Ryzen 9 5900HX

Hi, I have installed ubuntu 20.04 on Asus ROG Strix with Ryzen 5900Hx and RTX 3050. Let me describe the process

  1. After the installation, my wifi drivers were missing, so I upgraded to the required kernel, and I was able to connect.
:~$ uname -r

:~$ 5.14.11-051411-generic
  1. Then in the software center → additional drivers → selected the 1st proprietary, tested driver and → apply changes

reboot

  1. I am still not able to see my graphics card

Outputs that might help to debug this issue ----

:~$ 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

:~$ lspci -v | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation Device 25a5 (rev a1) (prog-if 00 [VGA controller])
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 1638 (rev c4) (prog-if 00 [VGA controller])
:~$ 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.
:~$ ll /etc/modprobe.d/
total 60
drwxr-xr-x   2 root root  4096 Oct 11 12:25 ./
drwxr-xr-x 135 root root 12288 Oct 11 13:08 ../
-rw-r--r--   1 root root  2507 Jul 31  2015 alsa-base.conf
-rw-r--r--   1 root root   154 Feb 16  2020 amd64-microcode-blacklist.conf
-rw-r--r--   1 root root   325 Mar 12  2020 blacklist-ath_pci.conf
-rw-r--r--   1 root root  1518 Mar 12  2020 blacklist.conf
-rw-r--r--   1 root root   210 Mar 12  2020 blacklist-firewire.conf
-rw-r--r--   1 root root   677 Mar 12  2020 blacklist-framebuffer.conf
-rw-r--r--   1 root root   156 Jul 31  2015 blacklist-modem.conf
lrwxrwxrwx   1 root root    41 Oct 11 11:13 blacklist-oss.conf -> /lib/linux-sound-base/noOSS.modprobe.conf
-rw-r--r--   1 root root   583 Mar 12  2020 blacklist-rare-network.conf
-rw-r--r--   1 root root   127 Jan 22  2020 dkms.conf
-rw-r--r--   1 root root   154 Jun 11  2020 intel-microcode-blacklist.conf
-rw-r--r--   1 root root   347 Mar 12  2020 iwlwifi.conf

nvidia-bug-report.log.gz (100.0 KB)

please let me know if any additional information is required.

Thank You.

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
:~$ dkms status
nvidia, 470.63.01: added

any solution for this?

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

Attaching the bug report: nvidia-bug-report.log.gz (110.9 KB)

Wifi problems: networking - Wifi not working on ASUS rog zephyrus g14 2021 - Ask Ubuntu
Kernel problems : 20.04 - mainline kernel now depends on libc6 2.33, non-installable in focal? - Ask Ubuntu

@shubham5

[ 2.905724] nouveau 0000:01:00.0: enabling device (0000 → 0003)

nouveau needs to be blacklisted.

@sinha.shankha17

Should say installed if everything is fine. But since the kernel headers are not installed, it cannot build the drivers modules.

Not really. It’s not a nvidia problem… Where did you get that kernel from? apt search linux-headers bring anything useful up?

Thanks @Mart !

I blacklisted nouveau as suggested using

sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo update-initramfs -u
sudo reboot

I installed the nvidia drivers using sudo apt install nvidia-driver-470 and it worked! Thanks a ton @Mart .