Need help diagnosing failed hibernation

Summary

Since a few months back, not quite sure when, my hibernation started to fail. By failing I mean that when executed using systemd it would initialize the lock screen, blacked the screen, only to come back to the lock screen instead of hibernating.
In order to be able to hibernate I would have to shutdown several programs, namely Spotify, until hibernation was successful.

The issue

This indicates that I had not enough swap space to hibernate, but that’s not the case, as I recently increased swap to 12 GiB and I only have 8 GiB of RAM. Swap should be empty as I have set swappiness to zero and haven’t got any memory intensive tasks running (however this is not the case there’s always residual swap in my system in the order of 100 MiB).

Since memory doesn’t seem to be a problem let’s check the failed hibernation attempt on journalctl:

$ sudo journalctl -u systemd-hibernate.service
ago 12 02:03:23 UD-Legion systemd[1]: Starting Hibernate...
ago 12 02:03:23 UD-Legion systemd-sleep[42318]: [33] INFO: # Pre-suspend hook
ago 12 02:03:23 UD-Legion systemd-sleep[42318]: [33] INFO: Previous state was: {'type': 'done', 'switch_id': '20210811T113119', 'current_mode': 'integrated'}
ago 12 02:03:23 UD-Legion systemd-sleep[42318]: [37] INFO: Switching option: none
ago 12 02:03:23 UD-Legion systemd-sleep[42318]: [37] INFO: Turning Nvidia GPU back on
ago 12 02:03:23 UD-Legion systemd-sleep[42378]: modinfo: ERROR: Module bbswitch not found.
ago 12 02:03:23 UD-Legion systemd-sleep[42382]: modinfo: ERROR: Module acpi_call not found.
ago 12 02:03:24 UD-Legion systemd-sleep[42318]: [648] INFO: switching=none, nothing to do
ago 12 02:03:24 UD-Legion systemd-sleep[42318]: [649] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210811T113119', 'current_mode': 'integrated'}
ago 12 02:03:24 UD-Legion systemd-sleep[42318]: [649] INFO: Pre-suspend hook completed successfully.
ago 12 02:03:24 UD-Legion systemd-sleep[42315]: Suspending system...
ago 12 02:03:28 UD-Legion systemd-sleep[42315]: Failed to suspend system. System resumed again: Cannot allocate memory
ago 12 02:03:28 UD-Legion systemd-sleep[42571]: [18] INFO: # Post-resume hook
ago 12 02:03:28 UD-Legion systemd-sleep[42571]: [19] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20210811T113119', 'current_mode': 'integrated'}
ago 12 02:03:28 UD-Legion systemd-sleep[42571]: [20] INFO: Turning Nvidia GPU off again
ago 12 02:03:29 UD-Legion systemd-sleep[42659]: modinfo: ERROR: Module bbswitch not found.
ago 12 02:03:29 UD-Legion systemd-sleep[42666]: modinfo: ERROR: Module acpi_call not found.
ago 12 02:03:29 UD-Legion systemd-sleep[42571]: [612] INFO: switching=none, nothing to do
ago 12 02:03:29 UD-Legion systemd-sleep[42571]: [613] INFO: Writing state {'type': 'done', 'switch_id': '20210811T113119', 'current_mode': 'integrated'}
ago 12 02:03:29 UD-Legion systemd-sleep[42571]: [613] INFO: Post-resume hook completed successfully.
ago 12 02:03:29 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
ago 12 02:03:29 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
ago 12 02:03:29 UD-Legion systemd[1]: Failed to start Hibernate.
ago 12 02:03:29 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 3.557s CPU time.

As you can see it does in fact state that it is not able to allocate memory, although it has plenty of space left!
After closing Spotify journalctl shows a successful hibernation, even if with the same warnings related to the NVIDIA dGPU:

$ sudo journalctl -u systemd-hibernate.service
ago 12 02:03:56 UD-Legion systemd[1]: Starting Hibernate...
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [14] INFO: # Pre-suspend hook
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [14] INFO: Previous state was: {'type': 'done', 'switch_id': '20210811T113119', 'current_mode': 'integrated'}
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [15] INFO: Switching option: none
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [16] INFO: Turning Nvidia GPU back on
ago 12 02:03:56 UD-Legion systemd-sleep[43092]: modinfo: ERROR: Module bbswitch not found.
ago 12 02:03:56 UD-Legion systemd-sleep[43095]: modinfo: ERROR: Module acpi_call not found.
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [488] INFO: switching=none, nothing to do
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [488] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210811T113119', 'current_mode': 'integrated'}
ago 12 02:03:56 UD-Legion systemd-sleep[43072]: [488] INFO: Pre-suspend hook completed successfully.
ago 12 02:03:56 UD-Legion systemd-sleep[43069]: Suspending system...

Here’s the amount of memory (RAM + Swap) available on my system (after waking up from the latest hibernation attempt):

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            7851        3095        2997         721        1757        3663
Swap:          12286          78       12208

Using systemd to check the status of the hibernation unit file reveals the following:

$ sudo systemctl status hibernate.target
○ hibernate.target - System Hibernation
     Loaded: loaded (/usr/lib/systemd/system/hibernate.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

ago 11 18:15:42 UD-Legion systemd[1]: Reached target System Hibernation.
ago 11 18:15:42 UD-Legion systemd[1]: Stopped target System Hibernation.
ago 11 22:50:34 UD-Legion systemd[1]: Reached target System Hibernation.
ago 11 22:50:34 UD-Legion systemd[1]: Stopped target System Hibernation.
ago 12 00:11:40 UD-Legion systemd[1]: Reached target System Hibernation.
ago 12 00:11:40 UD-Legion systemd[1]: Stopped target System Hibernation.
ago 12 02:03:29 UD-Legion systemd[1]: Dependency failed for System Hibernation.
ago 12 02:03:29 UD-Legion systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.
ago 12 11:32:02 UD-Legion systemd[1]: Reached target System Hibernation.
ago 12 11:32:02 UD-Legion systemd[1]: Stopped target System Hibernation.

Which when the hibernation fails (check the timestamp) it says something about a dependency.
When looking into /usr/lib/systemd/system/hibernate.target it says that it depends on hibernate.service but I wasn’t able to find it.

Files in relevant directories

In the folder /usr/lib/systemd/system-sleep I have 3 files, nvidia, optimus-manager.py and tlp:

$ cat nvidia
#!/bin/sh

case "$1" in
    post)
        /usr/bin/nvidia-sleep.sh "resume"
        ;;
