-1

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>
Nmath
  • 12,333
cmpltrtok
  • 173
  • 1
  • 9
  • Hello. In your post it clearly says the kernel is March 24 almost a month ago and you say the problem is recent. – David Apr 19 '22 at 12:30
  • @David Sorry, I am not very clear about those conceptions. But the linux-headers is Apr 16 as in the last list. The last list is long and you may need scroll to the end manually. – cmpltrtok Apr 19 '22 at 12:38
  • I was going by your post and it shows this. <Linux asus-pc 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 > That is a kernel. So you did not mean kernel you meant header. Sorry I do not know how to install an older header. Yes that could be the issue. – David Apr 19 '22 at 12:40
  • It sounds like the title of the question might best be how to go back to an earlier header? – David Apr 19 '22 at 12:42
  • @David Maybe the kernel has not been auto-updated recently. But the linux-headers is updated on Apr 16 as the last list shows. Sorry, I am not a deep Linux user and cannot distinguish kernel and header. Let me edit the title. – cmpltrtok Apr 19 '22 at 12:43
  • @David Can I fix it with the new header and a reinstallation of the driver? Are there other impacts to go back to the old header? – cmpltrtok Apr 19 '22 at 12:49
  • Maybe I do not know for sure. – David Apr 19 '22 at 13:18
  • You should be able to successfully boot the older ...35 kernel -- under the grub menu "advanced..." choice you'll get the older kernel. What error messages do you get when the Nvidia driver is being updated? Please add those to your original post. – ubfan1 Apr 19 '22 at 15:34
  • @ubfan1 I set the GPU as my primary display in BOIS before and now I cannot see the BIOS nor the grub menu now. And, I never update the Nvidia driver manually. Maybe, it is always what it was, and it just does not work after a Ubuntu auto-update. – cmpltrtok Apr 20 '22 at 04:10
  • @ubfan1 Sorry, I am wrong. I tried again and I can enter the BIOS. Then I entered it and set the integrated display as my primary display. After that, I entered grab and chose the old kernel, and now all is OK. Thank you very much! – cmpltrtok Apr 20 '22 at 06:19

1 Answers1

1

(Self-Answer from OP originally added to question)

It is solved after @ubfan1's suggestion at comment area. Thanks to @ubfan1 and everyone!

The detailed steps are:

1, Enter BIOS, and set the integrated display as the primary.

2, Enter grub, and choose the old kernel to boot. Then all is OK.

Optional steps:

3, Following this post to set a default kernel, I can set the old kernel as default to avoid choosing it at every system booting.

4, Follow this post to disable Ubuntu automated update. But I have not verified its effect.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
Cecilia
  • 133