英特尔卡上没有GLX,带有额外的nVidia卡

我有多个配置,我的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 

好的,所以找到了一个解决方案,但是在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/usr/lib/x86_64-linux-gnu/xorg/extra-modules都是特定于nVidia /usr/lib/x86_64-linux-gnu/xorg/extra-modules 。 所以我配置LightDM使用两个xorg.conf文件。 在Intel one中,我手动设置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 

在我看来,使用Ubuntu 14.04,路径是不同的,Nvidia专有驱动程序覆盖/usr/lib/xorg/modules/extensions/libglx.so libglx.so

要解决这个问题,我复制/usr/lib/xorg/modules /usr/lib/xorg/modules-nvidia中的/usr/lib/xorg/modules-nvidia ,然后重新安装Intel友好的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我必须在[Seat:1]部分添加: xserver-command=/usr/bin/X -sharevts 。 在这里找到了这个提示。

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

所以我做了一些研究,发现有许多不同的方法可以实现Multiseat(多站,多终端等)配置。

1)我建议的方法,因为它使用你的标准Xorg和内置的内核驱动程序,使用evdev 。 以下是如何使用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和ServerLayout部分。 附加的Screens和ServerLayout在一个单独的conf中定义:xorg.conf.probe

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

C) irq 10禁用中断。

希望这有助于您的运行,祝您好运!

在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/ only for英特尔卡。

在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台面)


类似地,你需要包装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 repo ,其中包含更多详细信息并具有完整的配置文件和脚本。

我正在使用Arch linux,但这对我的英特尔和我的Nvidia专有驱动程序加载gl/vaapi/vdpaufunctiongl/vaapi/vdpau

所有你需要做的(q&d):

安装专有的nvidia-utils

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

下载并解压缩最新的libva-intel-drivermesa-vdpaumesamesa-libglxorg-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-updates上自毁。

我发现重启时这不起作用。

更好的黑客:

不要创建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”更改为显示管理器用于启动intel x-server的任何内容(: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 

这样,你甚至不需要覆盖任何东西。 rm’ing / usr / lib_intel目录并重置2个已编辑的文件是您需要再次删除此hack所需的一切。