esac
$ cat optimus-manager.py
#!/usr/bin/env python3
import sys
from optimus_manager.hooks import pre_suspend, post_resume


def main():

    try:
        state = sys.argv[1]  # pre or post
        _mode = sys.argv[2] # suspend, hibernate or hybrid-sleep
    except IndexError:
        print("Not enough arguments")
        sys.exit(1)

    if state == "pre":
        pre_suspend.main()
    elif state == "post":
        post_resume.main()
    else:
        print(f"Invalid first argument: {state}")
        sys.exit(1)


if __name__ == "__main__":
    main()
$ cat tlp
#!/bin/sh

# tlp - systemd suspend/resume hook
#
# Copyright (c) 2020 Thomas Koch <linrunner at gmx.net> and others.
# This software is licensed under the GPL v2 or later.

case $1 in
    pre)  tlp suspend ;;
    post) tlp resume  ;;
esac

In /etc/systemd/system/sleep.target.wants I only have one file to initialize the lockscreen:

$ cat betterlockscreen@undercover.service
[Unit]
Description = Lock screen when going to sleep/suspend
Before=sleep.target
Before=suspend.target

[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/betterlockscreen --lock
TimeoutSec=infinity
ExecStartPost=/usr/bin/sleep 0.25

[Install]
WantedBy=sleep.target
WantedBy=suspend.target

System specs

OS: Manjaro (installed from the Architect installer)
WM: i3
Kernel: 5.4.138-1 x64
GPU: iGPU (Intel) + dGPU (NVIDIA 1050Ti)
Swap is available on it’s own partition and mounted in /etc/fstab

TL;DR: Spotify is notorious for inhibiting suspend, hibernate, … because it’s cross-platform and phones should continue playing music when they suspend…

So file a bug but don’t expect them to do anything about it because this has been known for years…

Alternatively, start a media campaign and smear them in the press until they give in.

VLC, qBitTorrent, … can also inhibit suspend and hibernate, but they’re much better about it: you actually have to OPT-IN!

:man_shrugging:

1 Like

TL;DR: Spotify is notorious for inhibiting suspend, hibernate, … because it’s cross-platform and phones should continue playing music when they suspend…TL;DR: Spotify is notorious for inhibiting suspend, hibernate, … because it’s cross-platform and phones should continue playing music when they suspend…

I wasn’t aware of anything like that, thanks.

Unfortunately I won’t be getting rid of Spotify that soon, but I don’t mind shutting down Spotify before hibernating (I might even end up writing a bash script to do it automatically).

However there have been times when Spotify was closed and I was unable to hibernate, and I’m pretty sure it wasn’t running on the background.

Also, if this was Spotify doing, why would it show up a warning about allocating memory?

Because:

  • TL;DR
  • you never posted an inxi --admin --verbosity=7 --filter --no-host --width which would be the minimum required information for us to be able to help you. (Personally Identifiable Information like serial numbers and MAC addresses will be filtered out by the above command)

:grin:

Here ya go:

$ sudo inxi --admin --verbosity=7 --filter --no-host
[sudo] password for undercover: 
System:    Kernel: 5.4.138-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 
           parameters: root=/dev/nvme0n1p6 rw resume=/dev/nvme0n1p7 initrd=boot\initramfs-5.4-x86_64.img 
           Desktop: i3 4.19.1 info: polybar dm: LightDM 1.30.0 Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Laptop System: LENOVO product: 80WK v: Lenovo Y520-15IKBN serial: <filter> Chassis: type: 10 
           v: Lenovo Y520-15IKBN serial: <filter> 
           Mobo: LENOVO model: Provence-5R1 v: NO DPK serial: <filter> UEFI: LENOVO v: 4KCN45WW date: 01/11/2019 
Battery:   ID-1: BAT0 charge: 32.1 Wh (100.0%) condition: 32.1/45.0 Wh (71.3%) volts: 12.7 min: 11.5 model: SMP L16M3P24 
           type: Li-poly serial: <filter> status: Full 
Memory:    RAM: total: 7.67 GiB used: 3.64 GiB (47.5%) 
           Array-1: capacity: 32 GiB slots: 2 EC: None max-module-size: 16 GiB note: est. 
           Device-1: ChannelA-DIMM0 size: 8 GiB speed: 2400 MT/s type: DDR4 detail: synchronous unbuffered (unregistered) 
           bus-width: 64 bits total: 64 bits manufacturer: Samsung part-no: M471A1K43CB1-CRC serial: <filter> 
           Device-2: ChannelB-DIMM0 size: No Module Installed 
CPU:       Info: Quad Core model: Intel Core i5-7300HQ socket: U3E1 bits: 64 type: MCP arch: Kaby Lake family: 6 
           model-id: 9E (158) stepping: 9 microcode: 8E cache: L1: 256 KiB L2: 6 MiB L3: 6 MiB bogomips: 20004 
           Speed: 900 MHz min/max: 800/3500 MHz base/boost: 2400/8300 volts: 0.8 V ext-clock: 100 MHz Core speeds (MHz): 
           1: 900 2: 900 3: 900 4: 900 
           Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon art avx avx2 bmi1 bmi2 bts clflush 
           clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts ept ept_ad erms est f16c 
           flexpriority flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida intel_pt 
           invpcid invpcid_single lahf_lm lm mca mce mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx pae pat pbe pcid 
           pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts rdrand rdseed rdtscp rep_good sdbg sep smap smep 
           ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi 
           vpid x2apic xgetbv1 xsave xsavec xsaveopt xsaves xtopology xtpr 
           Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
           Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB filling 
           Type: srbds status: Vulnerable: No microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel HD Graphics 630 vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:591b 
           class-ID: 0300 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] vendor: Lenovo driver: nvidia v: 470.57.02 
           alternate: nouveau,nvidia_drm bus-ID: 01:00.0 chip-ID: 10de:1c8c class-ID: 0302 
           Device-3: Realtek EasyCamera type: USB driver: uvcvideo bus-ID: 1-6:3 chip-ID: 0bda:58e5 class-ID: 0e02 
           serial: <filter> 
           Display: server: X.Org 1.20.13 compositor: picom v: git-dac85 driver: loaded: modesetting display-ID: :0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") s-diag: 582mm (22.9") 
           Monitor-1: eDP-1 res: 1920x1080 hz: 60 dpi: 142 size: 344x194mm (13.5x7.6") diag: 395mm (15.5") 
           OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 21.1.6 direct render: Yes 
