Primary screen not working after wake from sleep (only KDE 5.26)

It may not be limited to Nvidia.
My GPU is an AMD Radeon.
After the same update my primary displays got swapped.
Now if I want my primary monitor to be my Acer I have to select the LG monitor to be primary and vice versa.
It’s not important enough to downgrade, but a bit frustrating. On a zoom call I had to also select the opposite desktop to share.

My last try, Do you have any custom code inside /etc/X11/mhwd.d/nvidia.conf that you manually added? For long time i use


    Option  "ConnectToAcpid"    "Off"

In the Section "Device" and i found out that best stability was to create a fixed layout.

Another thing: by any chance you are using Restore last session in Desktop Session settings?

That file (/etc/X11/mhwd.d/nvidia.conf) is completely empty.

Please run:
sudo mhwd -f -i pci video-nvidia
and check if the file is generated and then it is present run:
sudo mhwd-gpu --setmod nvidia --setxorg /etc/X11/mhwd.d/nvidia.conf
If is not there, please let me know, so we can try something else.

sudo mhwd -f -i pci video-nvidia                                                ✔  system  
> Removing video-nvidia...
Sourcing /etc/mhwd-x86_64.conf
Has lib32 support: true
Sourcing /var/lib/mhwd/local/pci/video-nvidia/MHWDCONFIG
Processing classid: 0300
Sourcing /var/lib/mhwd/scripts/include/0300
Processing classid: 0302
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing nvidia-utils breaks dependency 'nvidia-utils' required by cuda
Error: pacman failed!
Error: script failed!

He’s unable to remove Nvidia as CUDA depends on it.

By erroring out no new file is created.

There are two ways to deal with this
Remove CUDA first then force install the driver.
Or use this generic config, BUT, you will have to boot into desktop somehow and via Nvidia X Settings to get the proper information about your primary Screen and replace the one from here in Section "Monitor" with yours where is the replace

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "replace"
    ModelName      "replace"
    HorizSync       replace
    VertRefresh     replace
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option         "TripleBuffer"  "On"
    Option  "ConnectToAcpid"    "Off"
    Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

i hope this makes sense.
The Option "TripleBuffer" "On" can be dropped, or you can use it as described here

Well I feel like I am fitting right in with this thread.
I have encountered the same issue OP has today.
I use a 1440p 144Hz display over DP and a 1080p 60Hz display over DVI with a 1070 and NVIDIA proprietary drivers.
Since the latest update every time my monitors are going into energy savings mode my 1440p primary monitor is no longer waking up and I am left with my 1080p display taking on the configuration of my primary display (meaning the task bar and background from the primary display). My 1440p monitor is recognized and depending if plasma feels lucky today, I am actually able to finagle my way through the GUI settings menu to reset the configuration (it seems to be a 50/50 chance if that works or not). In any case using xrandr I am able to restore the configuration again. A reboot curiously does not fix the issue, I am forced to manually set up the screens again.
Currently using 5.19.17-1 kernel and KDE 5.26.2-1. Never had any issues previously.
So far I was not able to reproduce the issue when sending my PC to sleep so for me it just seems to be a monitor energy savings issue in KDE.
My current fix for this is just to turn off monitor energy savings mode until this is fixed.

If any of the mods/devs need any diagnostics or want me to test something particular to help fix the issue let me know.

2 Likes

It’s unlikely that KDE devs are reading this forum. I suggest creating a bug report following the instructions given here:

https://community.kde.org/Get_Involved/Issue_Reporting

You could also look into the log files to see if you find any error oder warning messages.

Indeed, but I don’t report bugs that need proper repro and proper traces. Manjaro does not provide KDE with debug symbols, KDE devs don’t want useless bug reports, I do the maths for such bug, you get the result.

Traces are only needed in case of crashes. If you have an erroneous behaviour, that you can reliably reproduce, it does make sense to create a bug report. KDE devs usually will look into those and might give additional instructions for you on how to provide more information, if they cannot reproduce it themselves.

Created one. Let’s see how quickly Nate Graham will find a duplicate :smile:

2 Likes

Great. :slight_smile: I did a quick search myself but couldn’t find an existing issue report, but you are right, Nate knows the bug reports inside out and usually closes the duplicates quickly.

Just found this bug report 460341 – On X11, external monitor disabled, setting of external monitor is not remembered. Seems to be directly related to this one. Unfortunately, no solution yet. Deleting ~/.local/share/kscreen still seems to be the only “solution”.

1 Like

Short update:
I just replaced my ancient second display (on HDMI-0) with a newer 34" (on DP-2). Sleep/wake problem is now gone. So the mixture of HDMI and DP seems to confuse current Plasma into writing bogus config files.

You may be onto something, I have DP and HDMI monitors, and I have a similar issue as on this thread, and downgrading KDE fixes it. I should fully upgrade and test latest KDE on Testing branch, confirm I still have the issue, and then use just two HDMI cables and see if it somehow fixes it. It may be a good lead to the issue.

Good thing is that it’s considered as one of the high priority bugs.

… and I can’t do that… I only have one HDMI port on my video card, all others are DP. Latest Plasma 5.26.3 still not fixed. Will go back to LTS 5.24.7.

For the record: Plasma 5.26.4 and this is still unfixed.

With both screens connected over DP it was initially working, but it only lasted maybe 2 reboots and now the problem is back. Still no way to sleep without having to re-configure the screens afterwards. So please ignore my misleading post above. It’s not working.

2 Likes

Have you tried workarounds from the mentioned bug report? Namely this:

Disable kscreen service and using autorandr as autostart script can workaround this

or

Surely works when kscreen service is disabled. I’ve handled the rearrange monitors by creating a script in /etc/profile.d and using xrandr by now…
Here is my setup:

$ cat /etc/profile.d/screen-config.sh
xrandr --output HDMI-0 --mode 1920x1080 --pos 0x360 --output DP-0 --mode 3440x1440 --pos 1920x0 --rate 75 --primary --output DP-3 --mode 1920x1080 --pos 5360x360

To be honest, I’m not really inclined to test the workaround mentioned there. A proper fix would be much appreciated.

But… let’s hope there’s already a fix in the pipeline. Reading this post gives me some hope. Maybe someone can try to compile Plasma using these new sources.

2 Likes