我正在使用 Ubuntu 20.04.3 LTS,它配备了 AMD Ryzen 7 处理器和 NVIDIA GeForce RTX 2060。今天我做了一些软件更新,重启后我的笔记本电脑屏幕完全闪烁,我再也无法使用它了。幸运的是,我还有第二个屏幕,一切正常。不过,如果我的笔记本电脑屏幕能恢复工作就太好了。我对 Ubuntu 有点陌生,所以不幸的是我不知道如何解决这个问题……有没有人遇到过类似的情况并可以帮助我?如果您需要任何其他信息,请随时询问。我很感激任何帮助。
与此同时,我的笔记本电脑屏幕现在使用新内核 5.13.0-28-generic 显示黑屏,但我的第二个屏幕可以正常工作。当我切换回旧内核 5.11.0-43-generic 时,我的笔记本电脑屏幕可以正常工作,但 NVIDIA 设置不显示任何内容,并且我的第二个屏幕无法识别。
非常感谢,并致以最诚挚的问候,丹尼尔
EDIT1:问题可能与更新的内核有关。目前我使用的是内核 5.13.0-28-generic。使用此内核,只有我的第二个屏幕可以工作,而我的笔记本电脑屏幕现在显示黑屏。如果我将内核更改为 5.11.0-43-generic 内核,那么我的笔记本电脑屏幕可以工作,但它不再识别我的第二个屏幕。此外,NVIDIA X 服务器设置不显示任何内容。如果有人能提示如何解决一个或另一个问题,我会非常高兴。谢谢。
EDIT2:如果我检查安装了哪些内核,我会得到以下信息输出 我记得之前有一个名字里有 HW 的东西。另外,如果我检查我的显示器,它似乎识别了我的显卡 输出
EDIT3:如果我检查其他驱动程序,我会得到以下信息选择。如果我选择以 495 为结尾的那个,我会得到以下结果错误
EDIT4:运行sudo apt install nvidia-driver-495
命令后,我得到以下内容错误
EDIT5:这是输出NVIDIA X 服务器设置。不幸的是,它什么也没显示。当我运行“sudo apt remove nvidia-*”时,它显示了以下内容错误。
EDIT6:重新安装 NVIDIA 驱动程序 470 后,我得到以下信息错误最后。当我想删除 470 驱动程序时,我得到了以下信息错误。当我重新安装 495 驱动程序时,出现以下情况错误。
EDIT7:这是我跑步时得到的结果dpkg -l *nvidia*
第一页 第二页
EDIT8:当我sudo apt purge
使用 cuda 处理每个文件时,每次执行结束时都会出现以下错误:
错误。当我检查时,dpkg -l *nvidia* | grep -i cuda
我认为已经出了问题,因为仍然有一些文件, 不?
EDIT9:最后我到达了步骤#4,这是输出。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:现在到达步骤#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
对于步骤#5的最后一步,我收到以下错误:
(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:完成步骤#7之后,我得到以下内容:
(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)
答案1
不!你走错路了!这不是因为司机不正确,而是因为根本没有司机!
仔细查看包管理器给出的错误信息:
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)
这意味着这些包已损坏,dpkg
无法删除!这表明驱动程序已损坏!然后查看我们的包管理器的另一个错误消息:
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
这意味着包裹在非常状态不好。而且,这是您唯一的 NVIDIA 驱动程序。因此,您显然会遇到这些问题。让我们尝试修复它。
(选修的)启动到根外壳安全地运行命令。
删除
dkms
NVIDIA 驱动程序文件:sudo rm -r /var/lib/dkms/nvidia
清除 NVIDIA 驱动程序:
sudo dpkg -P --force-all nvidia-*
重新创建
dkms
文件:sudo apt install --reinstall dkms
重新安装 NVIDIA 驱动程序:
sudo ubuntu-drivers autoinstall
重启!
现在,您的显示器应该可以正常工作了。
答案2
从评论和聊天...
我们做了以下事情...
尝试清除所有 Nvidia 软件,但没有成功
重新安装 Ubuntu
安装 Nvidia 470
修改 GRUB 以记住上次启动选择
启动到新的默认内核,内核 5.11.0-27-generic
启动较旧的 5.11.0-27-generic 内核,计算机/显示器工作正常
启动到当前的 5.13.0-28-generic 内核会导致笔记本电脑显示屏闪烁
- 怀疑问题是笔记本电脑显示器想要以 144MHz 运行
用户检查 BIOS
N.1.16.A01
更新XMG GK5NR0O
- 用户更新BIOS至
N.1.21.A04
,对笔记本电脑显示和内核没有帮助-28
- 用户更新BIOS至
启动至 Ubuntu Live 21.10 USB 并重新测试笔记本电脑显示屏
- Ubuntu Live 使用内核 5.13.0-19-generic,运行良好
用户需要关注
Software Updater
-29 或更新的内核
答案3
我在 5.13.0.28-generic 上失去了所有网络。我一开始没有注意到的奇怪事情是,删除 linux-image-5.13.0-28-generic 会自动安装 linux-image-unsigned-5.13.0-28-generic,然后删除 unsigned 会重新安装另一个。
我一直陷入循环,直到我真正注意到 apt 在做什么。我不得不启动 5.13.0-27-generic 并同时删除它们两个 28。这一切都发生在将 Nvidia 驱动程序更新到 470 之后。
我不得不回到 nouveau,清除所有与 nvidia 相关的软件包,然后安装 460