Audio:     Device-1: Intel CM238 HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a171 
           class-ID: 0403 
           Sound Server-1: ALSA v: k5.4.138-1-MANJARO running: yes 
           Sound Server-2: JACK v: 1.9.19 running: no 
           Sound Server-3: PulseAudio v: 15.0 running: yes 
Network:   Device-1: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel port: 4000 bus-ID: 03:00.0 chip-ID: 8086:24fd 
           class-ID: 0280 
           IF: wlp3s0 state: up mac: <filter> 
           IP v4: <filter> type: dynamic noprefixroute scope: global broadcast: <filter> 
           IP v6: <filter> type: dynamic noprefixroute scope: global 
           IP v6: <filter> type: noprefixroute scope: link 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Lenovo driver: r8168 v: 8.049.02-NAPI 
           modules: r8169 port: 3000 bus-ID: 04:00.0 chip-ID: 10ec:8168 class-ID: 0200 
           IF: enp4s0 state: down mac: <filter> 
           WAN IP: <filter> 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: N/A bus-ID: 1-11:4 chip-ID: 8087:0a2b class-ID: e001 
           Report: This feature requires one of these tools: hciconfig/bt-adapter 
Logical:   Message: No logical block device data found. 
RAID:      Message: No RAID data found. 
Drives:    Local Storage: total: 680.02 GiB used: 53.43 GiB (7.9%) 
           ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 960 EVO 250GB size: 232.89 GiB block-size: 
           physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: 3B7QCXE7 
           temp: 33 Celsius C scheme: GPT 
           SMART: yes health: PASSED on: 122d 5h cycles: 6,215 read-units: 76,721,883 [39.2 TB] 
           written-units: 49,037,518 [25.1 TB] 
           ID-2: /dev/sda maj-min: 8:0 vendor: KIOXIA model: EXCERIA SATA SSD size: 447.13 GiB block-size: physical: 512 B 
           logical: 512 B sata: 3.2 speed: 6.0 Gb/s type: SSD serial: <filter> rev: 16.2 temp: 24 C scheme: GPT 
           SMART: yes state: enabled health: PASSED on: 125d 14h cycles: 1866 written: 30.9 MiB 
           Message: No optical or floppy data found. 
Partition: ID-1: / raw-size: 90 GiB size: 88.46 GiB (98.29%) used: 38.1 GiB (43.1%) fs: ext4 block-size: 4096 B 
           dev: /dev/nvme0n1p6 maj-min: 259:6 label: Manjaro uuid: ed34ea90-9e5c-4384-a6bb-d21314aae741 
           ID-2: /boot/efi raw-size: 100 MiB size: 96 MiB (96.00%) used: 45.3 MiB (47.2%) fs: vfat block-size: 512 B 
           dev: /dev/nvme0n1p2 maj-min: 259:2 label: BOOT uuid: 5866-D60C 
           ID-3: /home/<filter>/ze raw-size: 25 GiB size: 25 GiB (100.00%) used: 15.18 GiB (60.7%) fs: ntfs block-size: 4096 B 
           dev: /dev/nvme0n1p8 maj-min: 259:8 label: Ze uuid: 01D50D6F3C1BBF40 
Swap:      Kernel: swappiness: 0 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 12 GiB used: 108.9 MiB (0.9%) priority: -2 dev: /dev/nvme0n1p7 maj-min: 259:7 
           label: Swap uuid: bcc5524c-30bb-4c2a-a297-196de1dad945 
Unmounted: ID-1: /dev/nvme0n1p1 maj-min: 259:1 size: 529 MiB fs: ntfs label: Recovery uuid: A4426351426326F0 
           ID-2: /dev/nvme0n1p3 maj-min: 259:3 size: 16 MiB fs: N/A label: N/A uuid: N/A 
           ID-3: /dev/nvme0n1p4 maj-min: 259:4 size: 90 GiB fs: ntfs label: Windows uuid: A4FE74B3FE747EFC 
           ID-4: /dev/nvme0n1p5 maj-min: 259:5 size: 621 MiB fs: ntfs label: Recovery2 uuid: FC1EEE5D1EEE1106 
           ID-5: /dev/sda1 maj-min: 8:1 size: 16 MiB fs: N/A label: N/A uuid: N/A 
           ID-6: /dev/sda2 maj-min: 8:2 size: 425 GiB fs: ntfs label: Data uuid: EE96DBD096DB9803 
USB:       Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 16 rev: 2.0 speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900 
           Device-1: 1-1:6 info: Speedy Supplies Pte. USB Gaming M type: Mouse,Keyboard,HID driver: hid-generic,usbhid 
           interfaces: 3 rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 1017:2002 class-ID: 0300 
           Device-2: 1-6:3 info: Realtek EasyCamera type: Video driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s 
           power: 500mA chip-ID: 0bda:58e5 class-ID: 0e02 serial: <filter> 
           Device-3: 1-11:4 info: Intel Bluetooth wireless interface type: Bluetooth driver: N/A interfaces: 2 rev: 2.0 
           speed: 12 Mb/s power: 100mA chip-ID: 8087:0a2b class-ID: e001 
           Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 8 rev: 3.0 speed: 5 Gb/s chip-ID: 1d6b:0003 class-ID: 0900 
Sensors:   System Temperatures: cpu: 33.5 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 292 Uptime: 1d 12h 31m wakeups: 1 Init: systemd v: 248 tool: systemctl Compilers: gcc: 11.1.0 alt: 10 
           Packages: pacman: 1216 lib: 273 Shell: Zsh (sudo) v: 5.8 default: Bash v: 5.1.8 running-in: kitty inxi: 3.3.06 

The reason why I posted here is because I’m completely clueless, I’ve searched around and saw one similar issue, in this same forum: Swapspace issue - #22 by newhere
The user ended up downgrading from kernel 5.10 to 5.9 and it might have fixed the issue, at least he never posted back that it failed to fix it.
Everything else seems to be too old or not relevant at all.

If that’s not it, post the output of the script mentioned in the swap article before hibernating and again after a failed hibernate.

:crossed_fingers:

1 Like

Thanks.

It worked alright for two days, now with Spotify open, the hibernation failed, although I have been able to hibernate with Spotify open so far.

Here’s the output of the script shown in the Manjaro Wiki:

$ sudo misc/mnj-wiki-script.sh
misc/mnj-wiki-script.sh: line 5: 1: command not found
[warning] zwap not active. Continuing
espanso	172	kB
systemd-udevd	168	kB
gvfsd	168	kB
gvfsd-metadata	112	kB
at-spi-bus-laun	92	kB
polkitd	84	kB
dbus-daemon	60	kB
(sd-pam)	44	kB
mono	44	kB
accounts-daemon	28	kB
udisksd	20	kB
mount.ntfs-3g	20	kB
gvfs-udisks2-vo	20	kB
upowerd	12	kB
tracker-miner-f	12	kB
systemd-journal	12	kB
rtkit-daemon	12	kB
dconf-service	12	kB
systemd-timesyn	8	kB
dbus-daemon	8	kB
systemd	4	kB
systemd	4	kB
zsh	0	kB
zsh	0	kB
zsh	0	kB
zsh	0	kB
Xorg	0	kB
xfconfd	0	kB
xfce4-power-man	0	kB
writeback	
wpa_supplicant	0	kB
WebExtensions	0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
watchdogd	
unclutter	0	kB
udiskie	0	kB
uas	
tpm_dev_wq	
thunderbird	0	kB
systemd-logind	0	kB
sudo	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
sort	0	kB
sdhci	
scsi_tmf_2	
scsi_tmf_1	
scsi_tmf_0	
scsi_eh_2	
scsi_eh_1	
scsi_eh_0	
RDD	Process0	kB
rcu_tasks_kthre	
rcu_preempt	
rcu_par_gp	
rcu_gp	
rcuc/3	
rcuc/2	
rcuc/1	
rcuc/0	
rcub/0	
python3	0	kB
python3	0	kB
pulseaudio	0	kB
polybar	0	kB
polkit-gnome-au	0	kB
picom	0	kB
oom_reaper	
nv_queue	
nv_queue	
nvme-wq	
nvme-reset-wq	
nvme-delete-wq	
NetworkManager	0	kB
netns	
nautilus	0	kB
more	0	kB
mnj-wiki-script	0	kB
mnj-wiki-script	0	kB
mm_percpu_wq	
migration/3	
migration/2	
migration/1	
migration/0	
lightdm	0	kB
lightdm	0	kB
kworker/u9:1-rb_allocator	
kworker/u9:0-rb_allocator	
kworker/u8:5	
kworker/u8:4-events_unbound	
kworker/u8:3-i915	
kworker/u8:2-flush-259:0	
kworker/u8:1-events_power_efficient	
kworker/u8:0-i915	
kworker/3:2-events	
kworker/3:1H-events_highpri	
kworker/3:0H-kblockd	
kworker/3:0-events	
kworker/2:2-events	
kworker/2:1H-events_highpri	
kworker/2:1-events	
kworker/2:0H-kblockd	
kworker/2:0-events	
kworker/1:2	
kworker/1:1H-events_highpri	
kworker/1:1-events	
kworker/1:0H-kblockd	
kworker/1:0-events	
kworker/0:2-rcu_gp	
kworker/0:1H-events_highpri	
kworker/0:1-events	
kworker/0:0H-kblockd	
kworker/0:0-events	
kthrotld	
kthreadd	
kswapd0	
ksuperkey	0	kB
kstrp	
ksoftirqd/3	
ksoftirqd/2	
ksoftirqd/1	
ksoftirqd/0	
ksmd	
kitty	0	kB
kitty	0	kB
kintegrityd	
khungtaskd	
khugepaged	
kdevtmpfs	
kcompactd0	
kblockd	
kauditd	
jbd2/nvme0n1p6-	
irq/137-iwlwifi	
irq/133-mmc0	
irq/127-mei_me	
irq/126-aerdrv	
irq/123-aerdrv	
ipv6_addrconf	
idle_inject/3	
idle_inject/2	
idle_inject/1	
idle_inject/0	
i3	0	kB
gvfsd-trash	0	kB
gvfsd-network	0	kB
gvfsd-http	0	kB
gvfsd-fuse	0	kB
gvfsd-dnssd	0	kB
gsettings-helpe	0	kB
gitstatusd-linu	0	kB
gitstatusd-linu	0	kB
flashfocus	0	kB
firefox	0	kB
ext4-rsv-conver	
evinced	0	kB
evince	0	kB
evince	0	kB
evince	0	kB
evince	0	kB
evince	0	kB
espanso	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
edac-poller	
dunst	0	kB
devfreq_wq	
dbus-daemon	0	kB
cupsd	0	kB
cryptd	
cpuhp/3	
cpuhp/2	
cpuhp/1	
cpuhp/0	
colord	0	kB
charger_manager	
cfg80211	
blkcg_punt_bio	
awk	0	kB
awk	0	kB
at-spi2-registr	0	kB
atom	0	kB
atom	0	kB
ata_sff	
acpi_thermal_pm

And the memory that is being consumed:

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            7851        3186        3133         817        1531        3596
Swap:          12286         123       12163

I forgot to say that after shutting down Spotify I was able to hibernate my system.

Something that I don’t think I’ve mentioned so far was that I’m on a dual boot with Windows 10, but I always had this setup and this problem showed up a few months ago, and I’ve always had an issue since the first day with hibernation, and the screen blacks out, my peripherals also black out, only for the screen to light up again (but everything is black) as well as the peripherals, and then after that it shuts down and you can hear a “pop”, like an electric discharge, in my headset. If the headset is not plugged in nothing is heard on the laptop speakers.

