带有多座席和附加 nVidia 卡的英特尔卡上没有 GLX

带有多座席和附加 nVidia 卡的英特尔卡上没有 GLX

我配置了多座席,我的 Xorg 有 2 个服务器布局。一个用于 nVidia 卡,另一个用于 Intel 卡。它们都可以工作,但分配给 Intel 卡的显示服务器没有硬件加速,因为使用的 DRI 和 GLX 模块来自 nVidia 驱动程序。

所以我的问题是,我可以以某种方式配置布局以便在每张卡上使用正确的 DRI 和 GLX 吗?

我的 Xorg.conf:

Section "ServerLayout"
    Identifier     "Default"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "ServerLayout"
    Identifier     "TV"
    Screen      0  "Screen1" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL E198WFP"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 610"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "intel"
    BusID          "PCI:0:2:0"
    Option         "AccelMethod" "uxa"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "DFP-0: nvidia-auto-select +1440+0, DFP-1: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

英特尔日志文件:

[    18.239] 
X.Org X Server 1.13.0
Release Date: 2012-09-05
[    18.239] X Protocol Version 11, Revision 0
[    18.239] Build Operating System: Linux 2.6.24-32-xen x86_64 Ubuntu
[    18.239] Current Operating System: Linux bytewiper 3.5.0-18-generic #29-Ubuntu SMP Fri Oct 19 10:26:51 UTC 2012 x86_64
[    18.239] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.5.0-18-generic root=UUID=fc0616fd-f212-4846-9241-ba4a492f0513 ro quiet splash
[    18.239] Build Date: 20 September 2012  11:55:20AM
[    18.239] xorg-server 2:1.13.0+git20120920.70e57668-0ubuntu0ricotz (For technical support please see http://www.ubuntu.com/support) 
[    18.239] Current version of pixman: 0.26.0
[    18.239]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    18.239] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    18.239] (==) Log file: "/var/log/Xorg.1.log", Time: Wed Nov 21 18:32:14 2012
[    18.239] (==) Using config file: "/etc/X11/xorg.conf"
[    18.239] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    18.239] (++) ServerLayout "TV"
[    18.239] (**) |-->Screen "Screen1" (0)
[    18.239] (**) |   |-->Monitor "Monitor1"
[    18.240] (**) |   |-->Device "Device1"
[    18.240] (**) Option "Xinerama" "0"
[    18.240] (==) Automatically adding devices
[    18.240] (==) Automatically enabling devices
[    18.240] (==) Automatically adding GPU devices
[    18.240] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    18.240]    Entry deleted from font path.
[    18.240] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    18.240]    Entry deleted from font path.
[    18.240] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    18.240]    Entry deleted from font path.
[    18.240] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    18.240]    Entry deleted from font path.
[    18.240] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    18.240]    Entry deleted from font path.
[    18.240] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.
[    18.240]    Entry deleted from font path.
[    18.240] (==) FontPath set to:
    /usr/share/fonts/X11/misc,
    /usr/share/fonts/X11/Type1,
    built-ins
