![连接多个显示器 Ubuntu 20.04 LTS](https://linux22.com/image/941264/%E8%BF%9E%E6%8E%A5%E5%A4%9A%E4%B8%AA%E6%98%BE%E7%A4%BA%E5%99%A8%20Ubuntu%2020.04%20LTS.png)
我有一台华硕 ROG Strix 笔记本电脑,规格如下。
Standing screen display size 15.6 Inches
Screen Resolution 1920 x 1080 pixels
Max Screen Resolution 1920 x 1080 Pixels
Processor 4.4 GHz amd_ryzen_7_5800x
RAM 16 GB DDR4
Memory Speed 3200 MHz
Hard Drive 1 TB SSD
Graphics Coprocessor NVIDIA GeForce RTX 3050 Ti
Chipset Brand NVIDIA
Card Description GeForce RTX 3050 Ti
Graphics Card Ram Size 4 GB
Wireless Type Bluetooth, 802.11ax
Number of USB 3.0 Ports 4
Other Technical Details
Brand ASUS
Series ROG Strix G15
Item model number G513QE-ES76
Hardware Platform PC
Operating System Windows 10 Home
Item Weight 4.63 pounds
Product Dimensions 13.94 x 10.2 x 1.02 inches
Item Dimensions LxWxH 13.94 x 10.2 x 1.02 inches
Color Eclipse Gray
Processor Brand AMD
Processor Count 8
Computer Memory Type DDR4 SDRAM
Flash Memory Size 1
Hard Drive Interface Solid State
Voltage 20 Volts
Batteries 1 Lithium ion batteries required. (included)
我nvidia-driver-470
的主图形驱动程序适用于双屏显示器。我尝试通过扩展坞扩展到另一台显示器,但未检测到第三台显示器。扩展坞通过 USB-C 3.2 端口连接。我在 Windows 10 中测试了此配置,所有三台显示器都使用此设置连接。但不知何故,这不适用于 Ubuntu 20.04 和这台华硕笔记本电脑。请告诉我我是否可以做其他事情来连接另一台显示器。
$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 8087:0029 Intel Corp.
Bus 003 Device 003: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button)
Bus 003 Device 002: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device
Bus 001 Device 003: ID 046d:c318 Logitech, Inc. Illuminated Keyboard
Bus 001 Device 007: ID 2109:0103 VIA Labs, Inc. USB 2.0 Hub
Bus 001 Device 006: ID 1a40:0801 Terminus Technology Inc. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
如果两个显示器都连接到 USB-C 底座,则xrandr
输出如下。
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1920x1080 300.01*+ 60.00 + 59.97 59.96 59.93
1680x1050 300.01 84.94 74.89 69.88 59.95 59.88
1600x1024 60.17
1400x1050 85.00 74.76 70.00 59.98
1600x900 59.99 59.94 59.95 59.82
1280x1024 300.01 85.02 75.02 60.02
1440x900 300.01 59.89
1400x900 59.96 59.88
1280x960 85.00 60.00
1440x810 60.00 59.97
1368x768 59.88 59.85
1360x768 59.80 59.96
1280x800 300.01 59.99 59.97 59.81 59.91
1152x864 100.00 85.06 85.00 75.00 75.00 70.00 60.00
1280x720 300.01 60.00 59.99 59.86 59.74
1024x768 300.01 85.00 75.05 60.04 85.00 75.03 70.07 60.00
1024x768i 86.96
960x720 85.00 75.00 60.00
928x696 75.00 60.05
896x672 75.05 60.01
1024x576 59.95 59.96 59.90 59.82
960x600 59.93 60.00
832x624 74.55
960x540 59.96 59.99 59.63 59.82
800x600 300.01 85.00 75.00 70.00 65.00 60.00 85.14 72.19 75.00 60.32 56.25
840x525 85.02 74.96 69.88 60.01 59.88
864x486 59.92 59.57
800x512 60.17
700x525 85.08 74.76 70.06 59.98
800x450 59.95 59.82
640x512 85.02 75.02 60.02
720x450 59.89
700x450 59.96 59.88
640x480 300.01 85.09 60.00 85.01 72.81 75.00 59.94
720x405 59.51 58.99
720x400 85.04
684x384 59.88 59.85
680x384 59.80 59.96
640x400 59.88 59.98 85.08
576x432 100.11 85.15 85.09 75.00 75.00 70.00 60.06
640x360 59.86 59.83 59.84 59.32
640x350 85.08
512x384 85.00 75.03 70.07 60.00
512x384i 87.06
512x288 60.00 59.92
416x312 74.66
480x270 59.63 59.82
400x300 85.27 72.19 75.12 60.32 56.34
432x243 59.92 59.57
320x240 85.18 72.81 75.00 60.05
360x202 59.51 59.13
360x200 85.04
320x200 85.27
320x180 59.84 59.32
320x175 85.27
HDMI-1 disconnected (normal left inverted right x axis y axis)
$ uname -r
5.12.17-051217-generic
有相关问题这里,这里,这里, 尤其这里, 和这里(特别是华硕)但它不能解决我的问题。
笔记:
- 这在 Windows 和 Mac 上都有效,所以这一定是一个孤立的 Linux 问题。
- Ubuntu 21.04 也不起作用。
更新:
- 升级到 Ubuntu 21.04,它比启用 Wayland 的 Ubuntu 20.04 友好得多。
lsusb
使用底座:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 8087:0029 Intel Corp. AX200 Bluetooth
Bus 003 Device 002: ID 046d:c318 Logitech, Inc. Illuminated Keyboard
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 0951:1666 Kingston Technology DataTraveler 100 G3/G4/SE9 G2/50
Bus 002 Device 005: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 002 Device 003: ID 05e3:0620 Genesys Logic, Inc. USB3.0 Hub
Bus 002 Device 002: ID 05e3:0620 Genesys Logic, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device
Bus 001 Device 003: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button)
Bus 001 Device 007: ID 1e4e:0898 Cubeternet Billboard Device
Bus 001 Device 006: ID 0572:1703 Conexant Systems (Rockwell), Inc. ASUS USB Audio
Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lsusb
没有底座:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 8087:0029 Intel Corp. AX200 Bluetooth
Bus 003 Device 002: ID 046d:c318 Logitech, Inc. Illuminated Keyboard
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device
Bus 001 Device 003: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
答案1
我的答案可能对每个人都没有绝对的帮助,但我成功了。我买了另一个码头。
- 卸载 Ubuntu 20.04,安装 21.04(感谢@galexite 和@mondotofu 的评论——见上文)
- 启用 Wayland。
- 安装
nvidia
驱动程序(很多人会说不要这样做,但我这样做了,因为我尝试了很多选项,但它们不适合我的情况)。nvidia-470
是我的选择。 - 安装 Displaylink(是的,尽管目前的版本是 20.04)
sudo apt update
sudo apt install dkms
sudo apt install libdrm-dev
sudo ./displaylink-driver-5.3.0.xx.run
- 启用雷电(我没有雷电 - 如果你有的话你很幸运):我不知道为什么,但我的底座(通过 USB-C Type C Gen 3.2)在此之后突然工作了。
p/s:我确实运行了sudo update-initramfs -u
几次。总的来说,我的印象是使用 Ubuntu 21.04 的精简版本,启用 Wayland,然后安装 Display,然后安装 Nvidia。然后一切就会水到渠成了。
- 不使用
lightdm
(?) - 安装
nvidia-driver-470
sudo prime-select query
nvidia
$ sudo grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*
/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb
/lib/modprobe.d/nvidia-kms.conf:# This file was generated by nvidia-prime
/lib/modprobe.d/nvidia-kms.conf:options nvidia-drm modeset=1
$ cat /etc/gdm3/custom.conf
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=anhvt89
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false
# Enabling automatic login
# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 10
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
- ~~注意:
/etc/X11/xorg.conf
以前不存在,但仍然可以正常工作。~~不是保存到/etc/X11/xorg.conf
。这会破坏显示配置(不知道为什么,但绝对肯定这是罪魁祸首)。
$ cat /etc/X11/xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 470.57.01
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
Section "Files"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
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"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "DELL U2414H"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "NVIDIA GeForce RTX 3050 Ti Laptop GPU"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Stereo" "0"
Option "nvidiaXineramaInfoOrder" "DFP-0.2"
Option "metamodes" "nvidia-auto-select +3840+0 {rotation=left}"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSubSection
EndSection
以下是一些有用的参考资料:
echo $XDG_SESSION_TYPE
x11
附言:
- 我能够用
5.11.0-37-generic
内核配置 3 个屏幕,但是当它更新时5.11.0-38-generic
问题又出现了。 nvidia
更新内核后可能会有更新机会,如下所述这里就我而言,
dpkg-reconfigure nvidia-driver-470 > /var/log/dpkg-reconfigure-nvidia.log 2>&1
sudo cp /etc/default/grub /etc/default/grub.bak
然后编辑/etc/default/grub
为
# GRUB_DEFAULT=0
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.11.0-37-generic"
然后
sudo update-grub