nvidia-settings-367.35-r1 sets up 3 monitors correctly but doesn't write xorg.conf

I’m using a GTX960 on Gentoo Linux running nvidia-drivers-367.35-r1 with no xorg.conf file which (except for driver updates) has worked for the last year or so. For some reason after recent updates the system no longer sets up 3 monitors automatically so I tried nvidia-settings which can configure everything correctly. Sadly however when I try to write xorg.conf to a file it gives me a single monitor version.

I tried the nvidia-xconfig program but without any command line options it’s doing the same thing.

Is this a known problem or is there possibly a newer way to go about getting a correct xorg.conf file with nvidia-settings or nvidia-xconfig?

Thanks

Are you sure that your DEs monitor settings haven’t borked? At least on kdes monitor settings have had a painful multi monitor bug for ages now:
https://bugs.kde.org/show_bug.cgi?id=346961

I don’t know if this is your problem (I am running 367.27 which writes xorg.conf correctly), but I have seen that recent desktops systematically override xorg.conf settings, so that whatever desktop configuration you write in there has no effect. You have to modify the desktop settings of the display manager. I have verified it with Gnome, KDE and xfce - I have all three installed and had to configure all three separately.
The only setting (related with desktop config) that is actually used from xorg.conf is Option “nvidiaXineramaInfoOrder”

Well, I can’t say my DE (KDE) doesn’t have a multi-monitor bug because I cannot prove a negative. There is a bit of KDE strangeness as I said. Since getting the 960 a year ago I’ve not needed an xorg.conf file and it has set up correctly. Because it ‘just worked’ I didn’t use nvidia-settings at all.

Recently Gentoo forced us into the newer KDE updates, 15.12.3 a couple of months ago which dropped kdm and pushed us into other display managers, with sddm being the suggested one and the one I am using. The worst of my ‘auto-setup’ problems have occurred since that change, and that’s when I started trying to get an xorg.conf file from nvidia-settings.

Yesterday I did the next stable KDE update, kde-meta-16.04.3. The X11 setup problems (all 3 monitors showing the same single screen) persist so I went back to trying nvidia-settings.

Now, even if KDE does have a problem it doesn’t explain why nvidia-settings doesn’t create a valid 3 monitor xorg.conf file, at least internally. When I run nvidia-setting it sees all 3 monitors and allows me to do “Right Of” settings, shows the monitors in it’s display and allows me to save. In the save dialog there is a preview button which shows a single monitor config and if I save it I get this:

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

nvidia-settings: version 367.35 (portage@c2RAID6) Sat Aug 20 15:48:48 MST 2016

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

Section “Files”
EndSection

Section “InputDevice”
# generated from data in “/etc/conf.d/gpm”
Identifier “Mouse0”
Driver “mouse”
Option “Protocol”
Option “Device” “/dev/input/mice”
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 “Samsung S24B150”
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 960”
EndSection

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

So this is KDE and the SystemSettings->Display and Monitor-Display Configuration setup looks correct. Next time I reboot, if it comes up in single monitor mode, I’ll check this before using nvidia-settings.

Still doesn’t explain why nvidia-settings isn’t generating the file though.

Is there some trick, like a command line option, that changes either it or nvidia-xconfig? Both of them generate the same, simple 1-monitor setup.

The file that you posted is a 3-monitor setup - Option “metamodes” does that - the issue that I was referring to is that even so, KDE overrides such config.
The part which is actually effective is

which defines your main monitor - the one with start menu etc.

OK, fair enough on the metamodes part. However in the old days xorg.conf would list the three monitors, (using copies) , something like:

Section “Monitor”

HorizSync source: edid, VertRefresh source: edid

Identifier “Monitor0”
VendorName “Unknown”
ModelName “Samsung S24B150”
HorizSync 30.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 SyncMaster”
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option “DPMS”
EndSection

Section “Monitor”

HorizSync source: edid, VertRefresh source: edid

Identifier “Monitor2”
VendorName “Unknown”
ModelName “Asus”
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 75.0
Option “DPMS”
EndSection

Is that not required or just not used by X11 anymore?

I did a reboot, it came up single monitor, so I set it up correctly inside KDE but haven’t rebooted yet to see if it sticks. I suspect you are right and KDE is just borking whatever setup the nvidia driver is doing automatically but I need to do more testing. This problem has been intermittant for months. Sometimes 5-10 boots and it’s 3 monitor correct, and then it switches and it’s 1 monitor for the next week. Just finally got tired of it.

Thank

Even in the old days I think the three Monitor sections had to be somehow referred to from the Screen section, which is the one that matters.
I don’t know if it is not used by X11 - the fact is that in the end it all depends on how X11 is used by the driver and by the desktop.
Anyway all of the information that could be specified in the Monitor section can be specified in the metadata line. Monitors of different size and framerate, besides displacement, are supported there. It is all in the nvidia README, if you are willing to walk through the many pages that are in there.
I may guess the intermittent behavior might be related with the use of different ports types: you have DVI, HDMI and DP.

Agreed/

I might do that one of these days.

I don’t think I have much control over the names of ports. The different port types are just part of the GTX960 reference design and are, TTBOMK, required to hook three 1980x1020 monitors up. There aren’t 3 of any single port type on this card so I bought cables at Amazon and was happy it worked.

My guess about why it wasn’t working is that as you and tuke81 suggested KDE was messing with the setup. This all got really bad when Gentoo pushed us to the newer plasma version of KDE. (Ver 15) prior to that I never had any problems, however prior to that I never even set up monitors in KDE. I just had an xorg.conf file with 3 monitors and good server and screen sections and it all ‘just worked’. I’m now suspicious that this newer KDE just followed its own setup and was resetting the screens to mirror each other. Now that have that section configured I’ll see what happens when I boot up tomorrow.

Anyway, thanks for the help. I’ll go look at the new xorg.conf formats and see what I can find out, either in the man pages or online somewhere.

Cheers

The README.txt that is bundled within the installer is probably the most reliable info. If I am not wrong the metadata even allows to identify the monitors depending on port type, but still you will have to see what KDE does on top of that.
If you find a way to have KDE obey to xorg.conf, it could be good to know info.

KDE uses kScreen2 back round service to setting up monitor settings. To use xorg configure files it should be enough to disable that service from boot(Systemsettings->Startup and Shutdown->Service Management->Start up services).

I’m not sure about sddm, if that will still mess monitor configs after that though(/etc/sddm.conf and read man sddm.conf).

I had same problem with Cinnamon DE. I had to go to System Settings and inside Display and apply changes there as well. Hope that works for you as well. good luck

Yes, that’s what I did and it worked. However over the past 10 days or so I’ve had to redo the settings 3 times. The machine is shut down every night (an expensive machine to run electrically with 7 hard drives and an i980 Extreme processor) so it’s been booted 10 or so times. For whatever reason KDE messes up it’s settings and I just need to redo it.

I’m pretty sure at this point it’s not an X11 problem as the new Gentoo/KDE login screen uses sddm which comes up with a login dialog on all 3 screens. The mouse always works at login, and I can always move it across all 3 screens correctly before logging in. The problem only starts once I’m in KDE.