ubuntu 18.04 第二台显示器不工作

ubuntu 18.04 第二台显示器不工作

我有一个 Ubuntu 18.04,安装在 Legion y7000 上,配备 NVIDIA 1060m GPU,当然还有英特尔集成 GPU 卡,但我不使用它。我有三个显示器,包括两个外接显示器(分别通过 DP 端口和 HDMI 端口)和一个笔记本电脑的内部显示器。不工作的是通过 DP 端口的 VGA 显示器。内部显示器也不工作,但我不在乎。最近,我手动将 GPU 驱动程序从 430 升级到 525。通过以下命令。

  • 重启,
  • ctrl+alt+f2 进入控制台,以 root 身份登录。
  • sudo service lightdm stop(我碰巧知道我的显示管理器是 gdm3,而不是 lightdm)
  • sudo apt remove --purge nvidia*
  • sudo systemctl 隔离多用户.target
  • sudo ./NVIDIA-Linux-x86_64-525.105.17.run
  • sudo 重启

在升级NVIDIA GPU驱动之前,在Ubuntu设置面板中,我关闭了Y7000内置显示器的使用,只使用两个外接显示器。

升级之后,我的外接 DP 口显示器不工作了,很奇怪,在 NVIDIA x server 设置里可以看到,在 Ubuntu 系统设置面板里也可以看到,用 xrandr 也可以看到这个画面,但是在我把显示器操作面板里的信号输入从其他切换到 VGA 后,就只有黑屏没有输出,在 ubuntu 系统设置面板里可以设置合并显示或者镜像显示,但是那个显示器无论如何都没有图像输出,
我现在用的是 gnome\gdm3\xorg\xserver,这个软件栈很复杂,我知道的就这些,不知道是不是 NVIDIA GPU 新驱动版本的问题,支持这样的双显示器应该很常见吧,
下面是 xrandr 的输出

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+
   1680x1050     59.95  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      60.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   640x480       75.00    72.81    59.94  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  59.94    50.00    60.00    50.04  
   1680x1050     59.95  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      60.00    59.94    50.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)

下面是我的 Ubuntu 系统设置面板

Ubuntu 系统设置面板

系统信息:uname -a

Linux lenovo 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Nouveau 被禁止通过此 cat /etc/modprobe.d/blacklist-nouveau.conf

blacklist nouveau
options nouveau modeset=0

下面是 xorg.conf

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 525.105.17

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 525.105.17

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
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      "AOC 24P1W1"
    HorizSync       30.0 - 83.0
    VertRefresh     50.0 - 76.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "AOC 24P1W1"
    HorizSync       30.0 - 83.0
    VertRefresh     50.0 - 76.0
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060"
    BusID          "PCI:1:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Screen"

# Removed Option "metamodes" "HDMI-0: nvidia-auto-select +0+0 {AllowGSYNC=Off}"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-2"
    Option         "metamodes" "HDMI-0: nvidia-auto-select +1920+0 {AllowGSYNC=Off}, DP-0: nvidia-auto-select +0+0; HDMI-0: nvidia-auto-select +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1920x1080_60_0 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1920x1080_50 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1920x1080_60i +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1920x1080_50i +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1680x1050 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1440x900 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1280x1024 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1280x1024_60 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1280x960 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1280x720 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1280x720_60_0 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1280x720_50 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1024x768 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1024x768_70 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 1024x768_60 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 800x600 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 800x600_72 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 800x600_60 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 800x600_56 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 720x576 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 720x480 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 640x480 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 640x480_72 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 640x480_60 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: 640x480_60_0 +1920+0, DP-0: nvidia-auto-select +0+0; HDMI-0: nvidia-auto-select +1920+0 {viewportin=1366x768, viewportout=1920x1079+0+0}, DP-0: nvidia-auto-select +0+0; HDMI-0: nvidia-auto-select +1920+0 {viewportin=1280x800, viewportout=1728x1080+96+0}, DP-0: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DP-0: nvidia-auto-select +0+0 {AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

以下是我的 nvidia x 服务器设置

在此处输入图片描述

而且我在 windows10 操作系统中尝试了这三个显示器,一切都正常。所以硬件没有问题。

sudo lshw -C 显示的输出

[sudo] alvin 的密码: 
  *-display                 
       description: VGA compatible controller
       product: GP106M [GeForce GTX 1060 Mobile]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:149 memory:a3000000-a3ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:4000(size=128) memory:a4000000-a407ffff
  *-display
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:147 memory:a2000000-a2ffffff memory:b0000000-bfffffff ioport:5000(size=64) memory:c0000-dffff

nvidia-smi

Tue Apr 25 16:32:08 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.105.17   Driver Version: 525.105.17   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   57C    P8     4W /  78W |    263MiB /  6144MiB |      2%   E. Process |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3254      G   ...398893387193384678,131072      102MiB |
|    0   N/A  N/A      5114      G   /usr/lib/xorg/Xorg                126MiB |
|    0   N/A  N/A      5350      G   /usr/bin/gnome-shell               30MiB |
+-----------------------------------------------------------------------------+

cat /etc/X11/默认显示管理器

/usr/sbin/gdm3

相关内容