使用 NVIDIA 显卡驱动程序导致计算机挂起

使用 NVIDIA 显卡驱动程序导致计算机挂起

不久前,我添加了graphics-driversPPA 并安装了 415 驱动程序。我决定返回到我原来的驱动程序 390,但似乎犯了一个错误 - 我在切换之前删除了 PPA。当我尝试从 415 切换到 390 时,我收到了一条错误消息(我不记得确切的消息,但它提到了缓存)。

使用 390 驱动程序时,我无法选择 NVIDIA prime。如果我这样做,我发现:

  • 我的系统无法正常启动到桌面,而是卡在 Ubuntu 加载徽标和终端之间的短暂循环中,终端上反复出现以下内容,最后出现黑屏:

启动 NVIDIA 持久守护进程

停止 NVIDIA 持久守护进程

  • 使用某些 NVIDIA 工具会导致屏幕挂起。例如,如果我使用nvidia-settings,屏幕会冻结。如果我使用nvidia-bug-report.sh,系统会冻结,仅生成以下内容nvidia-bug-report.log.gz

____________________________________________

Start of NVIDIA bug report log file.  Please include this file, along
with a detailed description of your problem, when reporting a graphics
driver bug via the NVIDIA Linux forum (see devtalk.nvidia.com)
or by sending email to '[email protected]'.

nvidia-bug-report.sh Version: 23805530

Date: Wed 27 Feb 02:08:52 GMT 2019
uname: Linux u-rdm 4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7 14:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
command line flags: 

当我运行时lspci -v,与图形相关的条目似乎如下:

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07) (prog-if 00 [VGA controller])
    Subsystem: Dell UHD Graphics 620
    Flags: bus master, fast devsel, latency 0, IRQ 130
    Memory at d4000000 (64-bit, non-prefetchable) [size=16M]
    Memory at b0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at f000 [size=64]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: i915

01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)
    Subsystem: Dell GM108M [GeForce 940MX]
    Flags: bus master, fast devsel, latency 0, IRQ 142
    Memory at d2000000 (32-bit, non-prefetchable) [size=16M]
    Memory at c0000000 (64-bit, prefetchable) [size=256M]
    Memory at d0000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    Expansion ROM at d3000000 [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: nouveau
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

如果我运行glxinfo,则没有对 NVIDIA 的引用。它似乎与集成显卡一起使用:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2) 

当问题首次出现时,我记得尝试清除并重新安装 NVIDIA 软件包,但无济于事。

我注意到,运行lsmod,没有出现nvidiafb提到的模块lspci。此外,运行sudo modprobe nvidia会产生以下内容导致系统挂起。

目前,dpkg -l | grep nvidia给出以下输出:

ii  libnvidia-cfg1-390:amd64                   390.77-0ubuntu0.18.04.2                      amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-390                       390.77-0ubuntu0.18.04.2                      all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-390:amd64                390.77-0ubuntu0.18.04.2                      amd64        NVIDIA libcompute package
ii  libnvidia-compute-390:i386                 390.77-0ubuntu0.18.04.2                      i386         NVIDIA libcompute package
ii  libnvidia-decode-390:amd64                 390.77-0ubuntu0.18.04.2                      amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-390:i386                  390.77-0ubuntu0.18.04.2                      i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-390:amd64                 390.77-0ubuntu0.18.04.2                      amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-390:i386                  390.77-0ubuntu0.18.04.2                      i386         NVENC Video Encoding runtime library
ii  libnvidia-fbc1-390:amd64                   390.77-0ubuntu0.18.04.2                      amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-390:i386                    390.77-0ubuntu0.18.04.2                      i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-390:amd64                     390.77-0ubuntu0.18.04.2                      amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-390:i386                      390.77-0ubuntu0.18.04.2                      i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-390:amd64                   390.77-0ubuntu0.18.04.2                      amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  libnvidia-ifr1-390:i386                    390.77-0ubuntu0.18.04.2                      i386         NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  nvidia-compute-utils-390                   390.77-0ubuntu0.18.04.2                      amd64        NVIDIA compute utilities
ii  nvidia-dkms-390                            390.77-0ubuntu0.18.04.2                      amd64        NVIDIA DKMS package
ii  nvidia-driver-390                          390.77-0ubuntu0.18.04.2                      amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-390                   390.77-0ubuntu0.18.04.2                      amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-390                   390.77-0ubuntu0.18.04.2                      amd64        NVIDIA kernel source package
ii  nvidia-prime                               0.8.8.2                                      all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                            390.77-0ubuntu0.18.04.1                      amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-390                           390.77-0ubuntu0.18.04.2                      amd64        NVIDIA driver support binaries
ii  xserver-xorg-video-nvidia-390              390.77-0ubuntu0.18.04.2                      amd64        NVIDIA binary Xorg driver

其结果dkms status如下:

nvidia, 390.77, 4.18.0-15-generic, x86_64: installed

的内容/var/log/Xorg.0.log显示如下:https://pastebin.com/wBr470Cx

编辑:

进入后/var/log/syslog,我注意到了一些错误输出。首先,打印了以下内容:

Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist, and that user 123 has read and write permissions for those files.

这似乎被报道了这里。为了解决这个问题,我将所有权分配/dev/nvidia*给了nvidia-persistenced组,这有效。那个特定的错误消失了,但以下问题仍然存在:

The daemon no longer has permission to remove its runtime data directory /var/run/nvidia-persistenced

我找到了解决办法这里修复此问题后重新启动,但prime-select nvidia启动卡在“为 UID 121 启动用户管理器”阶段。

目前,我注意到我可以nvidia-settings无问题地运行,但得到以下输出:

ERROR: Error querying enabled displays on GPU 0 (Missing Extension).

ERROR: Error querying enabled displays on GPU 0 (Missing Extension).

** Message: PRIME: No offloading required. Abort
** Message: PRIME: is it supported? no

ERROR: nvidia-settings could not find the registry key file. This file should
have been installed along with this driver at 
/usr/share/nvidia/nvidia-application-profiles-key-documentation. The
application profiles will continue to work, but values cannot be
preopulated or validated, and will not be listed in the help text.
Please see the README for possible values and descriptions.

/usr/share/nvidia/nvidia-application-profiles-<version info>-key-documentation我通过复制到修复了注册表文件错误/usr/share/nvidia/nvidia-application-profiles-key-documentation,但Missing Extension错误仍然存​​在。接下来,我运行sudo apt purge nvidia-*,添加了图形驱动程序 PPA,apt updated 并安装了nvidia-390。现在,使用时唯一的错误nvidia-settings是:

ERROR: Unable to load info from any available system

此时运行nvidia-bug-report.sh不再挂起笔记本电脑,但生成的文件是相同的(水平线上方没有信息)。

相关内容