I performed an "apt-get dist-upgrade" over the weekend. With lots of package upgrades, I restarted the machine to see what would happen (I had seen lots of plasma and kde and nvidia package updates). Many times things work well. This time, well, not so well. My dual-gpu/dual-monitor system came up with blackness. This was the first of what would be a number of issues encountered trying to regain the use of my normal kde desktop.
Fortunately, I had the sshd service running, and I could remotely log into the machine, else I would have had to change the grub boot up parameters and go into console mode.
In looking through /var/log/Xorg.0.log, I saw a line indicating that the user sddm couldn't access the directory /var/lib/sddm (sddm is the login manager). I'm not sure if /var/lib/sddm was already there and was deleted during the dist-upgrade, or if it was ever there. The solution for that was to:
mkdir /var/lib/sddm chown sddm.sddm /var/lib/sddm
I had checked that the /etc/passwd file did already have the sddm user.
The following command makes it possible to restart the gui with out having to restart the computer:
systemctl restart sddm
Once I regained control of the GUI, I found that the two monitors showed the same layout. One monitor was no longer an extension of the other. This arrangement is controlled via /etc/X11/xorg.conf. I am not sure if that file was over-written during the upgrade or not, but I think it was, as it had multiple device sections and multiple session sections. It took more looking in the /var/log/Xorg.0.log file to determine that the start up didn't like two nvidia devices in place, and particularly with the higher numbered device listed first. The final solution for that was to remove the higher numbered device section.
Before:
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Quadro 5000" BusID "PCI:66:0:0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Quadro 5000" BusID "PCI:15:0:0" EndSection
and after:
Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Quadro 5000" BusID "PCI:15:0:0" EndSection
That still didn't solve my problem of non-extended desktop workspace.
The key issue seems to be the CurrentMetaMode in the xorg.conf file. No matter what I tried, I couldn't get a combo to work. I think something is broken in the NVidia scripts somewhere. I'm not sure where to look to fix it. I had to make use of the application nvidia-settings to query settings and come up with something which would work.
I started up nvidia-settings in GUI mode to set things the way I wanted them. I would try to write to /etc/X11/xorg.conf, but the extended mode would not return when sddm was restarted. In non-extended mode, I ran the following command to get the non-extended configuration:
nvidia-settings -q CurrentMetaMode > nvidia.copy cat nvidia.copy Attribute 'CurrentMetaMode' (z800:0.0): id=50, switchable=yes, source=RandR :: \ DPY-1: nvidia-auto-select @2560x1600 +0+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}, \ DPY-7: nvidia-auto-select @2560x1600 +0+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}
In extended mode, I had the following:
nvidia-settings -q CurrentMetaMode > nvidia.side cat /home/rpb/nvidia.copy cat nvidia.side Attribute 'CurrentMetaMode' (z800:0.0): id=78, switchable=no, source=nv-control :: \ DPY-1: nvidia-auto-select @2560x1600 +2560+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}, \ DPY-7: nvidia-auto-select @2560x1600 +0+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}
Each time I login, I run the following command:
nvidia-settings --assign \ CurrentMetaMode="DPY-1: nvidia-auto-select @2560x1600 +2560+0 {ViewPortIn=2560x1600, ViewPortOut=2560x1600+0+0}, \ DPY-7: nvidia-auto-select @2560x1600 +0+0"
Placing it in .xinitrc doesn't seem to work. Placing it in .nvidia-settings-rc doesn't seem to work.
A start up batch file seems to do the trick, or running manually from the command line.
2016/07/07: Seems to be an issue which comes and goes over the last year: Bug 346961 - Multi Monitor configuration lost on reboot, must reconfigure after startup
To keep track of changes, the following group may help: linux.debian.maint.kde
Misc Nouveau optimization info: ArchLinux: installing and configuring the Nouveau open-source driver for NVIDIA graphic cards