[    18.240] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"
[    18.240] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[    18.240] (II) Loader magic: 0x7f6917944c40
[    18.240] (II) Module ABI versions:
[    18.240]    X.Org ANSI C Emulation: 0.4
[    18.240]    X.Org Video Driver: 13.0
[    18.240]    X.Org XInput driver : 18.0
[    18.240]    X.Org Server Extension : 7.0
[    18.240] (II) config/udev: Adding drm device (/dev/dri/card0)
[    18.241] (--) PCI: (0:0:2:0) 8086:0152:1043:84ca rev 9, Mem @ 0xf7400000/4194304, 0xd0000000/268435456, I/O @ 0x0000f000/64
[    18.241] (--) PCI:*(0:1:0:0) 10de:104a:1458:3546 rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/134217728, 0xe8000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/524288
[    18.241] (II) Open ACPI successful (/var/run/acpid.socket)
[    18.241] Initializing built-in extension Generic Event Extension
[    18.241] Initializing built-in extension SHAPE
[    18.241] Initializing built-in extension MIT-SHM
[    18.241] Initializing built-in extension XInputExtension
[    18.241] Initializing built-in extension XTEST
[    18.241] Initializing built-in extension BIG-REQUESTS
[    18.241] Initializing built-in extension SYNC
[    18.241] Initializing built-in extension XKEYBOARD
[    18.241] Initializing built-in extension XC-MISC
[    18.241] Initializing built-in extension SECURITY
[    18.241] Initializing built-in extension XINERAMA
[    18.241] Initializing built-in extension XFIXES
[    18.241] Initializing built-in extension RENDER
[    18.241] Initializing built-in extension RANDR
[    18.241] Initializing built-in extension COMPOSITE
[    18.241] Initializing built-in extension DAMAGE
[    18.241] Initializing built-in extension MIT-SCREEN-SAVER
[    18.241] Initializing built-in extension DOUBLE-BUFFER
[    18.241] Initializing built-in extension RECORD
[    18.241] Initializing built-in extension DPMS
[    18.241] Initializing built-in extension X-Resource
[    18.241] Initializing built-in extension XVideo
[    18.241] Initializing built-in extension XVideo-MotionCompensation
[    18.241] Initializing built-in extension XFree86-VidModeExtension
[    18.241] Initializing built-in extension XFree86-DGA
[    18.241] Initializing built-in extension XFree86-DRI
[    18.241] Initializing built-in extension DRI2
[    18.241] (II) LoadModule: "glx"
[    18.241] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/libglx.so
[    18.247] (II) Module glx: vendor="NVIDIA Corporation"
[    18.247]    compiled for 4.0.2, module version = 1.0.0
[    18.247]    Module class: X.Org Server Extension
[    18.247] (II) NVIDIA GLX Module  310.19  Thu Nov  8 01:12:43 PST 2012
[    18.247] Loading extension GLX
[    18.247] (II) LoadModule: "intel"
[    18.248] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[    18.248] (II) Module intel: vendor="X.Org Foundation"
[    18.248]    compiled for 1.13.0, module version = 2.20.13
[    18.248]    Module class: X.Org Video Driver
[    18.248]    ABI class: X.Org Video Driver, version 13.0
[    18.248] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
    i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,
    E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
    965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
    4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,
    Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),
    Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),
    Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),
    Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),
    Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server,
    Ivybridge Server (GT2), Haswell Desktop (GT1), Haswell Desktop (GT2),
    Haswell Desktop (GT2+), Haswell Mobile (GT1), Haswell Mobile (GT2),
    Haswell Mobile (GT2+), Haswell Server (GT1), Haswell Server (GT2),
    Haswell Server (GT2+), Haswell SDV Desktop (GT1),
    Haswell SDV Desktop (GT2), Haswell SDV Desktop (GT2+),
    Haswell SDV Mobile (GT1), Haswell SDV Mobile (GT2),
    Haswell SDV Mobile (GT2+), Haswell SDV Server (GT1),
    Haswell SDV Server (GT2), Haswell SDV Server (GT2+),
    Haswell ULT Desktop (GT1), Haswell ULT Desktop (GT2),
    Haswell ULT Desktop (GT2+), Haswell ULT Mobile (GT1),
    Haswell ULT Mobile (GT2), Haswell ULT Mobile (GT2+),
    Haswell ULT Server (GT1), Haswell ULT Server (GT2),
    Haswell ULT Server (GT2+), Haswell CRW Desktop (GT1),
    Haswell CRW Desktop (GT2), Haswell CRW Desktop (GT2+),
    Haswell CRW Mobile (GT1), Haswell CRW Mobile (GT2),
    Haswell CRW Mobile (GT2+), Haswell CRW Server (GT1),
    Haswell CRW Server (GT2), Haswell CRW Server (GT2+),
    ValleyView PO board
[    18.248] (++) using VT number 8

