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

You forgot:

Here we go:

cat /sys/power/mem_sleep
s2idle [deep]

and:

Machine:
  Type: Desktop System: Gigabyte product: H370HD3 v: N/A serial: N/A
  Mobo: Gigabyte model: H370 HD3-CF v: x.x serial: N/A
    UEFI: American Megatrends v: F15e date: 09/16/2020

ok, i thought you are using notebook…

in the logs there is this right after logs related to disk, so it could be related to btrfs, but i really dont know… does the another install uses also btrfs?

I thought about ButterFS too, so I tested it on an ext4 FS (to be sure it’s unrelated) and unfortunately the problem is the very same.

so there is something messed up with the latest update and your hardware…
you can try changing from deep to s2idle:
open this file:
kate /etc/default/grub
and in this line: GRUB_CMDLINE_LINUX_DEFAULT - inside the quotes add this parameter:
mem_sleep_default=s2idle
dont remove anything from there, just add it to the existing parameters, save the file, update grub with:
sudo update-grub
reboot and test

Enabling early KMS was a thing i mentioned this days quite a lot, but also in the past. Please try and let us know

@brahma thank you again for your suggestions.

Just tried to change the sleep mode, as you suggested, but the outcome when waking up from sleep is the same as before. So we’re unlucky again.

really? the s2idle is:

This state is a generic, pure software, light-weight, system sleep state.
It allows more energy to be saved relative to runtime idle by freezing user
space and putting all I/O devices into low-power states (possibly
lower-power than available at run time), such that the processors can
spend more time in their idle states.

so you should have none issues with this… maybe there is some bios setting messing things up… can you check in bios, options related to pcie/sleep/power management…
provide output also from:
head /etc/default/grub
just to be sure the parameter is correct

@bogdancovaciu thanks for your input.

Just added these kmodules to early kms. Did the whole procedure, updated ramdisk and bootloader and rebooted. Duh, still no luck. After waking up the system shows the same messed up symptoms.

My naive Cure so far:

  • delete ~/.local/share/kscreen
  • reboot
  • go to system-settings → Display and rearrange the screens

I’m pretty confident that we can exclude the BIOS, as sleep works perfectly with other OS (Manjaro + Wintendo). Even if I go back to older backups (before the KDE 5.25-5.26 updates), sleep+wake, CUDA, Steam, Blender, etc. work all flawlessly. This machine has never had any problem for the last two years using the exactly same BIOS settings. Just to mention and to save you some brain cycles.

so i have no idea, you can try with an older kernel - kernel 5.10, and see if it helps… but since it started to happen after the 5.25 plasma, it will probably not help, but its worth a try…

also manjaro released a lts plasma version before the 5.25 version, you can use it in the meantime:

1 Like

Yes, I’ll just do a downgrade to 5.24.7 LTS, like @omano suggested, and then update from time to time to see if things have been fixed. We’ve already spent too much time trying stuff. To me it seems obvious that it’s somehow related to this Plasma/Nvidia/SomethingElse combination. But yes, I’m not an expert by any means.

Thank you again for your kind support.

Hold on … you did the early kms, but the only issue is with the 5.26 but works on 5.24.7 while using the latest Nvidia drivers on both?
Then my next guess is that you are hold back by this bugger thing:

So is not the

That only works temporary, or did i got that wrong?
Please check that linked topic and let me know.

Just had a look at my ~/.config/kwinrc file and it’s very minimal:

[Desktops]
Id_1=49998625-3f84-46c7-aced-f5a7f9454822
Id_2=b6252d0d-1f64-485c-99ff-ee39117cd798
Rows=2

Just to be sure, I renamed it and rebooted while being logged out. After reboot and trying sleep+wake, the problem is the very same. Only a pointer on the second screen and no way to log in. The only thing that then helps is deleting the ~/.local/share/kscreen folder and rebooting. As soon as I retry sleep, the kscreen folder contains new config files that are bogus (single screen).

Btw: I tried that early on my trip to create a new user and see if it’s related to my profile. Same problem there.

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