Laptop locks up after closing the lid

Hi all,

When reopening the lid of my laptop the desktop is frozen. I am unable to move the curser or make any input even ctrl+alt+f2 does nothing i have to use the power button to reset. I assumed it was a problem with swap so checked my fstab and yes there is no entry for my swap partition.
I have had this problem on all 3 versions (rock, rome and cooker) with the plasma-x11 desktop. Although my swap patition isnt being used the install did create a vram swap which i found using lsblk. I have tried creating an entry in my fstab
/dev/sda1 none swap sw 0 0 (also tried using UUID)
After rebooting this swap is now mounted but the problem persists. I wanted to try disabling the vram swap to see if that makes a difference but cant find any instructions. I checked the archwiki and found a guide for creating vram swap but not removing it. Any ideas would be apreciated.

A related question, I am duel booting so do manual patitioning when installing for future reference would i need to turn on swap before starting the installer to ensure it mounts correctlly after booting into the new system?

Greetings, and welcome.

Please see the following:

There is also a template when opening a Support topic that states we need some preliminary information. Please provide some more info, including the graphics card you have.

1 Like

does lsblk display a mount point for the zram swap?
It should look something like this:

[lee@OpenMandriva ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 223.6G  0 disk 
├─sda1   8:1    0   300M  0 part /boot/efi
└─sda2   8:2    0 223.3G  0 part /
zram0  253:0    0   3.6G  0 disk [SWAP]
[lee@OpenMandriva ~]$ 

A VRAM swap file is volatile. I use a swap file, because I don’t do sleep or hibernate. For those to work, you need a swap partition large enough to save your whole environment. It should be setup during the partitioning of the installation, but it can be done later. It’s not something I would suggest trying to walk you through in a forum thread.

There should be a few YouTube videos on adding a swap/hibernate partion.

Search for Create Linux Swap Partition

Ah sorry i should have included my system specs. I didn’t follow the template because i’ve had the problem on muliple versions of OM. I have already read that post Which is why i tried to describe the steps i’ve already taken and the research I’ve already done. I found a post about creating swap after install but that wasnt helpful for my case. I have 2 GPUs
Operating System: OpenMandriva Cooker
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.9-desktop-1omv2490 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4710MQ CPU @ 2.50GHz
Memory: 11.6 GiB of RAM
Graphics Processor: NVIDIA GeForce 840M/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 20250
System Version: Lenovo Z710

  *-display                 
       description: 3D controller
       product: GM108M [GeForce 840M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:39 memory:d0000000-d0ffffff memory:a0000000-afffffff memory:b0000000-b1ffffff ioport:4000(size=128) memory:b2000000-b207ffff
  *-display
       description: VGA compatible controller
       product: 4th Gen Core Processor Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 06
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:30 memory:d1000000-d13fffff memory:c0000000-cfffffff ioport:5000(size=64) memory:c0000-dffff

Probably something similar to this:

Does it happen with the nouveau driver?

I have a 16gb swap partition that I have now enabled by adding an entry to the fstab. The problem is I think its still trying to hibernate to the vram that why i want to try and disable or remove it. Mounted partitions are as follows

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 953.9G  0 disk 
├─sda1   8:1    0    16G  0 part [SWAP]
├─sda2   8:2    0   600G  0 part /data
├─sda3   8:3    0     1G  0 part 
├─sda4   8:4    0    50G  0 part 
├─sda5   8:5    0    40G  0 part 
├─sda6   8:6    0    60G  0 part 
├─sda7   8:7    0     1G  0 part /boot/efi
├─sda8   8:8    0   100G  0 part /
└─sda9   8:9    0    50G  0 part 
sdb      8:16   1     0B  0 disk 
sr0     11:0    1  1024M  0 rom  
zram0  253:0    0   5.8G  0 disk [SWAP]

If you manually change to the Integrated Graphics before you close the lid, does it work better or the same?

I see both Swaps are listed. You will need to stop the ZRAM Service and remove the ZRAM package.

One problem per forum thread is strongly requested.

Including proper information is strongly requested. Including where have you looked to resolve this issue? How to reproduce your problem?

That said this may be blindingly simple. For Cooker or ROME look in SystemSettings>Power Management. I do not know about Rock. There should be a setting for “When laptop lid is closed” but I do not see that in Rock VM. But that may be because the Rock VM is obviously not seen as a laptop.

Ok lots of suggestions thanks, ive been working through them.

I dont think so, I looked at that and he mentions the cause being overheating which is not my problem, it is enough to close then reopen and the desktop is frozen. I did look for /lib/systemd/system-sleep/ but this folder is empty.

I cant turn off he nvidia card here is another bug that causes sddm to log me out when i do so also not a solution.

Idealy i would like my laptop to suspend when the lid is closed for the moment i either leave it open or shutdow when not in use. The only change if i altered the power management settings would be i cold close the lid but the laptop would keep running or shutdown unless im being a bit dumb (entirely possible by the way)

Yes, i think this is the problem but my efforts to disable vram have come to naught.
Things i have tried:

Sudo systemctl disable zram (zram-config) niether were found
looking in /etc/systemd/sleep.conf

[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#MemorySleepMode=
#HibernateDelaySec=
#HibernateOnACPower=yes
#SuspendEstimationSec=60min

From what i understand i want it to do all those things

searched for any package i could remove - dnf list installed | grep zram
found zram-generator is it safe to just remove i dont know if that would make my system unbootable
also i found a suggestion to add systemd.zram=0 to /etc/default/grub and grub2-update same dilema as the previous

Thanks again for the help

Sorry will start a new topic

I think it is zram.service that you need to disable. However the only place I have that running is on Tumbleweed and it may not be the same on OM.

The packages are zram-generator and systemd-zram-service, but on OM, they could be different. I did not find those packages to install them on the PC I put OM on.

Now i have tried

[rich@Z710-OMplasms6 ~]$ systemctl list-unit-files | grep zram
systemd-zram-setup@.service                static          -
dev-zram0.swap                             generated       -
[rich@Z710-OMplasms6 ~]$ sudo systemctl stop zram-setup
[sudo] password for rich: 
Failed to stop zram-setup.service: Unit zram-setup.service not loaded.
[rich@Z710-OMplasms6 ~]$ sudo systemctl stop zram-setup@
Failed to stop zram-setup@.service: Unit name zram-setup@.service is missing the instance name.
See system logs and 'systemctl status zram-setup@.service' for details.
[rich@Z710-OMplasms6 ~]$ sudo systemctl stop zram-setup@.service
Failed to stop zram-setup@.service: Unit name zram-setup@.service is missing the instance name.
See system logs and 'systemctl status zram-setup@.service' for details.
[rich@Z710-OMplasms6 ~]$ sudo systemctl disable zram-setup@.service
Failed to disable unit: Unit zram-setup@.service does not exist
[rich@Z710-OMplasms6 ~]$ sudo systemctl disable zram-setup
Failed to disable unit: Unit zram-setup.service does not exist

I am concerned that if i remove zram-generator and systemd calls for it during boot, booting will fail.

That is what is available in Plasma6 in Cooker or ROME on my ASUSLaptop M1605YA. I normally use either “Do nothing” or “Sleep” myself, but I am more of a keep it simple user. No comments about mental capacity please.

I would strongly suspect this is from upstream. Sleep does more than shut off the display. It puts the computer in low power mode stopping all it considers to be unnecessary services, for example if there is a download in progress it will stop until laptop wakes up and I resume the download. I think that is sort of like suspend.

I have just installed the rome gnome iso and after enabling swap and disabling the zram i have no problem with suspend/resume when closing the lid of my laptop. This appears to be a bug related to plasma. When i file a bug report should i do so to OM, Kde plama directly or submit 1 to each. for more context i installed plasma on arch with sddm on the same hardware and couldn’t reproduce this problem, so I still think this maybe a problem with how OM implaments the plasma destop. Thanks again for all your help and suggestions.

You should probably link the Plasma related issue you are talking about. Otherwise, it is confusing when you say you installed GNOME and have reported a bug specific to Plasma. The system sleeping when the lid closes is probably a setting you have to configure in any desktop environment or window manager. SDDM is not a Plasma unique display manager if you are saying you think the issue is with SDDM:

You would need to test that against behavior in GDM.

It would appear KDE was aware of some issues in the past:

https://bugs.kde.org/show_bug.cgi?id=448866

In the interest of putting things on the surface and making this more concise for replying, please see the following summary:

Based on your findings and the following, I would say the issue is with kwin as they have suggested.

You could create an incident on our GH here and mark it upstream if one does not already exist:

If you have an account on KDE’s bug tracker, I would probably inform them of your findings on the same issue I linked here.

It’s also important to realize that even though other distros have packages we have, they may not be at the same version and they may be configured to fit their specific use case and level of stability. This does not mean it is a “problem” with how they are implemented.

Sorry to be confusing, The initial problem was using plasma x11 as stated in the oroginal post are you saying i should link that post here sorry if this is a dumb question. I installed the gnome iso to try and narrow down the problem, is it specific to plasma or more general? I thought this information might be useful. My initial tought about sddm was because i also had the problem with being logged out, although this was solved by installing the nvidia driver i wondered if it could be related. However after thinking about this the suspend resume issue also happened even when using startx to launch plasma so sddm is not likely the source. Although the bug you link to sounds similar if i understand correctly it was specific to wayland but my issue is with x-11.
Sorry again

This is me trying to explain something i dont fully understand but also trying to give as much information as possible. As for looking at the settings the laptop is set to sleep when i close the lid, that is what i want it to do. Should i be looking somewhere else or have I missed something obvious?
Thankyou for your help and patience.

You are doing the right thing by asking questions, and I am helping you to provide the information needed to help you and other people, as well. cooker is our development branch and we appreciate it when people step up to use and test it. It helps other people in ROME and Rock so they have stable systems.

The bug linked is an indicator of an issue with kwin, and it may be specific to wayland. It has also been an issue for several months, and they are blaming nvidia. Your findings have shown it to be related to kwin because you cannot reproduce it with GNOME’s window manager. You could try the suggested kernel parameters by editing the boot entry at the boot screen (so you can check it without modifying the boot entry permanently) and see if you can reproduce it with Plasma.

Another issue is the age of the card. It’s probably not a card people will be doing high end 3D applications on anymore. You are getting to a point where nouveau might be a better option:

Even then, power management might be a challenge.

For comparison, I have a GTX 960 desktop card that has decent performance in x11 and terrible performance in wayland with the nvidia driver. See how it behaves with nouveau as a comparison.