[    18.593] (II) intel(0): using device path '/dev/dri/card0'
[    18.593] (**) intel(0): Depth 24, (--) framebuffer bpp 32
[    18.593] (==) intel(0): RGB weight 888
[    18.593] (==) intel(0): Default visual is TrueColor
[    18.593] (**) intel(0): Option "AccelMethod" "uxa"
[    18.593] (--) intel(0): Integrated Graphics Chipset: Intel(R) Ivybridge Desktop (GT1)
[    18.593] (**) intel(0): Relaxed fencing enabled
[    18.593] (**) intel(0): Wait on SwapBuffers? enabled
[    18.593] (**) intel(0): Triple buffering? enabled
[    18.593] (**) intel(0): Framebuffer tiled
[    18.593] (**) intel(0): Pixmaps tiled
[    18.593] (**) intel(0): 3D buffers tiled
[    18.593] (**) intel(0): SwapBuffers wait enabled

...

[    20.312] (II) Module fb: vendor="X.Org Foundation"
[    20.312]    compiled for 1.13.0, module version = 1.0.0
[    20.312]    ABI class: X.Org ANSI C Emulation, version 0.4
[    20.312] (II) Loading sub module "dri2"
[    20.312] (II) LoadModule: "dri2"
[    20.312] (II) Module "dri2" already built-in
[    20.312] (==) Depth 24 pixmap format is 32 bpp
[    20.312] (II) intel(0): [DRI2] Setup complete
[    20.312] (II) intel(0): [DRI2]   DRI driver: i965
[    20.312] (II) intel(0): Allocated new frame buffer 1920x1080 stride 7680, tiled
[    20.312] (II) UXA(0): Driver registered support for the following operations:
[    20.312] (II)         solid
[    20.312] (II)         copy
[    20.312] (II)         composite (RENDER acceleration)
[    20.312] (II)         put_image
[    20.312] (II)         get_image
[    20.312] (==) intel(0): Backing store disabled
[    20.312] (==) intel(0): Silken mouse enabled
[    20.312] (II) intel(0): Initializing HW Cursor
[    20.312] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[    20.313] (**) intel(0): DPMS enabled
[    20.313] (==) intel(0): Intel XvMC decoder enabled
[    20.313] (II) intel(0): Set up textured video
[    20.313] (II) intel(0): [XvMC] xvmc_vld driver initialized.
[    20.313] (II) intel(0): direct rendering: DRI2 Enabled
[    20.313] (==) intel(0): hotplug detection: "enabled"
[    20.332] (--) RandR disabled

[    20.335] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

[    20.335] (II) intel(0): Setting screen physical size to 508 x 285
[    20.338] (II) XKB: reuse xkmfile /var/lib/xkb/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm
[    20.340] (II) config/udev: Adding input device Power Button (/dev/input/event1)
[    20.340] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[    20.340] (II) LoadModule: "evdev"
[    20.340] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so

答案1

好的,找到了解决方案,但是有一个错误目前,Ubuntu 12.10 中使用新的 Mesa 9.0.1 库时,硬件加速无法在 Intel GPU 上运行。

简而言之,问题在于加载 GLX。nVidia 会推出自己的 GLX 模块,并侵犯英特尔的权益。

我通过注意到这一行找到了解决方案:

[    18.240] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"

也就是说,位于的模块/usr/lib/x86_64-linux-gnu/xorg/extra-modules都是 nVidia 特定的。所以我将 LightDM 配置为使用两个xorg.conf文件。在 Intel 中,我手动设置了ModulePath排除 nVidia 目录。这导致加载了正确的 GLX 模块。

我的/etc/lightdm/lightdm.conf文件如下所示:

