带有附加nVidia卡的多座Intel卡上没有GLX


10

我已经配置了多人座,并且我的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
如果您使用的是18.04,则由于glvnd支持,因此现在应该可以正常工作了。在较旧的版本上,您需要弄乱LD_PRELOAD环境变量以使程序使用正确的libGL,但是现在这是不必要的:D
Lao Lam,

1
@LéoLam只用了5年时间。迟到总比我想不到好。
MeanEYE

Answers:


7

好的,因此找到了一个解决方案,但是存在一个错误该错误阻止了使用新的Mesa 9.0.1库在Ubuntu 12.10中的硬件加速在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 one中,我手动设置了ModulePathnVidia目录。这导致了适当的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

1

在我这一边,使用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]部分添加:。在这里找到这个技巧。

非常感谢MeanEYE,他以正确的方式指出了我。


1

因此,我进行了一些研究,发现可以采用多种不同的方法来实现Multiseat(多工作站,多终端等)配置。

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

2)另一种方法是使用Xypher,这是基于KDrive的另一台X Windows服务器。我不确定这是您要走的路线,但是无论如何,这里都是该指南:https ://en.wikibooks.org/wiki/en: Multiterminal_with_Xephyr

3)另一个选择是使用一个名为Multiseat Display Manager(MDM)的工具,该工具可以为您自动完成整个设置过程,但是,它似乎没有更新,因此不建议使用。不过,您可以通过Google轻松找到它。

我不知道您对配置已经完成或尚未完成,所以最好的选择是阅读evdev指南并尝试确定尚未完成的步骤。我看到的最大区别是

A)在示例xorg.conf中,只有1个Screen and ServerLayout部分。附加的Screens和ServerLayout在单独的conf中一起定义:xorg.conf.probe

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

C)在irq 10上禁止中断。

希望这可以帮助您启动并运行,祝您好运!


好的,这很有帮助。我将尝试使用2个不同的xorg.conf文件,并希望它能正常工作。
MeanEYE 2012年

这仍然不能解决我的问题,如果使用Intel卡,则要加载nVidia GLX。
MeanEYE 2012年

0

在Ubuntu 16.04中,我需要使用以下命令更新/usr/local/bin/X包装器:

exec /usr/bin/Xorg -modulepath '/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules' "$@"

/etc/X11/Xsession.d/00ldlibrary可以测试$XDG_SEAT变量并 export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa:/usr/lib/i386-linux-gnu/mesa/仅针对Intel卡进行设置。


0

在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存储库,其中包含更多详细信息以及完整的配置文件和脚本。


-1

我正在使用Arch linux,但这对我和Intel和Nvidia专有驱动程序都加载了一些gl/vaapi/vdpau功能。

您需要做的所有事情(q&d):

安装专有的nvidia-utils

复制/usr/lib/xorg/modules/usr/lib/xorg/modules_nvidia

下载并解压缩最新的libva-intel-drivermesa-vdpaumesamesa-libgl,并xorg-server为封装在一个单独的目录适合您的架构。然后cp -r(以root / sudo身份)将内容复制"separate directory"/usr/lib到类似的目录/usr/lib_intel并复制"separate directory"/usr/lib/xorg/modules/*到您的实际/usr/lib/xorg/modules目录中(覆盖)。

echo "/usr/lib_intel" > /etc/ld.conf.d/intel_glx.conf
ldconfig

重新启动X-Servers,尝试glxinfo

当然,这会在nvidia更新上自毁。

我发现重新启动时不起作用。

更好的技巧:

不要创建ld.so.conf.d /文件。而是将以下内容添加到/ usr / bin / X:

PREV_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
if [[ "$@" == *"vt7"* ]]
then
export LD_LIBRARY_PATH=/usr/lib_intel;$PREV_LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib_intel/libGL.so
fi

将“ vt7”更改为显示管理器用来启动英特尔x服务器的任何内容(:0,:2,vt7,vt8,isolatodevice = ...)

当然,您也可以将/ usr / bin / X复制到/ usr / bin / Xintel并进行编辑,将wm指向该文件(kdm'ServerCmd')。

然后,编辑或创建一个新的会话文件,即/ usr / bin / startkde(不检查DISPLAY#!),添加:

export LD_LIBRARY_PATH=/usr/lib_intel;$PREV_LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib_intel/libGL.so

这样,您甚至都不需要覆盖任何内容。删除/ hack / lib_intel目录并重置2个已编辑的文件是您再次要删除此hack所需要做的一切。


Ubuntu与Arch Linux截然不同,因此尽管总体思路不错(LD_LIBRARY_PATH),但它在Ubuntu系统上不起作用。
黎逸麟
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.