Individual x windows server for a dual display setup

I have a GEFORCE GTX 1050Ti that I need to setup on Ubuntu (16.04 LTS)) that has two monitors. The application (Matlab program) requires that each display have its own x-window server.

Running the “NVIDIA X Server Settings”, it looks like I am able to set each display to “X Screenm 0” and “X screen 1”, applying the settings does give a host of warnings but does allow it to proceed. After restart the display manager (sudo systemctl restart lightdm.service) only one display works. The second is black.

What is needed to get this to work?

Two xservers on one gpu won’t work but maybe you mistake ‘servers’ for ‘screens’? For the latter, see this:
https://download.nvidia.com/XFree86/Linux-x86_64/384.98/README/configmultxscreens.html

…in the case of two seperate screens, most if not all DEs will only use one. You will have to set the DISPLAY variable right to run aplications on that screen like
DISPLAY=:0.1 someprogram

Are you saving the xorg.conf? I only see you applying a config to the running system via nvidia-settings.

We’ve created multiple multi-screen xorg.conf with nvidia-settings without issue. If we are saving the xorg.conf file to /etc/X111/xorg.conf can you post the xorg.conf file?

I am new to linux but the below file has been saved to /etc/X11/ and the display manager restated. i think it is working. The user will test it out shortly. Here is the content of the xorg.conf file:

nvidia-settings: X configuration file generated by nvidia-settings

nvidia-settings: version 361.42 (buildd@lgw01-18) Tue Apr 5 14:33:28 UTC 2016

Section “ServerLayout”
Identifier “Layout0”
Screen 0 “Screen0” 0 0
Screen 1 “Screen1” RightOf “Screen0”
InputDevice “Keyboard0” “CoreKeyboard”
InputDevice “Mouse0” “CorePointer”
Option “Xinerama” “0”
EndSection

Section “Files”
EndSection

Section “InputDevice”
# generated from default
Identifier “Mouse0”
Driver “mouse”
Option “Protocol” “auto”
Option “Device” “/dev/psaux”
Option “Emulate3Buttons” “no”
Option “ZAxisMapping” “4 5”
EndSection

Section “InputDevice”
# generated from default
Identifier “Keyboard0”
Driver “kbd”
EndSection

Section “Monitor”
# HorizSync source: edid, VertRefresh source: edid
Identifier “Monitor0”
VendorName “Unknown”
ModelName “DELL P2417H”
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 76.0
Option “DPMS”
EndSection

Section “Monitor”
# HorizSync source: edid, VertRefresh source: edid
Identifier “Monitor1”
VendorName “Unknown”
ModelName “Ancor Communications Inc ASUS VG278HE”
HorizSync 24.0 - 83.0
VertRefresh 24.0 - 76.0
Option “DPMS”
EndSection

Section “Device”
Identifier “Device0”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1050 Ti”
BusID “PCI:1:0:0”
Screen 0
EndSection

Section “Device”
Identifier “Device1”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1050 Ti”
BusID “PCI:1:0:0”
Screen 1
EndSection

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
Option “Stereo” “0”
Option “nvidiaXineramaInfoOrder” “DFP-2”
Option “metamodes” “DP-0: nvidia-auto-select +0+0”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection

Section “Screen”
Identifier “Screen1”
Device “Device1”
Monitor “Monitor1”
DefaultDepth 24
Option “Stereo” “0”
Option “metamodes” “HDMI-0: nvidia-auto-select +0+0”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection

The assistance is much appreciated.

When I mouse over to the other screen the mouse icon turns to an X. Additionally, windows from screen 0 do not cross to screen 1.

Ok so your xorg.conf seems right including the description from comment #7.

However, what are the chances you’re using GNOME/GDM or if you’re using GDM what xsession are you using? If it’s GNOME (gnome-shell/mutter) it doesn’t support the X11 concept of >1 screens. So GNOME/wm only appears on your primary screen.

I believe if you switched to lightdm you’ll experience a window manager on per-screen basis. Also, using something that supports multiple screens as said in comment #3 might need to happen as well.

