Strange behavior (freezing, long restart times, black monitors) after system sleeps

Hi everyone!

I’m a new user of Manjaro Linux and it’s my first “proper” (not in a vm) distro. I’ve been really enjoying it so far but there’s been an issue that I can’t figure out the root cause of.

The problem starts when I leave my computer on for a non-negligable amount of time and it goes to sleep. Usually, if the time is short and I come back quickly, nothing really happens. However, when I leave it on overnight or throughout the day when I’m out of the house, a whole bunch of weird behavior occurs when I unsleep it.

The most noticeable is that the entire OS becomes very slow, apps lag a lot, animations are very delayed, etc. This is to the point of borderline unusability so I’m forced to restart which is where the 2nd problem happens. Shutdowns/Restarts are usually very fast, but in these scenarios they can take upwards of 5-10 minutes. Sometimes the screen is peppered with errors and sometimes it’s all black. And when my computer finally does restart, my 2nd monitor will not work unless I pull the cable out and put it back in.

I’m not sure if these problems are related, but they all only occur after my computer puts itself to sleep for a long time. Any help is appreciated!

System:
  Kernel: 5.15.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=d6f8c1d4-003e-43ff-8b50-7126bcf3d505 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma 5.23.5 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: LENOVO product: 90NC00JAUS v: Legion T5 28IMB05
    serial: <superuser required> Chassis: type: 3 serial: <superuser required>
  Mobo: LENOVO model: 3717 v: SDK0J40700 WIN 3258192292810
    serial: <superuser required> UEFI: LENOVO v: O4NKT16A date: 09/03/2020
Battery:
  Message: No system battery data found. Is one present?
Memory:
  RAM: total: 23.22 GiB used: 5.09 GiB (21.9%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i5-10400 bits: 64 type: MT MCP arch: Comet Lake
    family: 6 model-id: 0xA5 (165) stepping: 3 microcode: 0xEA
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 2450 high: 3297 min/max: 800/4300 scaling:
    driver: intel_pstate governor: powersave cores: 1: 2793 2: 2698 3: 3049
    4: 2000 5: 2763 6: 3297 7: 2094 8: 2027 9: 2630 10: 2140 11: 1865 12: 2045
    bogomips: 69629
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush clflushopt
    cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts
    epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu fsgsbase fxsr
    ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ibrs_enhanced ida
    intel_pt invpcid invpcid_single lahf_lm lm mca mce md_clear mmx monitor
    movbe mpx msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm
    pdpe1gb pebs pge pln pni popcnt pse pse36 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: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  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: Enhanced IBRS, IBPB: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU116 [GeForce GTX 1660 SUPER] vendor: Micro-Star MSI
    driver: nvidia v: 495.46 alternate: nouveau,nvidia_drm bus-ID: 01:00.0
    chip-ID: 10de:21c4 class-ID: 0300
  Device-2: Sunplus IT Co Full HD webcam type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-8:4 chip-ID: a187:28b3
    class-ID: 0102 serial: <filter>
  Display: x11 server: X.org 1.21.1.3 compositor: kwin_x11 driver:
    loaded: nvidia resolution: <missing: xdpyinfo>
  Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:
  Device-1: Intel Comet Lake PCH-V cAVS vendor: Lenovo driver: snd_hda_intel
    v: kernel alternate: snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:a3f0 class-ID: 0403
  Device-2: NVIDIA TU116 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 01:00.1 chip-ID: 10de:1aeb
    class-ID: 0403
  Device-3: Sunplus IT Co Full HD webcam type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-8:4 chip-ID: a187:28b3
    class-ID: 0102 serial: <filter>
  Sound Server-1: ALSA v: k5.15.16-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.43 running: yes
Network:
  Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus-ID: 02:00.0
    chip-ID: 8086:2723 class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel port: 3000 bus-ID: 03:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: down mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-9:5
    chip-ID: 8087:0029 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 1.83 TiB used: 37.2 GiB (2.0%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
    model: WD BLACK SN750 SE 1TB size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 63.2 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 711130WD temp: 32.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
    model: WD10EZEX-08WN4A0 size: 931.51 GiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter>
    rev: 1A02 scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 type: USB vendor: SMI (STMicroelectronics)
    model: USB size: 7.44 GiB block-size: physical: 512 B logical: 512 B
    type: N/A serial: <filter> rev: 1100 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 350 GiB size: 343.43 GiB (98.12%) used: 37.18 GiB (10.8%)
    fs: ext4 dev: /dev/nvme0n1p5 maj-min: 259:5 label: N/A
    uuid: d6f8c1d4-003e-43ff-8b50-7126bcf3d505
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%)
    used: 29 MiB (11.3%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
    label: SYSTEM uuid: 1491-B94B
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/nvme0n1p2 maj-min: 259:2 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
  ID-2: /dev/nvme0n1p3 maj-min: 259:3 size: 580.26 GiB fs: ntfs
    label: Windows uuid: EE1094771094490B
  ID-3: /dev/nvme0n1p4 maj-min: 259:4 size: 1000 MiB fs: ntfs
    label: WinRE_DRV uuid: 26DC94C5DC9490A3
  ID-4: /dev/sda1 maj-min: 8:1 size: 128 MiB fs: <superuser required>
    label: N/A uuid: N/A
  ID-5: /dev/sda2 maj-min: 8:2 size: 931.39 GiB fs: ntfs label: Data
    uuid: FA3C976D3C972423
  ID-6: /dev/sdb1 maj-min: 8:17 size: 7.41 GiB fs: vfat label: N/A
    uuid: 4C8A-F0BA
  ID-7: /dev/sdb2 maj-min: 8:18 size: 32 MiB fs: vfat label: VTOYEFI
    uuid: 2BE6-1E5C
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-3:2 info: Razer USA Razer BlackWidow V3
    type: Keyboard,Mouse,HID driver: hid-generic,usbhid interfaces: 5 rev: 2.0
    speed: 12 Mb/s power: 500mA chip-ID: 1532:024e class-ID: 0300
  Device-2: 1-4:3 info: Corsair Gaming GLAIVE RGB Mouse type: Mouse,HID
    driver: corsair,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 300mA
    chip-ID: 1b1c:1b34 class-ID: 0300 serial: <filter>
  Device-3: 1-8:4 info: Sunplus IT Co Full HD webcam type: Video,Audio
    driver: snd-usb-audio,uvcvideo interfaces: 4 rev: 2.0 speed: 480 Mb/s
    power: 500mA chip-ID: a187:28b3 class-ID: 0102 serial: <filter>
  Device-4: 1-9:5 info: Intel AX200 Bluetooth type: Bluetooth driver: btusb
    interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA chip-ID: 8087:0029
    class-ID: e001
  Device-5: 1-11:6 info: Lenovo ITE Device(8297) type: HID
    driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s
    power: 100mA chip-ID: 17ef:c955 class-ID: 0301
  Hub-2: 2-0:1 info: Super-speed hub ports: 8 rev: 3.0 speed: 5 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Device-1: 2-6:2
    info: Silicon Motion - Taiwan (formerly Feiya ) Flash Drive
    type: Mass Storage driver: usb-storage interfaces: 1 rev: 3.1
    speed: 5 Gb/s power: 504mA chip-ID: 090c:1000 class-ID: 0806
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 2 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-4: 4-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 27.8 C mobo: N/A gpu: nvidia temp: 44 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 27%
Info:
  Processes: 407 Uptime: 28m wakeups: 0 Init: systemd v: 250 tool: systemctl
  Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: 1337 pacman: 1321 lib: 358
  flatpak: 6 snap: 10 Shell: Zsh v: 5.8 default: Bash v: 5.1.16
  running-in: konsole inxi: 3.3.12

Probably when the time is too much the laptop go to hibernate and hibernation swap is not defined. Check the grub /etc/default/grub the cmdline resume=UUID=XXX then XXX is the UUID of the swap partition

First off, thanks for the response.

It’s not a laptop, not sure if it matters or not but thought I’d mention it.
And sorry, but could you explain what “the cmdline resume=UUID=XXX” means? I looked in the /etc/default/grub folder and didn’t see any mention of resume

Desktop have hibernation too.
Open a terminal, sudo nano /etc/default/grub and you can see a line that say "GRUB_CMDLINE_LINUX_DEFAULT=“quiet” well, add resume=UUID=XXXX where XXXX is the UUID of the swap partition. How to know that? sudo blkid. Put the UUID of the swap append to quiet, so, supposed that is 1234:

GRUB_CMDLINE_LINUX_DEFAULT=“quiet resume=UUID=1234”
Save with ctrl+o, exit with ctrl+x and run sudo update-grub.

Edit: You does not have swap (looking better the info provided).
You can create a file.

sudo fallocate -l 8G /swapfile
sudo mkswap /swapfile
sudo chmod 600 /swapfile
sudo swapon -a

And use it as swap, and hibernation.

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file