系统升级后,NVIDIA X 服务器设置 (GUI) 上不显示 GPU 信息。当我运行命令时$ nvidia-settings
,出现错误“NVIDIA 驱动程序未加载”
我的系统规格:
内核:5.4.0-53-generic
Ubuntu 版本:Ubuntu 20.04.1 LTS
显卡:GeForce GTX 1050 Ti Max-Q
NVIDIA 驱动程序版本:455.32.00
$ nvidia-settings
ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system
(nvidia-settings:7943): GLib-GObject-CRITICAL **: 17:02:04.348: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 17:02:04.350: PRIME: Requires offloading
** Message: 17:02:04.350: PRIME: is it supported? yes
** Message: 17:02:04.374: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 17:02:04.374: PRIME: on-demand mode: "1"
** Message: 17:02:04.374: PRIME: is "on-demand" mode supported? yes
nvidia-smi 输出
$ 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.
gpu 管理器.log
$ cat /var/log/gpu-manager.log
log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can't access /run/u-d-c-nvidia-was-loaded file
can't access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for nvidia modules in /lib/modules/5.4.0-53-generic/updates/dkms
Looking for amdgpu modules in /lib/modules/5.4.0-53-generic/updates/dkms
Is nvidia loaded? no
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is nvidia kernel module available? no
Is amdgpu kernel module available? no
Vendor/Device Id: 8086:3e9b
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:1c8f
BusID "PCI:1@0:0:0"
Is boot vga? no
Error: can't access /sys/bus/pci/devices/0000:01:00.0/driver
The device is not bound to any driver.
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card0", driven by "i915"
Found "/dev/dri/card0", driven by "i915"
output 0:
card0-eDP-1
Number of connected outputs for /dev/dri/card0: 1
Does it require offloading? yes
last cards number = 2
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
Has the system changed? No
Intel IGP detected
Desktop system detected
or laptop with open drivers
Nothing to do
$ sudo prime-select nvidia
Info: the nvidia profile is already set
$ lsmod | grep nvidia
$ lsmod | grep nouveau
$ dpkg -l | grep -i nvidia
ii libnvidia-cfg1-455:amd64 455.32.00-0ubuntu1 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-455 455.32.00-0ubuntu1 all Shared files used by the NVIDIA libraries
ii libnvidia-compute-455:amd64 455.32.00-0ubuntu1 amd64 NVIDIA libcompute package
ii libnvidia-decode-455:amd64 455.32.00-0ubuntu1 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-455:amd64 455.32.00-0ubuntu1 amd64 NVENC Video Encoding runtime library
ii libnvidia-extra-455:amd64 455.32.00-0ubuntu1 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-455:amd64 455.32.00-0ubuntu1 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-455:amd64 455.32.00-0ubuntu1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-ifr1-455:amd64 455.32.00-0ubuntu1 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii nvidia-compute-utils-455 455.32.00-0ubuntu1 amd64 NVIDIA compute utilities
ii nvidia-dkms-455 455.32.00-0ubuntu1 amd64 NVIDIA DKMS package
ii nvidia-driver-455 455.32.00-0ubuntu1 amd64 NVIDIA driver metapackage
ii nvidia-kernel-common-455 455.32.00-0ubuntu1 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-455 455.32.00-0ubuntu1 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.14 all Tools to enable NVIDIA's Prime
ii nvidia-settings 455.32.00-0ubuntu1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-455 455.32.00-0ubuntu1 amd64 NVIDIA driver support binaries
ii screen-resolution-extra 0.18build1 all Extension for the nvidia-settings control panel
ii xserver-xorg-video-nvidia-455 455.32.00-0ubuntu1 amd64 NVIDIA binary Xorg driver
$ lspci -nnk |egrep -A3 -i "3D|VGA"
00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Mobile) [8086:3e9b]
DeviceName: Onboard - Video
Subsystem: Micro-Star International Co., Ltd. [MSI] UHD Graphics 630 (Mobile) [1462:127e]
Kernel driver in use: i915
--
01:00.0 3D controller [0302]: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Max-Q] [10de:1c8f] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] GP107M [GeForce GTX 1050 Ti Max-Q] [1462:127e]
Kernel modules: nvidiafb, nouveau
我尝试过的事情:
- 清除并重新安装 nvidia-driver-455。
- 清除 nvidia-driver-455 并安装 nvidia-driver-450
- 尝试切换到内核 5.4.0-52-generic
答案1
安装与正在运行的内核相关的标题为我解决了这个问题。
sudo apt-get install linux-headers-`uname -r`
在我的情况下,它安装了这两个包
- Linux 标头-5.4.0-53
- Linux 标头-5.4.0-53-通用
答案2
在我的情况下,您还必须为特定的 nvidia 驱动程序安装额外的模块..
Nvidia 驱动程序版本:455
内核:5.8
linux-headers-5.8.0-32-generic
linux-hwe-5.8-headers-5.8.0-32
linux-hwe-5.8-tools-5.8.0-32
linux-image-5.8.0-32-generic
linux-modules-5.8.0-32-generic
linux-tools-5.8.0-32-generic
linux-modules-extra-5.8.0-32-generic #<- 必需
linux-modules-nvidia-455-5.8.0-32-generic #<- 必需
对于 cuda,请按照以下手册操作
https://developer.nvidia.com/cuda-downloads
并选择从网络安装选项
欢呼吧,
马丁
答案3
已解决:如何在 Ubuntu 20 下安装 nVidia 驱动程序
最初关注本文,在经历了这一切之后,我得到了和 OP 一样的东西:
在网上搜索了好几天试图解决这个问题,最后终于找到了这篇文章,尤其是 Martin M 的上述回答。
对我来说关键是这一步:
sudo apt install linux-generic
当此命令完成后,你应该得到如下所示的终端式 GUI。在此屏幕上,你可以集成/更新 UEFI 和报名参加 MOK,选择设置安全启动密码。要选择密码,请使用 Tab 键在密码字段和文本链接之间切换。
完成后立即重新启动:
sudo reboot now
重新启动后,您会看到一个蓝屏,询问您是否要继续启动或注册 MOK,这并不明显,但在这一步,选择注册 MOK并输入您在上一步中输入的安全启动密码。
完成后,你应该在运行时正确看到你的显卡详细信息
sudo nvidia-settings
上面的截图显示我仍然有这个错误:
RROR: nvidia-settings could not find the registry key file or the X server is not accessible. 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 prepopulated or validated, and will not be listed in the help text. Please see the README for possible values
and descriptions.
但驱动程序现在已正确加载。仍在研究注册表项文件错误的影响。
答案4
使用网络安装来安装 cuda 为我解决了这个问题。
您可以按照此处的说明进行安装:https://developer.nvidia.com/cuda-downloads