第二块显卡没有输出

第二块显卡没有输出

我正在尝试查明 GPU 直通不适用于我的 NVidia GTX 750 Ti 设备的原因。因此,我尝试使用该显卡启动第二个 X 实例 - 主要实例是 GTX 1070。

我将它们连接到同一台显示器 - 通过 DisplayPort 连接到 1070,通过 HDMI 连接到 750Ti。

启动 Windows 会导致两者被检测到并激活,并且我通过 DisplayPort 和 HDMI 获得输出。

使用 Linux 启动时,1070 可以正常工作。检测到750Ti:

# nvidia-smi -L
GPU 0: GeForce GTX 1070 (UUID: GPU-a66c5cbb-a541-a3d7-845c-f8c0c021ae71)
GPU 1: GeForce GTX 750 Ti (UUID: GPU-db546e26-f6d5-5345-45e4-434e0bfb4f62)

在 nvidia-settings 程序中,它显示为已连接到显示器。

但是,当启动第二个 Xorg 实例时,我在 HDMI 端口上没有得到任何输出。

我使用的命令是

sudo Xorg :2 vt8 -config xorg-second.conf  -configdir conf.d

其中conf.d为空,以确保没有应用其他设置,并且xorg-second.conf几乎是标准的除了

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    BusID          "PCI:3:0:0"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Coolbits" "4"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

以确保选择了正确的显卡。

我尝试过更换电缆,但这没有帮助。

为什么第二块显卡不将输出发送到我的显示器,如何修复它?


编辑xrandr:这是两个 X 实例的输出:

$ xrandr --display :1
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.97    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      59.90  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-5 disconnected (normal left inverted right x axis y axis)

$ xrandr --display :2
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 16384 x 16384
DVI-I-0 disconnected primary (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.97    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      60.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

有趣的是,当我xrandr --display :2第二次运行时,它挂起。输出的最后几行strace

socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path=@"/tmp/.X11-unix/X2"}, 20) = 0
getpeername(3, {sa_family=AF_UNIX, sun_path=@"/tmp/.X11-unix/X2"}, [124->20]) = 0
uname({sysname="Linux", nodename="mars", ...}) = 0
access("/run/user/1000/gdm/Xauthority", R_OK) = 0
open("/run/user/1000/gdm/Xauthority", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0700, st_size=96, ...}) = 0
read(4, "\1\0\0\4mars\0\0\0\22MIT-MAGIC-COOKIE-1\0\20"..., 4096) = 96
close(4)                                = 0
getsockname(3, {sa_family=AF_UNIX}, [124->2]) = 0
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="l\0\v\0\0\0\22\0\20\0\0\0", iov_len=12}, {iov_base="", iov_len=0}, {iov_base="MIT-MAGIC-COOKIE-1", iov_len=18}, {iov_base="\0\0", iov_len=2}, {iov_base="\36\271\266\234:\323(\237\35y\334(X\37\32\10", iov_len=16}, {iov_base="", iov_len=0}], 6) = 48
recvfrom(3, 0x18dd330, 8, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}], 1, -1

编辑2

$ xset -display :2 q(只是关于DPMS的部分)

DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Enabled
  Monitor is On

Xorg 日志 -https://pastebin.com/fK7g5VSd

答案1

在日志中,您可以看到服务器还:2检测到主显卡GTX 1070 (GP104-A) at PCI:1:0:0 (GPU-1)。这在常规 X 驱动程序中不会发生 - 如果您告诉驱动程序xorg.conf仅使用PCI:3:0:0,那么它只会使用这张卡,而不会看到任何其他卡。

所以我唯一的解释是,因为闭源Nvidia驱动程序使用不同的基础设施(与 Windows 和 Linux 非常相似的统一内核驱动程序),所以这些Nvidia驱动程序不是为处理这种情况而设计的,或者它们以不同的方式处理它。只要您使用闭源驱动程序,很可能内核驱动程序的单个实例就应该驱动所有可用的卡,仅此而已。没有人真正测试过使用多个 X 服务器连接到该单个实例(毕竟,Nvidia 甚至只为多个屏幕提供 nvidia 特定的“TwinView”)。更不用说对虚拟机中的一张卡使用一个内核驱动程序,而在虚拟机外部使用另一个内核驱动程序。

如果你不能使用nouveau驱动程序,那就真的没有办法了。

您可以尝试使用 Nvidia 专用的375.39 的选项,例如为两台服务器ProbeAllGpus设置为。FALSE也许这有帮助,也许没有。可能MultiGPU有帮助,尽管我认为这适用于不同的情况。

您还可以尝试ConnectedMonitorUseDisplayDevice某种方式限制显示。

测试这一理论的方法是使用两张 Nouveau 也支持的 Nvidia 卡,然后看看是否可以使 Nouveau 驱动程序以这种方式工作。不幸的是,我没有硬件来做到这一点。

相关内容