开机后卡死,文本输入缓慢

开机后卡死,文本输入缓慢

有一段时间,我的 Ubuntu 22.04.4 相当迟缓。
启动并登录后,桌面会冻结 10 - 20 秒;一开始是完全冻结,大约 5 秒后我可以移动光标,但无法与任何东西交互。之后,屏幕短暂地变灰,然后再次出现(我强烈假设 Gnome 正在重新启动)。我注意到一件有趣的事情是,桌面总是在 dock(左侧边栏)初始滑入动画完成之前冻结。

重新出现后,它总体运行正常,除了有些东西很慢/迟缓有时。问题并不一致。系统会慢一分钟或几分钟,然后可能会正常工作一个小时,然后再次变慢。很难准确计时,我也无法触发“缓慢”。
我最注意的是文本输入,尤其是在终端中,它明显延迟,或者有时单个按键,尤其是在开始输入时偶尔会完全错过。这种情况发生在常规终端、标准编辑器以及 PHPstorms 内置终端中。PHPstorm 的代码编辑器部分似乎没有受到影响,或者至少没有那么明显。
我还注意到有时(但比文本输入问题少得多)UI 的某些部分会闪烁。
一个例子是在文本编辑器中:按下回车键时,行会来回闪烁几次(转到下一行并返回当前行,2-3 次)。
另一个例子是突出显示的文本或行保持突出显示一段时间,即使在更改选择或行之后也是如此。输入时,突出显示会出现/消失几次,然后最终消失。

总体而言,这些问题似乎主要与文本输入有关。

这是在做了一段时间后开始的apt full-upgrade。以前,一切都很快,反应灵敏。

信息:
我原本以为我的问题可能类似于从 22.04.2 更新后,Ubuntu 22.04.4 运行非常慢但它们的 CPU 时钟速度似乎较低,而我的似乎不低。我还是在那里添加了所要求的信息,因为我真的不知道从哪里开始。如果有任何必要/有用的其他信息,请在评论中告诉我,我会添加它。

fitzi@Fitzi-PC:~$ lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  20
  On-line CPU(s) list:   0-19
Vendor ID:               GenuineIntel
  Model name:            13th Gen Intel(R) Core(TM) i5-13600K
    CPU family:          6
    Model:               183
    Thread(s) per core:  2
    Core(s) per socket:  14
    Socket(s):           1
    Stepping:            1
    CPU max MHz:         3900,0000
    CPU min MHz:         800,0000
    BogoMIPS:            6988.80
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss h
                         t tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_ts
                         c cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr 
                         pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefe
                         tch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad 
                         fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt x
                         savec xgetbv1 xsaves avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req umip pk
                         u ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr flush
                         _l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   544 KiB (14 instances)
  L1i:                   704 KiB (14 instances)
  L2:                    20 MiB (8 instances)
  L3:                    24 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-19
Vulnerabilities:         
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl and seccomp
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
  Srbds:                 Not affected
  Tsx async abort:       Not affected
