10

I have multiseat configured and my Xorg has 2 server layouts. One is for nVidia card and other is for Intel card. They both work, but display server assigned to Intel card doesn't have hardware acceleration since DRI and GLX module being used is from nVidia driver.

So my question is, can I configure layouts somehow to use right DRI and GLX with each card?

My 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

Log file for Intel:

[    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
2
  • 1
    If you're on 18.04, this should now Just Work (TM) thanks to glvnd support. On older versions, you needed to mess with LD_PRELOAD environment variables to make programs use the right libGL but this is now unnecessary :D
    – Léo Lam
    Aug 28, 2018 at 19:09
  • 1
    @LéoLam it took only 5 years. Better late than never I suppose.
    – MeanEYE
    Aug 30, 2018 at 12:39

6 Answers 6

7

Okay, so found a solution, but there's a bug preventing hardware acceleration from working on Intel GPU's at the moment in Ubuntu 12.10 with new Mesa 9.0.1 library.

In short, problem was with loading GLX. nVidia would push it's own GLX module and step on Intel's toes.

I found a solution by noticing this line:

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

Namely modules located in /usr/lib/x86_64-linux-gnu/xorg/extra-modules are all nVidia specific ones. So I configured LightDM to use two xorg.conf files. In Intel one, I've manually set ModulePath excluding nVidia directory. This resulted in loading of proper GLX module.

My /etc/lightdm/lightdm.conf file looks like this:

[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

Lines added to xorg.conf.intel:

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

On my side, with Ubuntu 14.04, the paths are different and Nvidia proprietary driver override libglx.so in /usr/lib/xorg/modules/extensions/libglx.so.

To solve the issue, I duplicate /usr/lib/xorg/modules in /usr/lib/xorg/modules-nvidia and then reinstall the Intel friendly libglx.so with :

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

This restore the original libglx.so. On the xorg.conf.nvidia, I add the path to the valid modules :

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

Also, in /etc/lightdm/lightdm.conf I have to add : xserver-command=/usr/bin/X -sharevts under [Seat:1] section. This tip have been found here.

Many thanks to MeanEYE who points me in the right way.

1

So I've done a bit of research and discovered that there are a number of different ways in which you can achieve Multiseat (Multi-station, multi-terminal etc.) configurations.

1) The method I would recommend, as it uses your standard Xorg and a built-in kernel driver, is using evdev. Here's a guide on how to setup a 4 GPU and 4 monitor multiseat configuration using evdev. The guide is meant for Debian Sarge and SiS GPUs, but I think you can infer a lot of very useful information from this guide: https://en.wikibooks.org/wiki/Multiterminal_with_evdev

2) Another method is using Xypher, a different X Windows server based on KDrive. I'm not sure this is the route you want to go, however here is that guide anyways: https://en.wikibooks.org/wiki/en:Multiterminal_with_Xephyr

3) Another option is to use a tool called Multiseat Display Manager (MDM) which promises to automate the entire setup process for you, however, it does not seem to be updated so I don't recommend it. You can find it easily with Google as a last resort, however.

I'm not aware of what you have or have not already done to your configuration, so your best bet is to read the evdev guide and try to identify the steps you've not done yet. The biggest differences I'm seeing is

A) In the example xorg.conf, there's only 1 Screen and ServerLayout section. The additional Screens and ServerLayout are defined in a separate conf all together: xorg.conf.probe

B) Additionally, all devices are explicitly referenced by their BusIDs, which were obtained using lspci and

C) Interrupts are disabled on irq 10.

Hopefully, this helps get you up and running, good luck!

2
  • Okay, this helps a lot. I'll try with 2 different xorg.conf files and hopefully get it to work.
    – MeanEYE
    Nov 24, 2012 at 18:16
  • This still doesn't solve my problem with nVidia GLX being loaded in case of Intel card.
    – MeanEYE
    Nov 24, 2012 at 21:52
0

In Ubuntu 16.04 I needed to update the /usr/local/bin/X wrapper with:

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

/etc/X11/Xsession.d/00ldlibrary can test the $XDG_SEAT variable and sets export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa:/usr/lib/i386-linux-gnu/mesa/ only for the Intel card.

0

In 18.04, glvnd support allows users to have both Mesa and proprietary Nvidia drivers installed very easily, without having to mess with LD_PRELOAD! All the environment variable things and the wrapper scripts are now unnecessary.


Since this isn't tagged with a specific Ubuntu version, and the existing answers did not fully work with my system (Ubuntu 15.10), I'm posting this answer which uses logind.

Basically, to get GLX and libGL to work, you have to configure both the X server and the user session to use the correct libGL implementation, depending on the seat.

Therefore you need a wrapper script for LightDM to start X, and a Xsession script to set LD_LIBRARY_PATH so that the session uses the correct libGL.


In /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

(assuming that seat1 uses nvidia and seat0 mesa)


Similarily, you need to wrap the X server (/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 "$@"

Finally, you'll need to configure LightDM to use these in /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

For more details, see my multiseat-mesa-nvidia repo which has more details and has the complete configuration files and scripts.

-1

I'm using Arch linux, but this helped me a little to get both my Intel and my Nvidia-proprietary drivers loaded with gl/vaapi/vdpau functionality.

All you need to do (q&d):

Install proprietary nvidia-utils.

Copy /usr/lib/xorg/modules to /usr/lib/xorg/modules_nvidia

Download and unpack the latestlibva-intel-driver, mesa-vdpau, mesa, mesa-libgl, and xorg-server as packages fitting your architecture in a separate directory. Then cp -r (as root/sudo) the contents of "separate directory"/usr/lib to something like /usr/lib_intel and "separate directory"/usr/lib/xorg/modules/* to your actual /usr/lib/xorg/modules directory (overwriting).

And

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

Restart X-Servers, try glxinfo

This will self-destruct on nvidia-updates of course.

I found out that this is not working when rebooting.

Much better hack:

Don't create a ld.so.conf.d/file. Instead, add the following to /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

change "vt7" to whatever your display manager uses to start your intel x-server (:0, :2, vt7, vt8, isolatodevice=...)

Of Course, you can also copy /usr/bin/X to /usr/bin/Xintel and edit that instead, pointing your wm to this file (kdm 'ServerCmd').

Then, edit or create a new your session-file, i.e. /usr/bin/startkde (no checking for DISPLAY#!) , adding:

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

That way, you don't even need to overwrite anything. rm'ing the /usr/lib_intel directory and resetting the 2 edited files is everything you need to do to remove this hack again.

1
  • Ubuntu is quite different from Arch Linux, so while the general idea is good (LD_LIBRARY_PATH), it won't work on an Ubuntu system.
    – Léo Lam
    Feb 13, 2016 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .