在这台笔记本电脑上运行 Ubuntu 时遇到了很多问题。最初是安全启动出现问题(现已关闭),之后安装程序在选中“允许专有驱动程序”时失败。
实际上,我现在无法正确安装图形驱动程序。我尝试了各种版本,虽然根据 nvidias 网站的说法,nvidia-430 应该可以工作,但我发现 nvidia-396 是唯一不会破坏 xorg 的东西 - 也就是说,当激活时,检查 ScreenFetch 和“关于”它仍然显示我的 GPU 为英特尔。
nvidia-settings 似乎可以在两者之间正常切换。但 nvidia-smi 无法与驱动程序通信,因此一定出了问题,并且正在使用英特尔作为后备。
有人能帮助我诊断出事情失败的原因吗?
启动选项
猫/etc/默认/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash quiet acpi_rev_override=1 acpi_osi=Linux nouveau.modeset=0 pcie_aspm=force drm.vblankoffdelay=1 scsi_mod.use_blk_mq=1 nouveau.runpm=0 mem_sleep_default=deep pti=off spectre_v2=off l1tf=off nospec_store_bypass_disable no_stf_barrier"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
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.
ps -efly | grep Xorg
S root 6104 1516 2 80 0 34668 106513 - 23:23 tty7 00:00:15 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
S nemo 13827 13527 0 80 0 1096 5384 pipe_w 23:35 pts/3 00:00:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn Xorg
猫/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/4.19.14-041914-generic/updates/dkms
Looking for amdgpu modules in /lib/modules/4.19.14-041914-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:1c20
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
xorg配置文件
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 430.26
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
.xsession 错误
us-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting DISPLAY=:0
dbus-update-activation-environment: setting XAUTHORITY=/home/nemo/.Xauthority
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1
dbus-update-activation-environment: setting LANG=en_GB.UTF-8
dbus-update-activation-environment: setting GDM_LANG=en_GB
dbus-update-activation-environment: setting DISPLAY=:0
dbus-update-activation-environment: setting MANDATORY_PATH=/usr/share/gconf/i3.mandatory.path
dbus-update-activation-environment: setting S_COLORS=auto
dbus-update-activation-environment: setting XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/nemo
dbus-update-activation-environment: setting USER=nemo
dbus-update-activation-environment: setting DESKTOP_SESSION=i3
dbus-update-activation-environment: setting DEFAULTS_PATH=/usr/share/gconf/i3.default.path
dbus-update-activation-environment: setting PWD=/home/nemo
dbus-update-activation-environment: setting HOME=/home/nemo
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1
dbus-update-activation-environment: setting XDG_SESSION_TYPE=x11
dbus-update-activation-environment: setting XDG_DATA_DIRS=/usr/share/i3:/usr/local/share:/usr/share:/var/lib/snapd/desktop
dbus-update-activation-environment: setting XDG_SESSION_DESKTOP=i3
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting SHELL=/usr/bin/zsh
dbus-update-activation-environment: setting XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
dbus-update-activation-environment: setting IM_CONFIG_PHASE=1
dbus-update-activation-environment: setting XDG_CURRENT_DESKTOP=i3
dbus-update-activation-environment: setting GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
dbus-update-activation-environment: setting SHLVL=1
dbus-update-activation-environment: setting LANGUAGE=en_GB:en
dbus-update-activation-environment: setting GDMSESSION=i3
dbus-update-activation-environment: setting LOGNAME=nemo
dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting XDG_RUNTIME_DIR=/run/user/1000
dbus-update-activation-environment: setting XAUTHORITY=/home/nemo/.Xauthority
dbus-update-activation-environment: setting XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session2
dbus-update-activation-environment: setting XDG_CONFIG_DIRS=/etc/xdg/xdg-i3:/etc/xdg
dbus-update-activation-environment: setting PATH=/home/nemo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
dbus-update-activation-environment: setting _=/usr/bin/dbus-update-activation-environment
polybar|warn: The config parameter `bar/top.border-bottom` is deprecated, use `bar/top.border-bottom-size` instead.
polybar|error: Disabling module "xworkspaces" (reason: Missing parameter "module/xworkspaces.type")
polybar|error: Disabling module "wireless-network" (reason: Invalid network interface "net1")
polybar|error: Disabling module "wireless-network" (reason: Invalid network interface "net1")
polybar|error: Disabling module "wired-network" (reason: Invalid network interface "net0")
polybar|error: Failed to restack bar window
[7456:7456:0720/232429.787615:ERROR:sandbox_linux.cc(368)] InitializeSandbox() called with multiple threads in process gpu-process.
[7409:7448:0720/232429.856252:ERROR:data_store_impl.cc(131)] Failed to open Data Reduction Proxy DB: 3
[7456:7456:0720/232430.015873:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[7456:7456:0720/232536.625368:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[7456:7456:0720/232754.931509:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[7456:7456:0720/232758.093049:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[7456:7456:0720/232803.960556:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[7456:7456:0720/232805.870369:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[7456:7456:0720/233028.760073:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
编辑:
我相信,通过在安装 430 驱动程序后在 TTY 中运行命令,可以确认上述内容。请注意,这里根本没有 GUI。
Sun Jul 21 01:03:43 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 106... Off | 00000000:01:00.0 Off | N/A |
| N/A 55C P8 5W / N/A | 8MiB / 6078MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1583 G /usr/lib/xorg/Xorg 5MiB |
+-----------------------------------------------------------------------------+
ps -efly | grep Xorg
S root 1583 1487 0 80 0 48580 65741 - 01:00 tty7 00:00:00 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
S nemo 7027 4954 0 80 0 940 5384 pipe_w 01:06 tty4 00:00:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn Xorg
编辑:
很高兴提供任何可能对任何人有用的额外详细信息。需要这个,这样我才能让我的第二台显示器正常工作。
更新:
还是没运气。我认为主要问题是我不知道该读什么日志。
编辑:其他几个人也遇到了同样的问题https://ubuntuforums.org/showthread.php?t=2423396
编辑:附加日志
Xorg.0.log https://pastebin.com/FKh3C9Ta
Sun Aug 11 20:27:54 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.40 Driver Version: 430.40 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 106... Off | 00000000:01:00.0 Off | N/A |
| N/A 51C P8 5W / N/A | 8MiB / 6078MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1555 G /usr/lib/xorg/Xorg 5MiB |
+-----------------------------------------------------------------------------+
而且我还得到了主体中未使用受信任密钥签名的输出 PKCS#7 签名。
我的解决方案
几周前,一位朋友提到,当他使用 USB-C 转 HDMI 时,屏幕问题就消失了。我买了一个来试试。使用我正在使用的 nouveau 驱动程序,但没有成功,因此再次尝试使用新的 nvidia-440 驱动程序,并注意到 ubuntu 启动画面仅出现在我的第二台显示器上。
然后我与 xorg 斗争了一段时间,删除了 nvidia 生成的 xorg 后,它就正常工作了。
步骤很复杂,但希望对某人有所帮助。
答案1
您尝试安装的某些 Nvidia 驱动程序会破坏 X.Org,这表明当您尝试安装 Nvidia 驱动程序时,apt 可能无法与当前安装的 X.Org 版本正确集成。Nvidia 驱动程序有许多依赖项,包括 X.Org 依赖项包。要简化使所有依赖项协同工作的过程,请使用以下命令sudo ubuntu-drivers install
。sudo ubuntu-drivers install
安装适合自动安装的驱动程序及其依赖项。打开终端并输入:
sudo ubuntu-drivers install
sudo reboot
请注意,除非您在尝试自动安装任何新的 Nvidia 软件包之前卸载现有的 Nvidia 软件包并重新启动,否则broken packages
在尝试运行时可能会收到错误消息。要删除所有专有的 nvidia 软件包,请运行以下命令。sudo ubuntu-drivers install
sudo apt update
sudo apt-get remove '^nvidia'
sudo apt autoremove
sudo reboot
另一个技巧是使用--simulate
apt 选项来模拟命令将安装或更改的内容,而apt
无需实际更改任何内容。--simulate
普通用户无需 sudo 即可运行该选项,例如:
apt install --simulate nvidia-driver-430
答案2
这可能是一个“18.04 的事情”:Ubuntu 18.04 上未检测到外接显示器。我从来没有经历过升级到 18.04 或 19.04,但我已经在使用 LightDM。
我有一个接近但不完全相同的系统。Dell AW 17R3、I-7 6700HQ Intel HD 530 iGPU、nVidia GTX 970M GPU。除了上述评论外,我还将分享我的一些想法,xorg.conf
希望它能有所帮助:
$ cat /etc/X11/xorg.conf
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Monitor"
Identifier "DP-1-1"
Modeline "3840x2160_54.00" 637.50 3840 4152 4568 5296 2160 2163 2168 2230 -hsync +vsync
Option "PreferredMode" "3840x2160_54.00"
EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0@0:2:0"
Option "AccelMethod" "None"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1@0:0:0"
Option "ConstrainCursor" "off"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration" "on"
Option "IgnoreDisplayDevices" "CRT"
EndSection
忽略DP-1-1
显示器部分。它仅适用于我的第三台显示器,它有一个挑剔的 4K 电视、Thuderbolt 3 适配器、电缆或三者兼而有之。
答案3
在你的情况下,我可能会格式化系统(安装操作系统的所有驱动器)并从头开始。或者可能是 Ubuntu 安装程序已损坏。