fitzi@Fitzi-PC:~$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu10/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu11/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu12/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu13/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu14/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu15/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu16/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu17/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu18/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu19/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu8/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu9/cpufreq/scaling_driver:intel_pstate
fitzi@Fitzi-PC:~$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu11/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu12/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu13/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu14/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu15/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu16/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu17/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu18/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu19/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu8/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu9/cpufreq/scaling_governor:powersave
fitzi@Fitzi-PC:~$ grep . /sys/devices/system/cpu/cpu0/cpufreq/*
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus:0
/sys/devices/system/cpu/cpu0/cpufreq/base_frequency:2600000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:3840915
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency:0
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences:default performance balance_performance balance_power power 
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference:performance
/sys/devices/system/cpu/cpu0/cpufreq/related_cpus:0
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors:performance powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:3009801
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:3800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:800000
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed:<unsupported>
fitzi@Fitzi-PC:~$ grep . /sys/devices/system/cpu/intel_pstate/*
/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost:0
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:21
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/status:active
fitzi@Fitzi-PC:~$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:4472514
/sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq:4507283
/sys/devices/system/cpu/cpu11/cpufreq/scaling_cur_freq:5100000
/sys/devices/system/cpu/cpu12/cpufreq/scaling_cur_freq:3900204
/sys/devices/system/cpu/cpu13/cpufreq/scaling_cur_freq:3913377
/sys/devices/system/cpu/cpu14/cpufreq/scaling_cur_freq:3899037
/sys/devices/system/cpu/cpu15/cpufreq/scaling_cur_freq:3901133
/sys/devices/system/cpu/cpu16/cpufreq/scaling_cur_freq:3899911
/sys/devices/system/cpu/cpu17/cpufreq/scaling_cur_freq:3900428
/sys/devices/system/cpu/cpu18/cpufreq/scaling_cur_freq:3917187
/sys/devices/system/cpu/cpu19/cpufreq/scaling_cur_freq:3903448
/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq:5100000
/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq:3999431
/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq:801095
/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq:4109492
/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq:2509041
/sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq:4227254
/sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq:4820161
/sys/devices/system/cpu/cpu8/cpufreq/scaling_cur_freq:3271716
/sys/devices/system/cpu/cpu9/cpufreq/scaling_cur_freq:5112592

我运行了多次,值似乎跳动得稍微安静了一点。以下是频率的 10 秒 gif。(由于某种原因,我无法直接上传图片)

fitzi@Fitzi-PC:~$ cat /proc/cpuinfo | grep "^[c]pu MHz"
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3167.657
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000
cpu MHz     : 3500.000

观看时watch -n.5 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""速度稳定在 3500,单核偶尔会出现短暂的提升和下降。以下是 10 秒的 gif


到目前为止我尝试过的事情

我试图录制一些故障和闪烁,但有趣的是,录制屏幕似乎可以避免它们。不过这可能只是巧合。我用简易屏幕录像机

/var/log/kern.log发现了很多与 docker 相关的消息。起初我以为它们可能会减慢系统速度,但在停止 docker 后,系统似乎一开始变得更快了。然后我尝试禁用 docker 自动启动并重新启动几次。起初我以为这解决了问题,因为系统正常启动并立即可用。但在 3-4 次重新启动后,问题再次出现,即使 docker 仍然被禁用。我不确定如何处理这些信息。这可能是 docker 出现问题的迹象,还是只是巧合?从那时起,系统每次启动时都会立即冻结。

偶尔/var/log/syslog会出现系统太慢的消息(可能是潜在问题的症状?)

Apr 16 08:24:16 Fitzi-PC /usr/libexec/gdm-x-session[2571]: (EE) client bug: timer event4 debounce short: scheduled expiry is in the past (-20ms), your system is too slow
Apr 16 08:35:10 Fitzi-PC /usr/libexec/gdm-x-session[2571]: (EE) event4  - Logitech M720 Triathlon: client bug: event processing lagging behind by 21ms, your system is too slow
Apr 16 08:36:00 Fitzi-PC /usr/libexec/gdm-x-session[2571]: (EE) event4  - Logitech M720 Triathlon: client bug: event processing lagging behind by 24ms, your system is too slow
Apr 16 08:36:13 Fitzi-PC /usr/libexec/gdm-x-session[2571]: (EE) client bug: timer event4 debounce short: scheduled expiry is in the past (-27ms), your system is too slow

我尝试查看其他一些日志文件一段时间,看看它们是否会被淹没。但我没有注意到任何特别大量的日志消息,以至于导致系统速度如此缓慢。

我检查了 Gaphics 驱动程序。过去,我遇到过使用 Nouveau 驱动程序时 GUI 速度慢的问题。根据lshw -c video所用的驱动程序仍然是 nvdia。我认为这不是问题所在,但我不能完全排除这种可能性。

我正在双重启动这台机器。在 Windows 上没有出现任何问题,所以我很确定这不是硬件故障。


导致此问题的原因是什么?我该如何解决此问题?

相关内容