Whole system freezes when playing Factorio

After checking some of the cases in this forum:

and this post, I can observe that:

  1. It’s a wayland issue.
  2. It happens with applications running on vulkan (or in a layer like proton on vulkan).
  3. It happens both on native and on apps running on proton/wine.
  4. For me, @Steath and @kpgm it has only happen while using mesa’s drivers.
  5. At least on my experience, Running on windowed doesn’t seem to cause the crash, only on fullscreen.

For me, the moments that had lead to a Freezz were always after I alt-tab on fullscreen after playing for a while, examples are:
A. Running a game on proton.
B. Running a Xwayland application like duckstation or ppsspp and booting a game on vulkan render.
C. Running a Native Vulkan Game.

If I run duck or ppsspp on openGL render I never encounter this crash, neither if I play on x11.

inxi -Fxxc0z:

System:
  Kernel: 6.10.10-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
  Desktop: KDE Plasma v: 6.1.5 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Desktop System: Gigabyte product: B450M DS3H v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: B450M DS3H-CF serial: <superuser required>
    UEFI: American Megatrends LLC. v: F67b date: 07/11/2024
CPU:
  Info: 6-core model: AMD Ryzen 5 5600 bits: 64 type: MT MCP arch: Zen 3+
    rev: 2 cache: L1: 384 KiB L2: 3 MiB L3: 32 MiB
  Speed (MHz): avg: 2918 high: 3600 min/max: 2200/4467 boost: enabled cores:
    1: 2876 2: 2879 3: 2879 4: 3562 5: 2918 6: 2200 7: 2200 8: 2878 9: 3247
    10: 3600 11: 2883 12: 2903 bogomips: 84033
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Navi 23 [Radeon RX 6600/6600 XT/6600M] vendor: XFX
    driver: amdgpu v: kernel arch: RDNA-2 pcie: speed: 16 GT/s lanes: 16 ports:
    active: DP-2 empty: DP-1, DP-3, HDMI-A-1, Writeback-1 bus-ID: 09:00.0
    chip-ID: 1002:73ff
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
    compositor: kwin_wayland driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu display-ID: 0
  Monitor-1: DP-2 res: 1920x1080 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast
    gbm: drv: kms_swrast surfaceless: drv: radeonsi wayland: drv: radeonsi x11:
    drv: radeonsi
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.2.2-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 6600 (radeonsi navi23
    LLVM 18.1.8 DRM 3.57 6.10.10-arch1-1) device-ID: 1002:73ff
    display-ID: :1.0
  API: Vulkan v: 1.3.295 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: mesa radv device-ID: 1002:73ff
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
    speed: 16 GT/s lanes: 16 bus-ID: 09:00.1 chip-ID: 1002:ab28
  Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 0b:00.4 chip-ID: 1022:1487
  API: ALSA v: k6.10.10-arch1-1 status: kernel-api
  Server-1: PipeWire v: 1.2.3 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: f000 bus-ID: 05:00.0 chip-ID: 10ec:8168
  IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: ztyqbzb64o state: unknown speed: 10000 Mbps duplex: full
    mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.1
    speed: 12 Mb/s lanes: 1 bus-ID: 1-2:2 chip-ID: 0bda:8771
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.1
    lmp-v: 10
Drives:
  Local Storage: total: 2.26 TiB used: 1.62 TiB (71.7%)
  ID-1: /dev/nvme0n1 vendor: Crucial model: CT1000P3SSD8 size: 931.51 GiB
    speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 35.9 C
  ID-2: /dev/sda vendor: Kingston model: SA400S37480G size: 447.13 GiB
    speed: 6.0 Gb/s serial: <filter>
  ID-3: /dev/sdb vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 914.83 GiB used: 466.64 GiB (51.0%) fs: ext4
    dev: /dev/nvme0n1p2
Swap:
  ID-1: swap-1 type: file size: 512 MiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
Sensors:
  System Temperatures: cpu: 37.0 C mobo: 31.0 C gpu: amdgpu temp: 39.0 C
    mem: 36.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 0
Info:
  Memory: total: 16 GiB available: 15.55 GiB used: 3.57 GiB (23.0%)
  Processes: 314 Power: uptime: 16m wakeups: 0 Init: systemd v: 256
    default: graphical
  Packages: 1347 pm: pacman pkgs: 1327 pm: flatpak pkgs: 20 Compilers:
    clang: 18.1.8 gcc: 14.2.1 Shell: Bash v: 5.2.32 running-in: konsole
    inxi: 3.3.35

/etc/environment:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
#QT_QPA_PLATFORMTHEME=qt5ct
#QT_STYLE_OVERRIDE=kvantum
BROWSER=firefox
EDITOR=nano