TL;DR:
My Nvidia GPU driver does not work after a Ubuntu auto-update of linux-headers.
If I follow the steps in this post, can I solve my problem? Or do you have a better suggestion?
I set the GPU as my primary display in BIOS before and now I cannot see the BIOS nor the grub menu to select former kernel in grub. (Update: I am wrong. I tried again that I do can enter the BIOS.)
I have an experience that I have to reinstall the OS if I did something wrong with the nvidia-driver as I am not a deep user of Linux and Ubuntu, so I have to be careful.
I am not a deep user of Linux or Ubuntu. I got an RTX 2060 12G and installed it into my Asus P8Z77-V LX2 with Ubuntu 20.04.4 LTS last month. After the physical installation, I installed nvidia-driver-510 via Software & Updates > Additional Drivers; and cuda-tools-11-0 via adding cuda-repo from Nvidia's official website and apt-get install, and all of them work fine. I use this video card for learning machine learning. It is normal for this month and I even used it for CUDA computation the other days, but I find it does not work today (Apr 19th, 2022), even after several reboots. As below:
(base) asuspei@asus-pc:~$ 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.
I googled some, this post may be a similar condition to mine. As my rough understanding of this post, the issue is that the updated kernel or the updated linux-headers causes the Nvidia driver not to work, and the user has to reinstall the driver. I do not know how to check if my kernel is auto-updated recently exactly, but I searched the dpkg.log files as below based on the keyword "linux-headers" and it seems that it does auto-updated on Apr 16th, 2022, just a few days earlier. And indeed that the video card is normal before it and does not work after it.
If I follow the steps this post, can I solve my problem? Or do you have a better suggestion? I have an experience that I have to reinstall the OS if I did something wrong with the nvidia-driver as I am not a deep user of Linux and Ubuntu, so I have to be careful.
Could you help me? Thank you very much!
---- System Information Related ----
(base) asuspei@asus-pc:~$ uname -a
Linux asus-pc 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
(base) asuspei@asus-pc:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
(base) asuspei@asus-pc:~$ apt list --installed | grep -i -e 'linux-headers'
linux-headers-5.13.0-35-generic/focal-updates,focal-security,now 5.13.0-35.40~20.04.1 amd64 [installed,automatic]
linux-headers-5.13.0-39-generic/focal-updates,focal-security,now 5.13.0-39.44~20.04.1 amd64 [installed,automatic]
linux-headers-generic-hwe-20.04/focal-updates,focal-security,now 5.13.0.39.44~20.04.24 amd64 [installed,automatic]
(base) asuspei@asus-pc:~$ apt list --installed | grep -i -e 'nvidia'
libnvidia-cfg1-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-common-510/focal-updates,focal-updates,focal-security,focal-security,now 510.54-0ubuntu0.20.04.1 all [installed,automatic]
libnvidia-compute-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-compute-510/now 510.47.03-0ubuntu0.20.04.1 i386 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-decode-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-decode-510/now 510.47.03-0ubuntu0.20.04.1 i386 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-encode-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-encode-510/now 510.47.03-0ubuntu0.20.04.1 i386 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-extra-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-fbc1-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-fbc1-510/now 510.47.03-0ubuntu0.20.04.1 i386 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-gl-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
libnvidia-gl-510/now 510.47.03-0ubuntu0.20.04.1 i386 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
linux-modules-nvidia-510-5.13.0-35-generic/focal-updates,focal-security,now 5.13.0-35.40~20.04.1 amd64 [installed,automatic]
linux-modules-nvidia-510-generic-hwe-20.04/now 5.13.0-35.40~20.04.1 amd64 [installed,upgradable to: 5.13.0-39.44~20.04.1]
linux-objects-nvidia-510-5.13.0-35-generic/focal-updates,focal-security,now 5.13.0-35.40~20.04.1 amd64 [installed,automatic]
linux-signatures-nvidia-5.13.0-35-generic/focal-updates,focal-security,now 5.13.0-35.40~20.04.1 amd64 [installed,automatic]
nvidia-compute-utils-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
nvidia-driver-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
nvidia-kernel-common-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
nvidia-kernel-source-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
nvidia-prime/now 0.8.16~0.20.04.1 all [installed,upgradable to: 0.8.16~0.20.04.2]
nvidia-settings/focal-updates,now 470.57.01-0ubuntu0.20.04.3 amd64 [installed,automatic]
nvidia-utils-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
xserver-xorg-video-nvidia-510/now 510.47.03-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 510.54-0ubuntu0.20.04.1]
(base) asuspei@asus-pc:~$ apt list --installed | grep -i -e 'cuda'
cuda-command-line-tools-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-compiler-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-cudart-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-cudart-dev-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-cuobjdump-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-cupti-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-cupti-dev-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-documentation-11-0/unknown,now 11.0.228-1 amd64 [installed,automatic]
cuda-driver-dev-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-gdb-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-libraries-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-libraries-dev-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-memcheck-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nsight-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nsight-compute-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-nsight-systems-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-nvcc-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nvdisasm-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nvml-dev-11-0/unknown,now 11.0.167-1 amd64 [installed,automatic]
cuda-nvprof-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nvprune-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nvrtc-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nvrtc-dev-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-nvtx-11-0/unknown,now 11.0.167-1 amd64 [installed,automatic]
cuda-nvvp-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-repo-ubuntu2004-11-0-local/now 11.0.3-450.51.06-1 amd64 [installed,local]
cuda-samples-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-sanitizer-11-0/unknown,now 11.0.221-1 amd64 [installed,automatic]
cuda-toolkit-11-0/unknown,now 11.0.3-1 amd64 [installed]
cuda-tools-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
cuda-visual-tools-11-0/unknown,now 11.0.3-1 amd64 [installed,automatic]
(base) asuspei@asus-pc:~$ grep -i -e 'linux-headers' /var/log/dpkg.log*
/var/log/dpkg.log.1:2022-02-23 08:49:56 install linux-headers-5.13.0-30-generic:amd64 <none> 5.13.0-30.33~20.04.1
/var/log/dpkg.log.1:2022-02-23 08:49:56 status half-installed linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log.1:2022-02-23 08:49:57 status unpacked linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log.1:2022-02-23 08:49:57 install linux-headers-generic-hwe-20.04:amd64 <none> 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-02-23 08:49:57 status half-installed linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-02-23 08:49:57 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-02-23 08:50:21 configure linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1 <none>
/var/log/dpkg.log.1:2022-02-23 08:50:21 status unpacked linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log.1:2022-02-23 08:50:21 status half-configured linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log.1:2022-02-23 08:50:21 status installed linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log.1:2022-02-23 08:50:23 configure linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17 <none>
/var/log/dpkg.log.1:2022-02-23 08:50:23 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-02-23 08:50:23 status half-configured linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-02-23 08:50:23 status installed linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-03-11 10:30:39 install linux-headers-5.13.0-35-generic:amd64 <none> 5.13.0-35.40~20.04.1
/var/log/dpkg.log.1:2022-03-11 10:30:39 status half-installed linux-headers-5.13.0-35-generic:amd64 5.13.0-35.40~20.04.1
/var/log/dpkg.log.1:2022-03-11 10:30:41 status unpacked linux-headers-5.13.0-35-generic:amd64 5.13.0-35.40~20.04.1
/var/log/dpkg.log.1:2022-03-11 10:30:41 upgrade linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17 5.13.0.35.40~20.04.20
/var/log/dpkg.log.1:2022-03-11 10:30:41 status half-configured linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-03-11 10:30:41 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-03-11 10:30:41 status half-installed linux-headers-generic-hwe-20.04:amd64 5.13.0.30.33~20.04.17
/var/log/dpkg.log.1:2022-03-11 10:30:42 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log.1:2022-03-11 10:30:42 configure linux-headers-5.13.0-35-generic:amd64 5.13.0-35.40~20.04.1 <none>
/var/log/dpkg.log.1:2022-03-11 10:30:42 status unpacked linux-headers-5.13.0-35-generic:amd64 5.13.0-35.40~20.04.1
/var/log/dpkg.log.1:2022-03-11 10:30:42 status half-configured linux-headers-5.13.0-35-generic:amd64 5.13.0-35.40~20.04.1
/var/log/dpkg.log.1:2022-03-11 10:30:42 status installed linux-headers-5.13.0-35-generic:amd64 5.13.0-35.40~20.04.1
/var/log/dpkg.log.1:2022-03-11 10:30:42 configure linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20 <none>
/var/log/dpkg.log.1:2022-03-11 10:30:42 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log.1:2022-03-11 10:30:42 status half-configured linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log.1:2022-03-11 10:30:42 status installed linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log:2022-04-15 09:34:30 install linux-headers-5.13.0-39-generic:amd64 <none> 5.13.0-39.44~20.04.1
/var/log/dpkg.log:2022-04-15 09:34:30 status half-installed linux-headers-5.13.0-39-generic:amd64 5.13.0-39.44~20.04.1
/var/log/dpkg.log:2022-04-15 09:34:32 status unpacked linux-headers-5.13.0-39-generic:amd64 5.13.0-39.44~20.04.1
/var/log/dpkg.log:2022-04-15 09:34:32 upgrade linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20 5.13.0.39.44~20.04.24
/var/log/dpkg.log:2022-04-15 09:34:32 status half-configured linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log:2022-04-15 09:34:32 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log:2022-04-15 09:34:32 status half-installed linux-headers-generic-hwe-20.04:amd64 5.13.0.35.40~20.04.20
/var/log/dpkg.log:2022-04-15 09:34:34 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.39.44~20.04.24
/var/log/dpkg.log:2022-04-15 09:34:35 configure linux-headers-5.13.0-39-generic:amd64 5.13.0-39.44~20.04.1 <none>
/var/log/dpkg.log:2022-04-15 09:34:35 status unpacked linux-headers-5.13.0-39-generic:amd64 5.13.0-39.44~20.04.1
/var/log/dpkg.log:2022-04-15 09:34:35 status half-configured linux-headers-5.13.0-39-generic:amd64 5.13.0-39.44~20.04.1
/var/log/dpkg.log:2022-04-15 09:34:53 status installed linux-headers-5.13.0-39-generic:amd64 5.13.0-39.44~20.04.1
/var/log/dpkg.log:2022-04-15 09:34:53 configure linux-headers-generic-hwe-20.04:amd64 5.13.0.39.44~20.04.24 <none>
/var/log/dpkg.log:2022-04-15 09:34:53 status unpacked linux-headers-generic-hwe-20.04:amd64 5.13.0.39.44~20.04.24
/var/log/dpkg.log:2022-04-15 09:34:54 status half-configured linux-headers-generic-hwe-20.04:amd64 5.13.0.39.44~20.04.24
/var/log/dpkg.log:2022-04-15 09:34:54 status installed linux-headers-generic-hwe-20.04:amd64 5.13.0.39.44~20.04.24
/var/log/dpkg.log:2022-04-16 19:18:45 status installed linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log:2022-04-16 19:18:45 remove linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1 <none>
/var/log/dpkg.log:2022-04-16 19:18:45 status half-configured linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log:2022-04-16 19:18:45 status half-installed linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log:2022-04-16 19:18:46 status config-files linux-headers-5.13.0-30-generic:amd64 5.13.0-30.33~20.04.1
/var/log/dpkg.log:2022-04-16 19:18:46 status not-installed linux-headers-5.13.0-30-generic:amd64 <none>