Games freeze after a few minutes of playing (in menu or while playing) on Steam with PRIME offloading and X server 21.1.4-1

When I start some specific games (I will provide a list below) using Steam, the game freezes, the system becomes unresponsive (I can’t modify the sound/brightess and I can’t go to a virtual console using Ctrl-Alt-Fn2). The system keeps playing the last sound that was played in a loop. So if this was a complete song, it keeps playing that song, and if it was just a sound effect, it continues playing it as well (the loop length doesn’t matter, it plays it anyways).
I use PRIME offloading (prime-run on a laptop with 2 GPUs) and run the games using Steam. The games with which I could reproduce this bug require using Proton to be able to be played on Linux, but the issue seems to reproduce on any Proton version including Experimental.
The system is Arch Linux on linux-lts with nvidia-lts drivers (versions should be provided in the bug report).
The issue could be related somehow to Vulkan, as some of the games that are crushing are based on Vulkan.
I cannot run the report when I get the issue, due to system being unresponsive, so the report was taken when the game is started, but not have crushed yet.
The issue does not reproduce on multiple other games with similar characteristics and configuration, including:

  • having a big load of graphic card and memory (NieR Automata, Satisfactory)
  • having the same Unity engine (Valheim)
  • using different versions of Proton (multiple options)
  • using Vulkan (Valheim, Factorio)

The games on which the issue could be reproduced:

  • Dyson Sphere Program
  • Hollow Knight
  • Age of Empires III

Bug report:
nvidia-bug-report.log.gz (329.4 KB)
OS: Arch Linux
CPU: 11th Gen Intel Core i7-11800H
GPU: NVIDIA GeForce RTX 3070 Laptop GPU
Kernel: x86_64 Linux 5.15.77-1-lts
DE: KDE 5.99.0 / Plasma 5.26.3
WM: KWin

I will gladly provide any additional information that I have missed in this bug report, thank you for helping in advance.