You should have :1 (the black display) but if you try to run something on it it will be a border-less windows: ‘DISPLAY=:1 xterm’

Not being able to move windows between screens is intrisic to the concept of having two separate screens let alone xservers.
Of course, you can also start a separate DE on the second screen using something like
DISPLAY=:0.1 gnome-shell
in case your second screen is on :0.1 and you want gnome.
Two screens, two desktops and you can move the mouse between them but nothing else. That’s all you can get.
Edit: the DISPLAY variable consits of host:xserver.screen I think.

Also, I believe you could enable Xinerama in xorg.conf to join the two screens but there are performance and other oddities with Xinerama.

I think I should have asked from the start. Why on earth does Matlab require multiple screens? Are you confusing that with “a large desktop of x by y res that your single display doesn’t support?” If you need a large res desktop BaseMosaic should be able to do this.

Mosaic is a multi gpu technique which doesn’t apply. Xinerama is a technique to merge due to technical constraints separate screens into one screen which isn’t wanted.

Hi, Thanks for all the input. The xorg.conf was not being saved to the correct directory. Once done it worked as expected. As for the why, the Matlab program (for examining cortical circuits) was developed in the fashion. Many thanks, Ron

Hi ronp!

I am also trying to get separate X servers to work.

I have almost exactly same setup and problem:
-GTX 1050
-Ubuntu 16.04.3 Mate
-Nvidia driver: 384.111

I have taskbar(s) on #2 monitor, but only way I can start anything in there is by:

DISPLAY=:0.1 firefox

If I open something via taskbar, it opens in monitor #1

So would you please tell me exactly what you did, and paste your xorg.conf here (or is it exactly the same as above in post #5?)

Thanks :)

Here is my /etc/X11/xorg.conf --> Not modified by me at all:

nvidia-settings: X configuration file generated by nvidia-settings

nvidia-settings: version 361.42 (buildd@lgw01-18) Tue Apr 5 14:33:28 UTC 2016

Section “ServerLayout”
Identifier “Layout0”
Screen 0 “Screen0” 1920 0
Screen 1 “Screen1” LeftOf “Screen0”
InputDevice “Keyboard0” “CoreKeyboard”
InputDevice “Mouse0” “CorePointer”
Option “Xinerama” “0”
EndSection

Section “Files”
EndSection

Section “Module”
Load “dbe”
Load “extmod”
Load “type1”
Load “freetype”
Load “glx”
EndSection

Section “InputDevice”
# generated from default
Identifier “Mouse0”
Driver “mouse”
Option “Protocol” “auto”
Option “Device” “/dev/psaux”
Option “Emulate3Buttons” “no”
Option “ZAxisMapping” “4 5”
EndSection

Section “InputDevice”
# generated from default
Identifier “Keyboard0”
Driver “kbd”
EndSection

Section “Monitor”
# HorizSync source: edid, VertRefresh source: edid
Identifier “Monitor0”
VendorName “Unknown”
ModelName “Acer AL2423W”
HorizSync 31.0 - 81.0
VertRefresh 56.0 - 75.0
Option “DPMS”
EndSection

Section “Monitor”
# HorizSync source: edid, VertRefresh source: edid
Identifier “Monitor1”
VendorName “Unknown”
ModelName “Samsung SMS27A650”
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option “DPMS”
EndSection

Section “Device”
Identifier “Device0”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1050”
BusID “PCI:1:0:0”
Screen 0
EndSection

Section “Device”
Identifier “Device1”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce GTX 1050”
BusID “PCI:1:0:0”
Screen 1
EndSection

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
Option “Stereo” “0”
Option “nvidiaXineramaInfoOrder” “DFP-0”
Option “metamodes” “DVI-D-0: nvidia-auto-select +0+0”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection

Section “Screen”
Identifier “Screen1”
Device “Device1”
Monitor “Monitor1”
DefaultDepth 24
Option “Stereo” “0”
Option “metamodes” “DP-0: nvidia-auto-select +0+0”
Option “SLI” “Off”
Option “MultiGPU” “Off”
Option “BaseMosaic” “off”
SubSection “Display”
Depth 24
EndSubSection
EndSection