[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
allow-guest=false

[Seat:0]
xserver-layout=Default
xserver-config=xorg.conf.nvidia

[Seat:1]
xserver-layout=TV
xserver-config=xorg.conf.intel

添加到的行xorg.conf.intel

Section "Files"
    ModulePath     "/usr/lib/xorg/extra-modules"
    ModulePath     "/usr/lib/xorg/modules"
EndSection

答案2

就我而言,使用 Ubuntu 14.04,路径不同,并且 Nvidia 专有驱动程序libglx.so覆盖/usr/lib/xorg/modules/extensions/libglx.so

为了解决这个问题,我复制/usr/lib/xorg/modules/usr/lib/xorg/modules-nvidia 重新安装英特尔友好版libglx.so

sudo apt-get install --reinstall xserver-xorg-core

这将恢复原始状态libglx.so。在 上xorg.conf.nvidia,我添加了有效模块的路径:

Section "Files" ModulePath "/usr/lib/xorg/modules-nvidia" EndSection

另外,/etc/lightdm/lightdm.conf我必须在部分xserver-command=/usr/bin/X -sharevts下添加:[Seat:1]此提示已被发现这里

非常感谢平均眼谁给我指明了正确的方向。

答案3

因此我做了一些研究,发现有很多不同的方法可以实现多座位(多站、多终端等)配置。

1)我推荐的方法是使用标准 Xorg 和内置内核驱动程序埃夫德夫。这是关于如何使用 evdev 设置 4 GPU 和 4 显示器多座配置的指南。该指南适用于 Debian Sarge 和 SiS GPU,但我认为您可以从本指南中推断出很多非常有用的信息:https://en.wikibooks.org/wiki/Multiterminal_with_evdev

2)另一种方法是使用赛弗,一个基于 KDrive 的不同 X Windows 服务器。我不确定这是你想要的路线,不过这里还是有指南的:https://en.wikibooks.org/wiki/en:Multiterminal_with_Xephyr

3)另一个选择是使用一个名为多席位显示管理器 (MDM)它承诺会为您自动完成整个安装过程,但是它似乎没有更新,所以我不推荐它。不过,作为最后的手段,您可以使用 Google 轻松找到它。

我不知道你对你的配置做了什么或没做什么,所以你最好的选择是阅读evdev 指南并尝试找出你尚未完成的步骤。我看到的最大区别是

A)在示例 xorg.conf 中,只有 1 个 Screen 和 ServerLayout 部分。其他 Screens 和 ServerLayout 都定义在单独的 conf 中:xorg.conf.probe

B)此外,所有设备都通过其 BusID 明确引用,这些 BusID 是使用 lspci 和

C)irq 10 上的中断被禁用。

希望这能帮助您快速起步并顺利运行,祝您好运!

答案4

在 18.04 中,glvnd 支持允许用户轻松安装 Mesa 和专有 Nvidia 驱动程序,而不必与 LD_PRELOAD 混在一起!现在所有环境变量和包装脚本都不再必要。


由于这没有标记特定的 Ubuntu 版本,并且现有的答案不能完全适用于我的系统(Ubuntu 15.10),所以我发布了使用 的这个答案logind

基本上,要使 GLX 和 libGL 工作,你必须配置 X 服务器用户会话使用正确的 libGL 实现,具体取决于席位。

因此,您需要一个 LightDM 包装脚本来启动 X,以及一个 Xsession 脚本来设置,LD_LIBRARY_PATH以便会话使用正确的 libGL。


/etc/X11/Xsession.d/00ldlibrary

#!/bin/bash

if ps aux | grep "/usr/local/bin/X $DISPLAY" | grep -q seat1; then
    export LD_LIBRARY_PATH=/usr/lib/nvidia-352:/usr/lib32/nvidia-352
fi
if ps aux | grep "/usr/local/bin/X $DISPLAY" | grep -q seat0; then
    export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa:/usr/lib/i386-linux-gnu/mesa/
fi

(假设seat1使用nvidia,seat0使用mesa)


类似地,您需要包装 X 服务器(/usr/local/bin/X):

#!/bin/bash

if grep -q seat1 <<<$*; then
    export LD_LIBRARY_PATH=/usr/lib/nvidia-352
    echo "Detected seat1, using nvidia-352 libs"
fi
if grep -q seat0 <<<$*; then
    export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa
    echo "Detected seat0, using mesa libs"
fi

exec /usr/bin/Xorg "$@"

最后,您需要配置 LightDM 以使用这些功能/etc/lightdm/lightdm.conf

[Seat:*]
# needed to use the correct libraries for mesa/nvidia,
# along with a Xsession.d script (00ldlibrary)
xserver-command=/usr/local/bin/X
session-setup-script=/etc/X11/Xsession.d/00ldlibrary

有关详细信息,请参阅我的 multiseat-mesa-nvidia 仓库其中有更多详细信息并具有完整的配置文件和脚本。

相关内容