铬和基于电子的应用程序的随机冻结

铬和基于电子的应用程序的随机冻结

我正在使用 Arch Linux 和 Cinnamon 桌面环境。在过去的几周里,我明显遇到了随机、短暂的冻结(几秒钟,5-10 左右),勇敢的,弗兰兹松弛。冻结是独立的,例如,我可以有一个冻结的 Chromium,而 Brave 工作正常并且反之亦然

我认为所有这些工具都是相关的,因为它们都以某种方式使用 Chromium 代码,要么像 Chromium 本身和 Brave 那样直接使用,要么通过电子就像 Slack 和 Franz 的情况一样,所以我猜测问题与此有关。

当发生冻结时,冻结的应用程序没有响应,甚至调整窗口大小也不起作用(看起来已损坏):

显示窗口大小调整失败的屏幕截图

其他一切都工作正常,但是,我可以打开新终端,正常与其他应用程序交互,桌面响应灵敏,CPU 或 RAM 使用率没有峰值。无非是那些工具而已。

启动所有四个工具时,终端中会显示一些与 GPU 相关的消息:

  • $ chromium 
    [58330:58330:0822/140928.777356:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [58383:58383:0822/140928.908932:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [58438:58438:0822/140928.917645:ERROR:angle_platform_impl.cc(43)] Display.cpp:992 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1317.
    [58438:58438:0822/140928.917713:ERROR:gl_surface_egl.cc(831)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1317.
    [58438:58438:0822/140928.917732:ERROR:gl_surface_egl.cc(1353)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
    [58438:58438:0822/140928.917751:ERROR:gl_ozone_egl.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
    [58438:58438:0822/140928.919686:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [58470:58470:0822/140928.943148:ERROR:gpu_init.cc(486)] Passthrough is not supported, GL is disabled, ANGLE is 
    
  • 勇敢的

    $ brave 
    [42382:42382:0822/135725.937415:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [42441:42441:0822/135726.073407:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [42530:42530:0822/135726.271483:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [42643:42643:0822/135726.363020:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [42763:42763:0822/135726.440747:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [42789:42789:0822/135726.566024:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [42493:7:0822/135726.634474:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
    
    
  • 弗兰兹

    $ franz
    [56942:0822/140812.860154:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
    [56982:0822/140812.959086:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
    [57029:0822/140812.990586:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
    
  • 松弛。这个非常冗长,但它也输出与上述所有相同的 GPU 进程错误:

    $ slack 
    Initializing local storage instance
    (electron) Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support.
    [56298:0822/140741.539635:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
    [08/22/22, 14:07:41:619] info: 
    
    [ many, many more lines of normal looking output here 
    

此 GPU 消息似乎特别相关:

[56298:0822/140741.539635:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization

但是,这些消息都不会触发冻结。当我启动程序时会显示它们,但程序仍然运行正常并且有响应。

Chromium 和 Brave 都在其设置中启用了硬件加速,但 Brave 的chromium://gpu页面表明它失败了(见下文)。有趣的是,这两个浏览器的图形功能状态部分有所不同chrome://gpu(使用屏幕截图,因为颜色有助于易读;您可以找到完整的chrome://gpu输出这里(铬)在这里(勇敢的)

  1. 勇敢的

Brave 图形功能状态部分的屏幕截图

Chromium 图形功能状态部分的屏幕截图

我在全新的 Lenovo ThinkPad P14s 上使用 Xorg,而不是 Wayland,这是我的系统:

$ inxi
CPU: quad core 11th Gen Intel Core i7-1165G7 (-MT MCP-)
speed/min/max: 2385/400/4700 MHz Kernel: 5.19.2-arch1-1 x86_64 Up: 35m
Mem: 6423.7/31799.3 MiB (20.2%) Storage: 953.87 GiB (27.8% used) Procs: 336
Shell: Bash inxi: 3.3.20

图形:

$ inxi -G
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel
  Device-2: NVIDIA TU117GLM [Quadro T500 Mobile] driver: nvidia
    v: 515.65.01
  Device-3: Chicony Integrated Camera type: USB driver: uvcvideo
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3 driver: X:
    loaded: intel unloaded: modesetting gpu: i915 resolution: 1920x1080~60Hz
  OpenGL: renderer: llvmpipe (LLVM 14.0.6 256 bits) v: 4.5 Mesa 22.1.6

sudo pacman -Suy我定期使用和更新所有软件包trizen -Suy,一切都是最新的。

我怎样才能解决这个问题?

答案1

我建议你从 x11 切换到 wayland 以避免冻结。虽然这个问题似乎是您提到的应用程序特有的,但我过去也遇到过类似的问题,尽管影响了整个桌面,但切换到 Wayland 为我解决了这些问题。

很遗憾,Cinnamon 尚不兼容 Wayland,因此您将需要使用不同的桌面环境。 KDE 是一个不错的选择,它可以轻松安装在 Arch 上。看https://wiki.archlinux.org/title/KDE#安装

相关内容