Multiple applications lagging and freezing, sometimes crashes GNOME session

Hello everyone. I’ve been trying to troubleshoot some unusually severe and persistent lag on my system, and I’m running out of ideas.

Also, I reference multiple OSes and Fedora spins in this post because I tried them as troubleshooting steps. My hope is to end up with a stable, working copy of Fedora 37 Workstation, if at all possible.

The problem

  • On a freshly installed Linux system (including Fedora, but multiple distributions tried), severe lag affects all applications and rapidly renders the system unusable. In one case, the GNOME session terminated and crashed to the login prompt.
  • Graphical applications affected include GNOME Shell, KDE’s UI, multiple web browsers, Steam, Discord, terminal emulators – you name it.
  • Command line applications are also affected, including things like sudo and dnf. In one case, CLI applications being run in a TTY were affected.
  • On KDE, the problem generally starts on login and makes any use of the system difficult or impossible. On GNOME, the system sometimes runs properly for some time before trouble sets in.

inxi -Fzx output

System:
  Kernel: 6.0.10-300.fc37.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.38-25.fc37 Desktop: GNOME v: 43.1 Distro: Fedora release 37 (Thirty
    Seven)
Machine:
  Type: Desktop System: Gigabyte product: H270-HD3P v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: H270-HD3P-CF v: x.x serial: <superuser required>
    UEFI: American Megatrends v: F2 date: 11/25/2016
Battery:
  Device-1: hidpp_battery_0 model: Logitech K780 Multi-Device Wireless
    Keyboard charge: 100% (should be ignored) status: discharging
  Device-2: hidpp_battery_1 model: Logitech Wireless Mouse MX Master 3
    charge: 100% (should be ignored) status: full
CPU:
  Info: quad core model: Intel Core i5-7600K bits: 64 type: MCP
    arch: Kaby Lake rev: 9 cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
  Speed (MHz): avg: 4112 high: 4123 min/max: 800/4200 cores: 1: 4123 2: 4100
    3: 4123 4: 4105 bogomips: 30399
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: NVIDIA GP104 [GeForce GTX 1070] vendor: Gigabyte driver: nouveau
    v: kernel arch: Pascal bus-ID: 01:00.0 temp: 39.0 C
  Display: wayland server: X.Org v: 22.1.5 with: Xwayland v: 22.1.5
    compositor: gnome-shell driver: dri: nouveau gpu: nouveau
    resolution: 2560x1440~60Hz
  API: OpenGL v: 4.3 Mesa 22.2.3 renderer: NV134 direct render: Yes
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel bus-ID: 1-2:5 bus-ID: 00:1f.3
  Device-2: NVIDIA GP104 High Definition Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel bus-ID: 01:00.1
  Device-3: Logitech Headset H340 type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Sound API: ALSA v: k6.0.10-300.fc37.x86_64 running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.61 running: yes
Network:
  Device-1: Intel Ethernet I219-V vendor: Gigabyte driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6
  IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: USB
    driver: btusb v: 0.8 bus-ID: 1-8:3
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 447.13 GiB used: 101.47 GiB (22.7%)
  ID-1: /dev/sda vendor: Kingston model: SA400S37480G size: 447.13 GiB
    temp: 52 C
