0

I am working on Ubuntu 20.04.3 LTS with an AMD Ryzen 7 processor and a NVIDIA GeForce RTX 2060. Today I did some software updates and after I rebooted the screen of my laptop was flickering completely and I couldn't use it anymore. Fortunately I have a second screen where everything is working fine. Still it would be really nice to get my laptop screen back working. I am a bit new to Ubuntu, so unfortunately I don't know how to solve this problem ... Has anyone experienced a similar behaviour and may help me? If you need any additional information feel free to ask. I appreciate any kind of help.

In the meantime my laptop screen is now showing black screen with the new kernel 5.13.0-28-generic, but my second screen is working. When I switch back to the old kernel 5.11.0-43-generic my laptop screen is working but NVIDIA settings doesn't show anything and my second screen is not recognized.

Picture of screen flickering

Thanks a lot and best regards, Daniel

EDIT1: The problem has probably something to do with the kernel which was updated. Currently I am using the kernel 5.13.0-28-generic. With this kernel only my second screen is working while my laptop screen is now showing a black screen. If I change the kernel to the 5.11.0-43-generic kernel then my laptop screen is working but it doesn't recognise my second screen anymore. Also the NVIDIA X Server Settings don't show anything. If someone has any hints how to solve one problem or the other I would be really happy. Thanks.

EDIT2: If I check which kernels are installed I get the following Output I remember that before there was something with HW in its name. Also if I check my displays, it seems it recognizes my graphic card Output

EDIT3: If I check the additional drivers I have the following selection. And if I select for example the one with 495 as ending I get the following error

EDIT4: After running the sudo apt install nvidia-driver-495 command I get following errors

EDIT5: This is the output of the NVIDIA X Server Settings. Unfortunately it shows nothing. When I run 'sudo apt remove nvidia-*' it shows me the following error.

EDIT6: After reinstalling the NVIDIA drivers 470 I got the following errors at the end. When I then want to remove the 470 drivers I have the following error. When I then run the reinstallation for the 495 driver I have the following errors.

EDIT7: This is what I get when I run dpkg -l *nvidia* First page Second page

EDIT8: When I sudo apt purge every file with cuda I already get the following error at the end of every execution: Error. And when I check with dpkg -l *nvidia* | grep -i cuda I think something already went wrong because there are still some files, no?

EDIT9:Finally I arrived at step#4 here is the output. Desired=Unknown/Install/Remove/Purge/Hold

| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version                     Architecture Description
+++-==================================-===========================-============-=========================================================
ii  libnvidia-cfg1-495:amd64           495.46-0ubuntu0.20.04.1     amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-495               495.46-0ubuntu0.20.04.1     all          Shared files used by the NVIDIA libraries
ic  libnvidia-compute-460:amd64        460.91.03-0ubuntu0.20.04.1  amd64        NVIDIA libcompute package
ic  libnvidia-compute-460-server:amd64 460.106.00-0ubuntu0.20.04.2 amd64        NVIDIA libcompute package
ii  libnvidia-compute-495:amd64        495.46-0ubuntu0.20.04.1     amd64        NVIDIA libcompute package
ii  libnvidia-compute-495:i386         495.46-0ubuntu0.20.04.1     i386         NVIDIA libcompute package
ii  libnvidia-decode-495:amd64         495.46-0ubuntu0.20.04.1     amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-495:i386          495.46-0ubuntu0.20.04.1     i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-495:amd64         495.46-0ubuntu0.20.04.1     amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-495:i386          495.46-0ubuntu0.20.04.1     i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-495:amd64          495.46-0ubuntu0.20.04.1     amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-495:amd64           495.46-0ubuntu0.20.04.1     amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-495:i386            495.46-0ubuntu0.20.04.1     i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-495:amd64             495.46-0ubuntu0.20.04.1     amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-495:i386              495.46-0ubuntu0.20.04.1     i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ml-dev                   10.1.243-3                  amd64        NVIDIA Management Library (NVML) development files
ic  nvidia-compute-utils-460           460.91.03-0ubuntu0.20.04.1  amd64        NVIDIA compute utilities
ic  nvidia-compute-utils-460-server    460.106.00-0ubuntu0.20.04.2 amd64        NVIDIA compute utilities
ii  nvidia-compute-utils-495           495.46-0ubuntu0.20.04.1     amd64        NVIDIA compute utilities
ic  nvidia-cuda-toolkit                10.1.243-3                  amd64        NVIDIA CUDA development toolkit
ic  nvidia-dkms-460                    460.91.03-0ubuntu0.20.04.1  amd64        NVIDIA DKMS package
ic  nvidia-dkms-460-server             460.106.00-0ubuntu0.20.04.2 amd64        NVIDIA DKMS package
ic  nvidia-kernel-common-460           460.91.03-0ubuntu0.20.04.1  amd64        Shared files used with the kernel module
ic  nvidia-kernel-common-460-server    460.106.00-0ubuntu0.20.04.2 amd64        Shared files used with the kernel module
rHR nvidia-kernel-common-495           495.46-0ubuntu0.20.04.1     amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-495           495.46-0ubuntu0.20.04.1     amd64        NVIDIA kernel source package
ii  nvidia-opencl-dev:amd64            10.1.243-3                  amd64        NVIDIA OpenCL development files
ii  nvidia-prime                       0.8.16~0.20.04.1            all          Tools to enable NVIDIA's Prime
ii  nvidia-profiler                    10.1.243-3                  amd64        NVIDIA Profiler for CUDA and OpenCL
ii  nvidia-settings                    470.57.01-0ubuntu0.20.04.2  amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-495                   495.46-0ubuntu0.20.04.1     amd64        NVIDIA driver support binaries
ii  nvidia-visual-profiler             10.1.243-3                  amd64        NVIDIA Visual Profiler for CUDA and OpenCL
ii  xserver-xorg-video-nvidia-495      495.46-0ubuntu0.20.04.1     amd64        NVIDIA binary Xorg driver