As I didn’t know, I’ve never told you:

  • When rebooting from Windows to Manjaro, cold boot into Manjaro, I.E. shot down Windows and then press the power button to start your laptop again and go into Manjaro
  • When rebooting from Manjaro to Windows, you can still warm boot

Does this solve the issue? If not: I’m all out of novel ideas!

:sob:

I don’t think I understand what you mean, but I always keep Windows shut down, since I only boot it up occasionally to play some games. This means that I always hibernate Manjaro, open up Windows, shut down Windows and the boot Manjaro back up. This also means that Windows is always off or on, never hibernated.

When it comes to Manjaro my uptime is always in the order of days/weeks because I always hibernate it.

Should I reboot my system, log into Manjaro, run the script provided in the Manjaro Wiki, perform a failed hibernating and then run the script again and post the result here?

Not a good idea: always completely shut down the one OS before booting the other one. (any of them)

Please try that first and if that still fails, I’m again all out of bright ideas!

:sob:

Nope, yesterday I shut down Manjaro, went to Windows, shut down Windows as well and today after waking up I opened Manjaro with a bunch of crap, all 9 workspaces filled up, Spotify included, and the hibernation failed. After closing Spotify the hibernation also failed.

Error is the same as before:

ago 16 12:34:44 UD-Legion systemd[1]: Starting Hibernate...
ago 16 12:34:44 UD-Legion systemd-sleep[5771]: [11] INFO: # Pre-suspend hook
ago 16 12:34:44 UD-Legion systemd-sleep[5771]: [11] INFO: Previous state was: {'type': 'done', 'switch_id': '20210816T121036', 'current_mode': 'integrated'}
ago 16 12:34:44 UD-Legion systemd-sleep[5771]: [12] INFO: Switching option: none
ago 16 12:34:44 UD-Legion systemd-sleep[5771]: [12] INFO: Turning Nvidia GPU back on
ago 16 12:34:44 UD-Legion systemd-sleep[5821]: modinfo: ERROR: Module bbswitch not found.
ago 16 12:34:44 UD-Legion systemd-sleep[5825]: modinfo: ERROR: Module acpi_call not found.
ago 16 12:34:45 UD-Legion systemd-sleep[5771]: [477] INFO: switching=none, nothing to do
ago 16 12:34:45 UD-Legion systemd-sleep[5771]: [477] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210816T121036', 'current_mode': 'integrated'}
ago 16 12:34:45 UD-Legion systemd-sleep[5771]: [477] INFO: Pre-suspend hook completed successfully.
ago 16 12:34:45 UD-Legion systemd-sleep[5768]: Suspending system...
ago 16 12:34:47 UD-Legion systemd-sleep[5768]: Failed to suspend system. System resumed again: Cannot allocate memory
ago 16 12:34:47 UD-Legion systemd-sleep[5923]: [20] INFO: # Post-resume hook
ago 16 12:34:47 UD-Legion systemd-sleep[5923]: [20] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20210816T121036', 'current_mode': 'integrated'}
ago 16 12:34:47 UD-Legion systemd-sleep[5923]: [21] INFO: Turning Nvidia GPU off again
ago 16 12:34:47 UD-Legion systemd-sleep[5974]: modinfo: ERROR: Module bbswitch not found.
ago 16 12:34:47 UD-Legion systemd-sleep[5981]: modinfo: ERROR: Module acpi_call not found.
ago 16 12:34:47 UD-Legion systemd-sleep[5923]: [580] INFO: switching=none, nothing to do
ago 16 12:34:47 UD-Legion systemd-sleep[5923]: [580] INFO: Writing state {'type': 'done', 'switch_id': '20210816T121036', 'current_mode': 'integrated'}
ago 16 12:34:47 UD-Legion systemd-sleep[5923]: [580] INFO: Post-resume hook completed successfully.
ago 16 12:34:48 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
ago 16 12:34:48 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
ago 16 12:34:48 UD-Legion systemd[1]: Failed to start Hibernate.
ago 16 12:34:48 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 2.551s CPU time.

And the memory consuption is still low:

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            7851        3908        2653         534        1289        3145
Swap:          12286         316       11970

Any further help is appreciated considering that I use hibernation as a fundamental piece of my workflow, as I always have my worked “saved” in the workspaces that I’m using, such that I always know what I was doing before I stopped working on it.

Last-ditch effort:

That’s a quite new machine: Did you ever try kernel 5.10 or did you avoid doing that because of the other post?

:thinking:

If even that doesn’t help: I’m totally out of ideas!!!

:sob:

I’ve just updated to kernel 5.10, after a clean boot, I’ve attempted to hibernate my machine three times, with a bunch of random programs running, including Spotify. The output from journalctl is the following:

