Ubuntu 18.04 和 Nvidia 驱动程序

Ubuntu 18.04 和 Nvidia 驱动程序


我刚刚在我的联想 ThinkPad X1 Extreme 上安装了 Ubuntu 18.04,除了我的 Nvidia 驱动程序之外,一切似乎都正常(最糟糕的是我无法连接到扩展显示器)。

我的规格

Machine Type        : Notebook
Processor       : Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Operating System        : Ubuntu 18.04.1 LTS
GP107M [GeForce GTX 1050 Ti Mobile]

Kernel Version - 
4.15.0-46-generic

BIOS settings - 
*Discrete graphics

我尝试过的方法
* 使用 Ubuntu 自带的默认驱动程序 * 使用 安装驱动程序apt-get install nvidia-driver-418
* 使用 Nvidia 安装程序 安装驱动程序(不运行 x11,使用sh ./NVIDIA-Linux-x86_64-418.56.run
* 运行nvidia-settings
* 使用 lightDM 而不是 GNOM
* 清除所有 nvidia* 并从发行版安装nvidia-driver-390(而不是推荐的那个)
* 以及我在网上找到的更多建议

我现在的状态是什么
驱动程序仍然无法工作 -

#> nvidia-smi

NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.

(尝试运行但LD_PRELOAD=/usr/lib/i386-linux-gnu/libnvidia-ml.so nvidia-smi没有成功。)

nvidia-settings命令仍然打开空白屏幕,输出是 -

ERROR: Unable to load info from any available system

(nvidia-settings:3423): GLib-GObject-CRITICAL **: 12:17:57.417: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 12:17:57.419: PRIME: No offloading required. Abort
** Message: 12:17:57.419: PRIME: is it supported? no

当我跑步时ubuntu-drivers devices我仍然会 -

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C8Csv000017AAsd00002266bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Ti Mobile]
driver   : nvidia-driver-396 - third-party free
driver   : nvidia-driver-418 - third-party free recommended
driver   : nvidia-driver-410 - third-party free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-415 - third-party free
driver   : xserver-xorg-video-nouveau - distro free builtin

尽管它已经安装好了。

hardinfo命令显示“图形”是“未知”。

安装什么

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

我真的不知道该怎么做,而且似乎司机已安装但实际上并未加载。
我找不到使用modprobe或其他任何方式加载它的方法。

任何帮助都会有帮助!:祈祷:

答案1

明白了。不幸的是,联想安全启动似乎阻止了驱动程序的启动。在 BIOS 上禁用它并重新启动进入 Ubuntu 后,我看到了 Nvidia 徽标,并且我可以使用nvidia-sminvidia-settings

答案2

这就是我在 Thinkpad T580 上安装 Nvidia 显卡驱动程序的方法。

从应用程序菜单转到系统设置->细节并检查是否正在使用 Nvidia 显卡。打开软件和更新,然后点击额外的司机选项卡。选择选项使用来自 nvidea-driver-390 的 NVIDEA 驱动程序元包并点击应用更改按钮。

此外,禁用 UEFI 安全启动。重启电脑。在应用程序菜单中,打开 NVIDEA X 服务器设置,在 PRIME 配置文件选项卡中选择 NVIDEA。

参考在 Ubuntu 18.04 上安装 Nvidia 驱动程序的 2 种方法

相关内容