EDIT10: Arrived now at step #5

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                             Version                    Architecture Description
+++-================================-==========================-============-=========================================================
un  libgldispatch0-nvidia            <none>                     <none>       (no description available)
ii  libnvidia-cfg1-495:amd64         495.46-0ubuntu0.20.04.1    amd64        NVIDIA binary OpenGL/GLX configuration library
un  libnvidia-cfg1-any               <none>                     <none>       (no description available)
un  libnvidia-common                 <none>                     <none>       (no description available)
ii  libnvidia-common-495             495.46-0ubuntu0.20.04.1    all          Shared files used by the NVIDIA libraries
un  libnvidia-compute                <none>                     <none>       (no description available)
ii  libnvidia-compute-495:amd64      495.46-0ubuntu0.20.04.1    amd64        NVIDIA libcompute package
ii  libnvidia-compute-495:i386       495.46-0ubuntu0.20.04.1    i386         NVIDIA libcompute package
un  libnvidia-decode                 <none>                     <none>       (no description available)
ii  libnvidia-decode-495:amd64       495.46-0ubuntu0.20.04.1    amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-495:i386        495.46-0ubuntu0.20.04.1    i386         NVIDIA Video Decoding runtime libraries
un  libnvidia-encode                 <none>                     <none>       (no description available)
ii  libnvidia-encode-495:amd64       495.46-0ubuntu0.20.04.1    amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-495:i386        495.46-0ubuntu0.20.04.1    i386         NVENC Video Encoding runtime library
un  libnvidia-extra                  <none>                     <none>       (no description available)
ii  libnvidia-extra-495:amd64        495.46-0ubuntu0.20.04.1    amd64        Extra libraries for the NVIDIA driver
un  libnvidia-fbc1                   <none>                     <none>       (no description available)
ii  libnvidia-fbc1-495:amd64         495.46-0ubuntu0.20.04.1    amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-495:i386          495.46-0ubuntu0.20.04.1    i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
un  libnvidia-gl                     <none>                     <none>       (no description available)
ii  libnvidia-gl-495:amd64           495.46-0ubuntu0.20.04.1    amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-495:i386            495.46-0ubuntu0.20.04.1    i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ml-dev                 10.1.243-3                 amd64        NVIDIA Management Library (NVML) development files
un  libnvidia-ml.so.1                <none>                     <none>       (no description available)
un  libnvidia-ml1                    <none>                     <none>       (no description available)
un  libnvidia-tesla-418-ml1          <none>                     <none>       (no description available)
un  libnvidia-tesla-440-ml1          <none>                     <none>       (no description available)
un  libnvidia-tesla-cuda1            <none>                     <none>       (no description available)
un  nvidia-384                       <none>                     <none>       (no description available)
un  nvidia-390                       <none>                     <none>       (no description available)
un  nvidia-common                    <none>                     <none>       (no description available)
un  nvidia-compute-utils             <none>                     <none>       (no description available)
ii  nvidia-compute-utils-495         495.46-0ubuntu0.20.04.1    amd64        NVIDIA compute utilities
un  nvidia-cuda-dev                  <none>                     <none>       (no description available)
un  nvidia-cuda-doc                  <none>                     <none>       (no description available)
un  nvidia-cuda-toolkit              <none>                     <none>       (no description available)
un  nvidia-dkms-495                  <none>                     <none>       (no description available)
un  nvidia-driver-495                <none>                     <none>       (no description available)
un  nvidia-driver-binary             <none>                     <none>       (no description available)
un  nvidia-kernel-common             <none>                     <none>       (no description available)
rHR nvidia-kernel-common-495         495.46-0ubuntu0.20.04.1    amd64        Shared files used with the kernel module
un  nvidia-kernel-source             <none>                     <none>       (no description available)
ii  nvidia-kernel-source-495         495.46-0ubuntu0.20.04.1    amd64        NVIDIA kernel source package
un  nvidia-legacy-304xx-vdpau-driver <none>                     <none>       (no description available)
un  nvidia-legacy-340xx-vdpau-driver <none>                     <none>       (no description available)
un  nvidia-libopencl1                <none>                     <none>       (no description available)
un  nvidia-libopencl1-dev            <none>                     <none>       (no description available)
ii  nvidia-opencl-dev:amd64          10.1.243-3                 amd64        NVIDIA OpenCL development files
un  nvidia-opencl-icd                <none>                     <none>       (no description available)
un  nvidia-persistenced              <none>                     <none>       (no description available)
ii  nvidia-prime                     0.8.16~0.20.04.1           all          Tools to enable NVIDIA's Prime
ii  nvidia-profiler                  10.1.243-3                 amd64        NVIDIA Profiler for CUDA and OpenCL
ii  nvidia-settings                  470.57.01-0ubuntu0.20.04.2 amd64        Tool for configuring the NVIDIA graphics driver
un  nvidia-settings-binary           <none>                     <none>       (no description available)
un  nvidia-smi                       <none>                     <none>       (no description available)
un  nvidia-utils                     <none>                     <none>       (no description available)
ii  nvidia-utils-495                 495.46-0ubuntu0.20.04.1    amd64        NVIDIA driver support binaries
un  nvidia-vdpau-driver              <none>                     <none>       (no description available)
ii  nvidia-visual-profiler           10.1.243-3                 amd64        NVIDIA Visual Profiler for CUDA and OpenCL
ii  xserver-xorg-video-nvidia-495    495.46-0ubuntu0.20.04.1    amd64        NVIDIA binary Xorg driver

For the last step in step #5 I got the following error:

(base) daniel@XMG-daniel:~$ dpkg -l *nvidia* | grep rHR
rHR nvidia-kernel-common-495         495.46-0ubuntu0.20.04.1    amd64        Shared files used with the kernel module
(base) daniel@XMG-daniel:~$ sudo apt purge nvidia-kernel-common-495
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  nvidia-kernel-common-495*
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 38,3 MB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: error processing package nvidia-kernel-common-495 (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
dpkg: too many errors, stopping
Errors were encountered while processing:
 nvidia-kernel-common-495
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

EDIT11: After step #7 I have the following:

(base) daniel@XMG-daniel:~$ sudo apt install nvidia-kernel-common-495
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nvidia-kernel-common-495 is already the newest version (495.46-0ubuntu0.20.04.1).
The following packages were automatically installed and are no longer required:
  libatomic1:i386 libbsd0:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386
  libelf1:i386 libexpat1:i386 libffi7:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386
  libglx0:i386 libllvm12:i386 libpciaccess0:i386 libsensors5:i386 libstdc++6:i386 libvulkan1:i386 libwayland-client0:i386 libx11-6:i386
  libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-randr0:i386
  libxcb-shm0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxshmfence1:i386
  libxxf86vm1:i386 mesa-vulkan-drivers:i386
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 0 B/18,8 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(base) daniel@XMG-daniel:~$ sudo apt purge nvidia-kernel-common-495
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libatomic1:i386 libbsd0:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386
  libelf1:i386 libexpat1:i386 libffi7:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386
  libglx0:i386 libllvm12:i386 libpciaccess0:i386 libsensors5:i386 libstdc++6:i386 libvulkan1:i386 libwayland-client0:i386 libx11-6:i386
  libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-randr0:i386
  libxcb-shm0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxshmfence1:i386
  libxxf86vm1:i386 mesa-vulkan-drivers:i386
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  nvidia-kernel-common-495*
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 38,3 MB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: error processing package nvidia-kernel-common-495 (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
dpkg: too many errors, stopping
Errors were encountered while processing:
 nvidia-kernel-common-495
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)


(base) daniel@XMG-daniel:~$ dpkg -l *nvidia*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                             Version                 Architecture Description
+++-================================-=======================-============-========================================
un  libgldispatch0-nvidia            <none>                  <none>       (no description available)
un  libnvidia-tesla-cuda1            <none>                  <none>       (no description available)
un  nvidia-common                    <none>                  <none>       (no description available)
un  nvidia-cuda-toolkit              <none>                  <none>       (no description available)
un  nvidia-dkms-495                  <none>                  <none>       (no description available)
un  nvidia-kernel-common             <none>                  <none>       (no description available)
rHR nvidia-kernel-common-495         495.46-0ubuntu0.20.04.1 amd64        Shared files used with the kernel module
un  nvidia-legacy-304xx-vdpau-driver <none>                  <none>       (no description available)
un  nvidia-legacy-340xx-vdpau-driver <none>                  <none>       (no description available)
un  nvidia-libopencl1                <none>                  <none>       (no description available)
un  nvidia-libopencl1-dev            <none>                  <none>       (no description available)
ii  nvidia-opencl-dev:amd64          10.1.243-3              amd64        NVIDIA OpenCL development files
un  nvidia-opencl-icd                <none>                  <none>       (no description available)
ii  nvidia-prime                     0.8.16~0.20.04.1        all          Tools to enable NVIDIA's Prime
un  nvidia-vdpau-driver              <none>                  <none>       (no description available)
2
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Feb 2, 2022 at 19:52
  • For what it's worth, I have similar problems with an AMD Ryzen 7 3800X CPU and Radeon RX 5600 OEM/5600 XT / 5700/5700 XT GPU, so I don't think it is GPU related. Feb 4, 2022 at 21:30

3 Answers 3

1

NOPE! You are going the wrong way! This is NOT because of incorrect drivers, it's because there are NO DRIVERS at all!

Carefully see the error message given by the package manager:

Errors were encountered while processing:
nvidia-kernel-common-495
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

This means that these packages are corrupted and dpkg can't remove them! Which indicates broken drivers! Then see the other error message by our package manager:

Do you want to continue? [Y/n] y 
dpkg: error processing package nvidia-kernel-common-495 (--remove): the package is in a very bad
inconsistent state; you should  reinstall it before attempting a
removal 

This means the package is in a very bad state. Moreover, this is the only NVIDIA driver you have. So, it's obvious that you'll get these issues. Let's try to fix it.

  1. (Optional) Boot into a root shell to safely run the commands.

  2. Remove your dkms file for NVIDIA drivers:

    sudo rm -r /var/lib/dkms/nvidia
    
  3. Purge NVIDIA drivers:

    sudo dpkg -P --force-all nvidia-*
    
  4. Recreate the dkms files:

    sudo apt install --reinstall dkms
    
  5. Reinstall NVIDIA drivers:

    sudo ubuntu-drivers autoinstall
    
  6. Reboot!

Now, your monitor should work fine.

1
  • Hello Someone, many thanks for your answer. Yesterday I decided to reinstall my Ubuntu after a longer discussion with @heynnema. After reinstallation everything is working fine but when I lock my screen and want to log in again, the screen begins to flicker and I cannot use it anymore. After restarting again. It works again. I then installed the nvidia-460 driver but after that the screen was even flickering when I rebooted my laptop. I really think the problem is the kernel 5.13.0-28.
    – CFDaniel
    Feb 3, 2022 at 19:40
0

From the comments, and chat...

We did the following...

  • tried to purge all Nvidia software, but it didn't work

  • reinstalled Ubuntu

  • installed Nvidia 470

  • modified GRUB to remember last boot choice

  • booted to new default, kernel 5.11.0-27-generic

  • booting to the older 5.11.0-27-generic kernel and the computer/monitors work fine

  • booting to the current 5.13.0-28-generic kernel causes the laptop display to flicker

    • suspect problem is with laptop monitor wanting to run at 144mhz
  • user to check for BIOS update for N.1.16.A01 on XMG GK5NR0O

    • user updated BIOS to N.1.21.A04, no help with laptop display and kernel -28
  • booted to a Ubuntu Live 21.10 USB and retested laptop display

    • Ubuntu Live, using kernel 5.13.0-19-generic, worked fine
  • user to keep an eye on Software Updater for -29 or newer kernels

8
  • Thank you for the summary @heynnema. I just wanted to post something similar but you were first. Thanks again for your help. I just have a small clarification. My system is working at the moment without any problems with the 5.11.0-27-generic kernel.
    – CFDaniel
    Feb 3, 2022 at 22:00
  • @CFDaniel That's correct.
    – heynnema
    Feb 3, 2022 at 22:01
  • I accidentally hit the button twice, sorry @heynnema
    – CFDaniel
    Feb 3, 2022 at 22:02
  • @CFDaniel No worries. Be happy :-)
    – heynnema
    Feb 3, 2022 at 22:03
  • @CFDaniel Don't delete the -28 kernel stuff. Leave it be for now.
    – heynnema
    Feb 3, 2022 at 22:06
0

I lost all network on 5.13.0.28-generic. The odd thing that I didn't notice at first, is that removing linux-image-5.13.0-28-generic was automatically installing linux-image-unsigned-5.13.0-28-generic, then removing unsigned would install the other one over again.

I was stuck in a loop until I actually paid attention to what apt was doing. I had to boot into 5.13.0-27-generic and remove them both 28's at once. This all happened after updating the Nvidia driver to 470.

I had to go back to nouveau, purged any package nvidia related, then installed 460

2
  • Are you using Secure Boot? Simply turn off Secure Boot from your BIOS settings and it will work again ;)
    – Error404
    Feb 3, 2022 at 6:27
  • @Someone I think this is also my problem. After a long discussion yesterday I decided to reinstall Ubuntu 20.04. completely. Now after reinstallation if I lock my screen and want to log in again. My screen is flickering again. When I just boot nothing is happening and the screen is working properly. I still have to download the nvidia-460 driver but first I want to downgrade my kernel since the new kernel 5.13.0.28 is installed. May someone help me on how to download the previous kernel and boot with that one and delete the 5.12.0.28 kernel?
    – CFDaniel
    Feb 3, 2022 at 19:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .