Freezing programs when screen turned off

Hello I have several programs that need to run for long periods of time, during this time I turn my screen off but want the program to keep running in the background. However when turning my screen on again after some time I notice the screen is frozen, and the only way to unfreeze it is to reboot the device.
I don't know exactly when this happens, only some time after leaving it for some time.
I've checked the power saving settings and all of the usual suspects are disabled.


Here is the content of my Garuda-inxi

System:
Kernel: 6.4.1-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=94978e7e-3bb8-49ab-b654-20a90c19d22c rw rootflags=subvol=@
quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.27.6 tk: Qt v: 5.15.10 wm: kwin_x11 vt: 2
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Desktop Mobo: Micro-Star model: MAG B660M MORTAR WIFI DDR4 (MS-7D42)
v: 1.0 serial: <superuser required> UEFI: American Megatrends LLC. v: 1.C0
date: 05/19/2023
CPU:
Info: model: 12th Gen Intel Core i5-12400F bits: 64 type: MT MCP
arch: Alder Lake gen: core 12 level: v3 note: check built: 2021+
process: Intel 7 (10nm ESF) family: 6 model-id: 0x97 (151) stepping: 2
microcode: 0x2D
Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
L1: 480 KiB desc: d-6x48 KiB; i-6x32 KiB L2: 7.5 MiB desc: 6x1.2 MiB
L3: 18 MiB desc: 1x18 MiB
Speed (MHz): avg: 2183 high: 2500 min/max: 800/5600 scaling:
driver: intel_pstate governor: powersave cores: 1: 2500 2: 2500 3: 600
4: 2500 5: 600 6: 2500 7: 2500 8: 2500 9: 2500 10: 2500 11: 2500 12: 2500
bogomips: 59904
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: AMD Navi 24 [Radeon RX 6400/6500 XT/6500M] vendor: XFX
driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm)
built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
active: HDMI-A-1 empty: DP-1 bus-ID: 03:00.0 chip-ID: 1002:743f
class-ID: 0300
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2
compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting,radeon
alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
s-diag: 582mm (22.93")
Monitor-1: HDMI-A-1 mapped: HDMI-A-0 model: Dell P2219H serial: <filter>
built: 2021 res: 1920x1080 hz: 60 dpi: 102 gamma: 1.2
size: 476x267mm (18.74x10.51") diag: 546mm (21.5") ratio: 16:9 modes:
max: 1920x1080 min: 720x400
API: OpenGL v: 4.6 Mesa 23.1.3 renderer: AMD Radeon RX 6500 XT (navi24
LLVM 15.0.7 DRM 3.52 6.4.1-zen1-1-zen) direct-render: Yes
Audio:
Device-1: Intel Alder Lake-S HD Audio vendor: Micro-Star MSI
driver: snd_hda_intel v: kernel alternate: snd_sof_pci_intel_tgl
bus-ID: 00:1f.3 chip-ID: 8086:7ad0 class-ID: 0403
Device-2: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel
pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 03:00.1 chip-ID: 1002:ab28
class-ID: 0403
API: ALSA v: k6.4.1-zen1-1-zen status: kernel-api tools: N/A
Server-1: PipeWire v: 0.3.72 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Alder Lake-S PCH CNVi WiFi driver: iwlwifi v: kernel
bus-ID: 00:14.3 chip-ID: 8086:7af0 class-ID: 0280
IF: wlo1 state: up mac: <filter>
Device-2: Realtek RTL8125 2.5GbE vendor: Micro-Star MSI driver: r8169
v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 port: 4000 bus-ID: 06:00.0
chip-ID: 10ec:8125 class-ID: 0200
IF: enp6s0 state: down mac: <filter>
Bluetooth:
Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-14:7 chip-ID: 8087:0026
class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 0 state: down
bt-service: enabled,running rfk-block: hardware: no software: yes
address: <filter>
Drives:
Local Storage: total: 945.83 GiB used: 149.73 GiB (15.8%)
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 tech: SSD serial: <filter>
fw-rev: 711250WD temp: 38.9 C scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: SanDisk model: Ultra USB 3.0
size: 14.32 GiB block-size: physical: 512 B logical: 512 B type: USB
rev: 2.1 spd: 480 Mb/s lanes: 1 mode: 2.0 tech: N/A serial: <filter>
fw-rev: 1.00
SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
ID-1: / raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
used: 149.73 GiB (16.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
used: 149.73 GiB (16.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
used: 149.73 GiB (16.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
used: 149.73 GiB (16.1%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 31.2 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 34.0 C mobo: N/A gpu: amdgpu temp: 39.0 C
mem: 38.0 C
Fan Speeds (RPM): N/A gpu: amdgpu fan: 0
Info:
Processes: 353 Uptime: 0m wakeups: 0 Memory: available: 31.2 GiB
used: 3.27 GiB (10.5%) Init: systemd v: 253 default: graphical
tool: systemctl Compilers: gcc: 13.1.1 Packages: pm: pacman pkgs: 1386
libs: 385 tools: octopi,paru,yay Shell: fish v: 3.6.1 default: Bash
v: 5.1.16 running-in: konsole inxi: 3.3.27
Garuda (2.6.16-1):
System install date:     2023-06-24
Last full system update: 2023-07-02
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       No/Undetected
Failed units:

I thank you in advance.

In my opinion your system goes to "sleep/suspend" after some time when the monitor is off and has issues when resuming.
You could work to solve this latter aspect, or probably you could disable suspend at all, possibly at low level.
Read:
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate
and
https://wiki.archlinux.org/title/Power_management
I'd go for a

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Use umask to reenable if not working.

5 Likes

Hi, just as a quick noob question does this command need to be run each time I boot the machine? It seemed to fix it the first time but after that the issue popped up again

No, that's really strange, I expected this to be a one-shot action. You could create a script to execute it automatically at every boot, but I'd rather go first for this suggestion:
https://wiki.archlinux.org/title/Power_management#Disabling_suspend

3 Likes

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