-- Boot b56327e508ce41b1be96b98c4c0f6ebf --
ago 19 19:42:18 UD-Legion systemd[1]: Starting Hibernate...
ago 19 19:42:18 UD-Legion systemd-sleep[15161]: [10] INFO: # Pre-suspend hook
ago 19 19:42:18 UD-Legion systemd-sleep[15161]: [10] INFO: Previous state was: {'type': 'done', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:42:18 UD-Legion systemd-sleep[15161]: [11] INFO: Switching option: none
ago 19 19:42:18 UD-Legion systemd-sleep[15161]: [11] INFO: Turning Nvidia GPU back on
ago 19 19:42:18 UD-Legion systemd-sleep[15225]: modinfo: ERROR: Module bbswitch not found.
ago 19 19:42:18 UD-Legion systemd-sleep[15230]: modinfo: ERROR: Module acpi_call not found.
ago 19 19:42:19 UD-Legion systemd-sleep[15161]: [485] INFO: switching=none, nothing to do
ago 19 19:42:19 UD-Legion systemd-sleep[15161]: [486] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:42:19 UD-Legion systemd-sleep[15161]: [486] INFO: Pre-suspend hook completed successfully.
ago 19 19:42:19 UD-Legion systemd-sleep[15158]: Suspending system...
ago 19 19:42:21 UD-Legion systemd-sleep[15158]: Failed to suspend system. System resumed again: Cannot allocate memory
ago 19 19:42:21 UD-Legion systemd-sleep[15316]: [16] INFO: # Post-resume hook
ago 19 19:42:21 UD-Legion systemd-sleep[15316]: [16] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:42:21 UD-Legion systemd-sleep[15316]: [17] INFO: Turning Nvidia GPU off again
ago 19 19:42:21 UD-Legion systemd-sleep[15411]: modinfo: ERROR: Module bbswitch not found.
ago 19 19:42:21 UD-Legion systemd-sleep[15419]: modinfo: ERROR: Module acpi_call not found.
ago 19 19:42:22 UD-Legion systemd-sleep[15316]: [554] INFO: switching=none, nothing to do
ago 19 19:42:22 UD-Legion systemd-sleep[15316]: [554] INFO: Writing state {'type': 'done', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:42:22 UD-Legion systemd-sleep[15316]: [555] INFO: Post-resume hook completed successfully.
ago 19 19:42:22 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
ago 19 19:42:22 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
ago 19 19:42:22 UD-Legion systemd[1]: Failed to start Hibernate.
ago 19 19:42:22 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 2.795s CPU time.
ago 19 19:45:15 UD-Legion systemd[1]: Starting Hibernate...
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [10] INFO: # Pre-suspend hook
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [10] INFO: Previous state was: {'type': 'done', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [11] INFO: Switching option: none
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [11] INFO: Turning Nvidia GPU back on
ago 19 19:45:15 UD-Legion systemd-sleep[16171]: modinfo: ERROR: Module bbswitch not found.
ago 19 19:45:15 UD-Legion systemd-sleep[16174]: modinfo: ERROR: Module acpi_call not found.
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [489] INFO: switching=none, nothing to do
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [489] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:45:15 UD-Legion systemd-sleep[16109]: [489] INFO: Pre-suspend hook completed successfully.
ago 19 19:45:15 UD-Legion systemd-sleep[16106]: Suspending system...
ago 19 19:45:17 UD-Legion systemd-sleep[16106]: Failed to suspend system. System resumed again: Cannot allocate memory
ago 19 19:45:17 UD-Legion systemd-sleep[16260]: [32] INFO: # Post-resume hook
ago 19 19:45:17 UD-Legion systemd-sleep[16260]: [33] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:45:17 UD-Legion systemd-sleep[16260]: [35] INFO: Turning Nvidia GPU off again
ago 19 19:45:17 UD-Legion systemd-sleep[16365]: modinfo: ERROR: Module bbswitch not found.
ago 19 19:45:17 UD-Legion systemd-sleep[16374]: modinfo: ERROR: Module acpi_call not found.
ago 19 19:45:18 UD-Legion systemd-sleep[16260]: [558] INFO: switching=none, nothing to do
ago 19 19:45:18 UD-Legion systemd-sleep[16260]: [558] INFO: Writing state {'type': 'done', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:45:18 UD-Legion systemd-sleep[16260]: [559] INFO: Post-resume hook completed successfully.
ago 19 19:45:18 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
ago 19 19:45:18 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
ago 19 19:45:18 UD-Legion systemd[1]: Failed to start Hibernate.
ago 19 19:45:18 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 2.375s CPU time.
ago 19 19:46:54 UD-Legion systemd[1]: Starting Hibernate...
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [10] INFO: # Pre-suspend hook
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [10] INFO: Previous state was: {'type': 'done', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [11] INFO: Switching option: none
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [11] INFO: Turning Nvidia GPU back on
ago 19 19:46:54 UD-Legion systemd-sleep[16676]: modinfo: ERROR: Module bbswitch not found.
ago 19 19:46:54 UD-Legion systemd-sleep[16679]: modinfo: ERROR: Module acpi_call not found.
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [524] INFO: switching=none, nothing to do
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [524] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:46:54 UD-Legion systemd-sleep[16619]: [525] INFO: Pre-suspend hook completed successfully.
ago 19 19:46:54 UD-Legion systemd-sleep[16616]: Suspending system...
ago 19 19:46:56 UD-Legion systemd-sleep[16616]: Failed to suspend system. System resumed again: Cannot allocate memory
ago 19 19:46:56 UD-Legion systemd-sleep[16771]: [26] INFO: # Post-resume hook
ago 19 19:46:56 UD-Legion systemd-sleep[16771]: [26] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:46:56 UD-Legion systemd-sleep[16771]: [27] INFO: Turning Nvidia GPU off again
ago 19 19:46:56 UD-Legion systemd-sleep[16872]: modinfo: ERROR: Module bbswitch not found.
ago 19 19:46:56 UD-Legion systemd-sleep[16881]: modinfo: ERROR: Module acpi_call not found.
ago 19 19:46:57 UD-Legion systemd-sleep[16771]: [547] INFO: switching=none, nothing to do
ago 19 19:46:57 UD-Legion systemd-sleep[16771]: [548] INFO: Writing state {'type': 'done', 'switch_id': '20210819T175903', 'current_mode': 'integrated'}
ago 19 19:46:57 UD-Legion systemd-sleep[16771]: [548] INFO: Post-resume hook completed successfully.
ago 19 19:46:57 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
ago 19 19:46:57 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
ago 19 19:46:57 UD-Legion systemd[1]: Failed to start Hibernate.
ago 19 19:46:57 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 2.515s CPU time.

However something strange was being outputted to the screen. I took my cellphone and recorded it, on the third hibernation attempt. What happened was that it locked the screen, I had to unlock it, and then it would darken the screen and show some messages which I assume come directly from the kernel, as they look like messages you would find during a boot or shutdown process. The messages were the following:

[6200.052148] PM: hibernation: Image allocation is 156834 pages short
[6376.080606] PM: hibernation: Image allocation is 116144 pages short
[8474.940000] PM: hibernation: Image allocation is 132252 pages short

However after shutting down Spotify I managed to hibernate my laptop. However for some reason it always required me to unlock my screen before showing those kernels messages, then it would darken the screen again, as well as peripherals (e.g.: mouse), put the screen back on again showing the same kernel messages written before, and toggling peripherals on as well, and then it would finally hibernate by making a “pop” sound on my headset.

But hey, at least it hibernates, even if it has major issues.

Could this be related to Nvidia and those warning that says that those programs cannot be found? Because Nvidia has always given me issues on Linux so far.

Here’s some output that might be relevant:

$ uname -a
Linux UD-Legion 5.10.59-1-MANJARO #1 SMP PREEMPT Sun Aug 15 13:11:32 UTC 2021 x86_64 GNU/Linux
 $ free -m
               total        used        free      shared  buff/cache   available
Mem:            7846        3086        2872         926        1887        3543
Swap:          12286          87       12199
$ nvidia-smi
Thu Aug 19 19:57:53 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.63.01    Driver Version: 470.63.01    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   28C    P0    N/A /  N/A |      0MiB /  4042MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
$ mnj-wiki-script.sh
[warning] Not running as root: skipping zswap info
mono	14188	kB
python3	1424	kB
pulseaudio	1392	kB
polkitd	1356	kB
(sd-pam)	1288	kB
colord	1184	kB
espanso	1104	kB
dunst	860	kB
udisksd	740	kB
espanso	672	kB
cupsd	580	kB
accounts-daemon	580	kB
at-spi2-registr	560	kB
xfconfd	476	kB
dbus-daemon	428	kB
gvfsd	396	kB
systemd-udevd	392	kB
gvfsd-metadata	388	kB
systemd	384	kB
NetworkManager	372	kB
wpa_supplicant	368	kB
gsettings-helpe	336	kB
atom	300	kB
dbus-daemon	292	kB
zsh	284	kB
zsh	276	kB
systemd-logind	272	kB
picom	268	kB
upowerd	248	kB
systemd-journal	228	kB
gvfsd-fuse	220	kB
mount.ntfs-3g	216	kB
systemd-timesyn	208	kB
gvfs-udisks2-vo	208	kB
ksuperkey	204	kB
dbus-daemon	192	kB
systemd	168	kB
at-spi-bus-laun	132	kB
dconf-service	52	kB
rtkit-daemon	32	kB
gvfsd-trash	8	kB
evinced	8	kB
zswap-shrink	
zswap1	
zswap1	
zsh	0	kB
zsh	0	kB
zsh	0	kB
zsh	0	kB
Xorg	0	kB
xfce4-power-man	0	kB
xclip	0	kB
writeback	
WebExtensions	0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
Web	Content0	kB
watchdogd	
unclutter	0	kB
udiskie	0	kB
tpm_dev_wq	
thunderbird	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
spotify	0	kB
sort	0	kB
slack	0	kB
slack	0	kB
slack	0	kB
slack	0	kB
slack	0	kB
slack	0	kB
slack	0	kB
sdhci	
scsi_tmf_2	
scsi_tmf_1	
scsi_tmf_0	
scsi_eh_2	
scsi_eh_1	
scsi_eh_0	
RDD	Process0	kB
rcu_tasks_trace	
rcu_tasks_rude_	
rcu_tasks_kthre	
rcu_preempt	
rcu_par_gp	
rcu_gp	
rcuc/3	
rcuc/2	
rcuc/1	
rcuc/0	
rcub/0	
python3	0	kB
polybar	0	kB
polkit-gnome-au	0	kB
oom_reaper	
nv_queue	
nv_queue	
nvme-wq	
nvme-reset-wq	
nvme-delete-wq	
netns	
nautilus	0	kB
more	0	kB
mnj-wiki-script	0	kB
mnj-wiki-script	0	kB
mm_percpu_wq	
migration/3	
migration/2	
migration/1	
migration/0	
micro	0	kB
lightdm	0	kB
lightdm	0	kB
kworker/u9:2-rb_allocator	
kworker/u9:1-rb_allocator	
kworker/u9:0-i915_flip	
kworker/u8:4-events_unbound	
kworker/u8:2-events_power_efficient	
kworker/u8:1-events_power_efficient	
kworker/u8:0-events_unbound	
kworker/3:2-events	
kworker/3:1-rcu_gp	
kworker/3:1H-kblockd	
kworker/3:0H-events_highpri	
kworker/3:0-events_freezable	
kworker/2:2-events	
kworker/2:1-mm_percpu_wq	
kworker/2:1H-events_highpri	
kworker/2:0H-events_highpri	
kworker/2:0	
kworker/1:2-mm_percpu_wq	
kworker/1:1-pm	
kworker/1:1H-events_highpri	
kworker/1:0H-events_highpri	
kworker/1:0-events	
kworker/0:2-events	
kworker/0:1H-kblockd	
kworker/0:1-events	
kworker/0:0H-events_highpri	
kworker/0:0-events	
kthrotld	
kthreadd	
kswapd0	
kstrp	
ksoftirqd/3	
ksoftirqd/2	
ksoftirqd/1	
ksoftirqd/0	
ksmd	
kitty	0	kB
kitty	0	kB
kitty	0	kB
kintegrityd	
khungtaskd	
khugepaged	
kdevtmpfs	
kcompactd0	
kblockd	
kauditd	
jbd2/nvme0n1p6-	
irq/137-iwlwifi	
irq/135-mei_me	
irq/134-mmc0	
irq/126-aerdrv	
irq/123-aerdrv	
ipv6_addrconf	
idle_inject/3	
idle_inject/2	
idle_inject/1	
idle_inject/0	
i3	0	kB
gitstatusd-linu	0	kB
gitstatusd-linu	0	kB
gitstatusd-linu	0	kB
flashfocus	0	kB
firefox	0	kB
ext4-rsv-conver	
evince	0	kB
evince	0	kB
evince	0	kB
evince	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
electron	0	kB
edac-poller	
Discord	0	kB
Discord	0	kB
Discord	0	kB
Discord	0	kB
Discord	0	kB
Discord	0	kB
Discord	0	kB
Discord	0	kB
devfreq_wq	
cryptd	
cpuhp/3	
cpuhp/2	
cpuhp/1	
cpuhp/0	
charger_manager	
cfg80211	
card0-crtc2	
card0-crtc1	
card0-crtc0	
blkcg_punt_bio	
awk	0	kB
awk	0	kB
atom	0	kB
ata_sff	
acpi_thermal_pm

Good! So your original problem is hereby solved, so I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or :heart: or :+1: if you agree)

:innocent:
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.


As to your new issues, they are application specific, so this is the process to debug application per application:

  • Log on
  • Close all autostart programs (if any)
  • Start 1 (one) application
  • Hibernate
  • Debug

Rinse and repeat the above and create a new post for every issue you wouldn’t be able to resolve yourself. :+1:

P.S. We won’t charge additional :money_with_wings: if you do create additional topics. :grin:

I was just further debugging the hibernation, and ignore the whole screenlock showing up and then disappearing part, that’s a unrelated problem that showed up with the last update.

I suppose that this is now a Spotify driven problem rather than a problem with Manjaro or the Linux kernel.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

This thread is meant to be a follow up of a previous support thread on the same issue, also authored by me, that was “solved” by updating the Linux kernel but now came back. The original thread is here, but you don’t need to see it as I will describe everything I know and what I have done so far.

The issue

On some circumstances I am unable to hibernate my machine. Usually it’s something like having Spotify open or having a lot of things opened. The error that systemd reports is always the same and looks like the following:

ago 28 13:05:15 UD-Legion systemd[1]: Starting Hibernate...
ago 28 13:05:15 UD-Legion systemd-sleep[91318]: [10] INFO: # Pre-suspend hook
ago 28 13:05:15 UD-Legion systemd-sleep[91318]: [10] INFO: Previous state was: {'type': 'done', 'switch_id': '20210826T112121', 'current_mode': 'integrated'}
ago 28 13:05:15 UD-Legion systemd-sleep[91318]: [11] INFO: Switching option: none
ago 28 13:05:15 UD-Legion systemd-sleep[91318]: [11] INFO: Turning Nvidia GPU back on
ago 28 13:05:15 UD-Legion systemd-sleep[91372]: modinfo: ERROR: Module bbswitch not found.
ago 28 13:05:15 UD-Legion systemd-sleep[91376]: modinfo: ERROR: Module acpi_call not found.
ago 28 13:05:16 UD-Legion systemd-sleep[91318]: [487] INFO: switching=none, nothing to do
ago 28 13:05:16 UD-Legion systemd-sleep[91318]: [487] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20210826T112121', 'current_mode': 'integrated'}
ago 28 13:05:16 UD-Legion systemd-sleep[91318]: [487] INFO: Pre-suspend hook completed successfully.
ago 28 13:05:16 UD-Legion systemd-sleep[91315]: Suspending system...
ago 28 13:05:17 UD-Legion systemd-sleep[91315]: Failed to suspend system. System resumed again: Cannot allocate memory
ago 28 13:05:18 UD-Legion systemd-sleep[91469]: [15] INFO: # Post-resume hook
ago 28 13:05:18 UD-Legion systemd-sleep[91469]: [16] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20210826T112121', 'current_mode': 'integrated'}
ago 28 13:05:18 UD-Legion systemd-sleep[91469]: [17] INFO: Turning Nvidia GPU off again
ago 28 13:05:18 UD-Legion systemd-sleep[91556]: modinfo: ERROR: Module bbswitch not found.
ago 28 13:05:18 UD-Legion systemd-sleep[91564]: modinfo: ERROR: Module acpi_call not found.
ago 28 13:05:18 UD-Legion systemd-sleep[91469]: [544] INFO: switching=none, nothing to do
ago 28 13:05:18 UD-Legion systemd-sleep[91469]: [544] INFO: Writing state {'type': 'done', 'switch_id': '20210826T112121', 'current_mode': 'integrated'}
ago 28 13:05:18 UD-Legion systemd-sleep[91469]: [544] INFO: Post-resume hook completed successfully.
ago 28 13:05:18 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
ago 28 13:05:18 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
ago 28 13:05:18 UD-Legion systemd[1]: Failed to start Hibernate.
ago 28 13:05:18 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 2.515s CPU time.

In the previous thread, after updating the kernel, the problem was “solved”. Only Spotify would create this issue, but today, hibernation failed, with a few tabs open on Firefox as well as a few other programs running which I always use, showing me the same error. I was able to hibernate after closing a few tabs on Firefox, meaning that the issue isn’t with Spotify has it was pointed out in the previous thread.

Failed hibernation sequence

After the kernel update a failed hibernation does the following sequence:

  1. I issue a sudo systemctl hibernate;
  2. The lockscreen shows up;
  3. What appears to be a TTY with several messages, usually 2 or 3, saying something similar to [6200.052148] PM: hibernation: Image allocation is 156834 pages short;
  4. The lockscreen comes back up and I have to login again because the hibernation failed. The peripherals LEDs remain always on.

Successful hibernation sequence

After the kernel update a successful hibernation follows the following pattern (the first 3 steps are the same) (video available here):

  1. I issue a sudo systemctl hibernate;
  2. The lockscreen shows up;
  3. What appears to be a TTY with several messages, usually 2 or 3, saying something similar to [6200.052148] PM: hibernation: Image allocation is 156834 pages short;
  4. The screen darkens and peripherals lose their power;
  5. The TTY shows up again and peripherals get their power back;
  6. The system finally hibernates with a loud popping sound on my headset.

Systems specs

  • OS: Manjaro (installed from the Architect installer)
  • WM: i3
  • Kernel: 5.10.59-1-MANJARO x86_64
  • GPU: iGPU (Intel) + dGPU (NVIDIA 1050Ti)
  • 8 GiB of RAM and 12 GiB of swap
  • Swap is available on it’s own partition and mounted in /etc/fstab
  • rEFInd
  • Dual boot with Windows 10

TL;DR: Unable to hibernate although I have more swap than RAM, and the fix seems to be shutting down programs.

EDIT: This post was originally created on another thread, because this one was locked, but now it was moved here!

This happened again today with only a few programs opened… I’m having a hard time diagnosing this issue, and I do rely a lot on hibernation considering I’m on a laptop and I move around quite a bit, all I remember is that this issue started a few months ago and that hibernation on this machine was always problematic, but it always worked.