Partition:
  ID-1: / size: 445.53 GiB used: 101.24 GiB (22.7%) fs: btrfs dev: /dev/dm-0
    mapped: luks-6a14a76d-f9a6-48c1-b3c2-a03575bcadd2
  ID-2: /boot size: 973.4 MiB used: 219.3 MiB (22.5%) fs: ext4
    dev: /dev/sda2
  ID-3: /boot/efi size: 598.8 MiB used: 17.4 MiB (2.9%) fs: vfat
    dev: /dev/sda1
  ID-4: /home size: 445.53 GiB used: 101.24 GiB (22.7%) fs: btrfs
    dev: /dev/dm-0 mapped: luks-6a14a76d-f9a6-48c1-b3c2-a03575bcadd2
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 10.2 MiB (0.1%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 40.0 C mobo: N/A gpu: nouveau temp: 39.0 C
  Fan Speeds (RPM): N/A gpu: nouveau fan: 1111
Info:
  Processes: 288 Uptime: 7h 2m Memory: 15.57 GiB used: 3.51 GiB (22.6%)
  Init: systemd target: graphical (5) Compilers: gcc: 12.2.1 Packages: 8
  note: see --rpm Shell: Bash v: 5.2.9 inxi: 3.3.23

A weird thing I noticed in the logs: systemd-OOMD killing GNOME and dumping me back on the login screen

What’s unusual about this is that there’s really no way I was using up my system’s memory to this extent.

Nov 30 22:58:22 conflict-powered-system kernel: rfkill: input handler enabled
Nov 30 22:58:22 conflict-powered-system gnome-session[1999]: gnome-session-binary[1999]: WARNING: Client '/org/gnome/SessionManager/Client24' failed to reply before timeout
Nov 30 22:58:22 conflict-powered-system steam.desktop[15615]: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Nov 30 22:58:22 conflict-powered-system steam.desktop[15615]: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Nov 30 22:57:58 conflict-powered-system polkitd[1128]: Unregistered Authentication Agent for unix-session:2 (system bus name :1.93, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_CA.UTF-8) (disconnected from bus)
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service
Nov 30 22:58:00 conflict-powered-system gnome-session-binary[1999]: WARNING: Client '/org/gnome/SessionManager/Client24' failed to reply before timeout
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 62.10 Avg60: 39.08 Avg300: 15.65 Total: 1min 24s
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 233.0M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 36015
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 35868
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/org.freedesktop.IBus.session.GNOME.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 11ms
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 75.6M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 5063
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 5040
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 1s
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 54.5M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 2944
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 2925
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 0
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 46.5M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 57487
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 57471
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 383ms
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 26.1M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 1188
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 1182
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.SettingsDaemon.XSettings.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 0
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 22.4M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 615
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 613
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 3ms
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 14.7M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 240
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 240
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.SettingsDaemon.MediaKeys.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 61ms
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 8.0M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 109
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 109
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.SettingsDaemon.Power.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 560ms
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 7.0M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 110
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 110
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:         Path: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.SettingsDaemon.Wacom.service
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Pressure Limit: 0.00%
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pressure: Avg10: 0.00 Avg60: 0.00 Avg300: 0.00 Total: 0
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Current Memory Usage: 6.6M
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Min: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Memory Low: 0B
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Pgscan: 107
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]:                 Last Pgscan: 107
Nov 30 22:57:58 conflict-powered-system systemd-oomd[1092]: Killed /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service due to memory pressure for /user.slice/user-1000.slice/user@1000.service/session.slice being 63.20% > 50.00% for > 20s with reclaim activity

Things I’ve tested and tried

  • Problem does not occur on Windows 10 Home, but does occur on both Fedora (GNOME or KDE) and Manjaro (GNOME and KDE).
  • Live USB systems (Fedora and Manjaro, both GNOME and KDE for each) do not seem to be affected, but it’s possible that I just didn’t use these for long enough to see problems.
  • GNOME and KDE are both affected, though KDE is significantly worse-off.
  • Lag spikes sometimes occur under trivial load (especially on KDE), but are almost guaranteed when the system is under load. However, lag spikes do not appear to be correlated with high CPU or RAM use.
  • The problem persists whether proprietary or open-source NVIDIA drivers are used.
  • The problem persists whether Wayland or X11 is used (only tested under Fedora on KDE).
  • The memtester utility told me that my RAM was okay.
  • smartmontools suggests that my SSD is okay.

Right now, I have Fedora 37 Workstation installed, with the GNOME DE.

Thanks for reading. I’m happy to provide additional logs and information as necessary.

I note that you have the nvidia 1070 GPU and are using the nouveau driver with wayland.

This combination forces the system to use software rendering for any GPU intensive tasks since the nouveau driver seems to not enable any hardware acceleration for graphics.

What this means is that the CPU is forced to do the graphics rendering and both slows down all processes and uses an excessive amount of memory for graphics.

It seems likely that installing the nvidia driver from rpmfusion will both reduce the lagging and freezing and handle the OOM problem as well. The nvidia driver enables hardware acceleration and removes that load from the CPU, freeing up the ram that is used as well.
https://rpmfusion.org/Configuration
https://rpmfusion.org/Howto/NVIDIA

For your system with fedora 37, once the rpmfusion repos are enabled the drivers can be easily installed with sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda which will install and configure the nvidia driver as well as enabling use of cuda with that GPU.

After the install wait about 5 minutes then reboot and the nvidia driver should be active.
It might also be necessary for you to disable secure boot if it is presently active (or sign the driver module if secure boot is needed).

If you run the top command you can see the actual memory and swap usage. Things to rememberis

  • The zram swap file itself uses ram and possible a lot of it. If low on ram you should probably configure a real swap partition or swap file.

  • Every file in /tmp will eat up ram, so big files there would be a problem.

  • Gnome itself needs a lot of ram.

  • The system-oomd may be too aggressive killing stuff. Killing the rpm program could become a real problem with partly installed packages, etc.

Face, meet palm — in all my testing with the proprietary NVIDIA driver across Fedora and Manjaro, I’d neglected to even try installing CUDA.

I’ll continue testing my system to make sure I’m good, but based on the system being usable now, I believe your suggestion has solved the problem.

Many thanks. This was driving me crazy!

1 Like

Thank you for the tips! I have 16 GB of RAM — that’s one reason an OOM event was so unusual to see. I’ll stick with what I have for now, but if I ever get another OOM event, or if I get other slowdowns, I’ll look into adding a swap partition or reconfiguring systemd-oomd like you suggested.

For now, installing CUDA as Jeff V suggested seems to have solved the issue.

1 Like