操作系统:Ubuntu 22.10 显卡:Nvidia GeForce GTX1060
uname -a
Linux 5.19.0-31-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 20 15:20:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
阅读完所有可能的解决方案后:
我的计算机在挂起后仍能立即唤醒。
我尝试禁用 EHC1、EHC2、XHC,但效果不大,所以我将其保留为启用状态。下面仅显示还有什么可以唤醒我的 PC。
cat /proc/acpi/wakeup INT ✘
Device S-state Status Sysfs node
PEG0 S4 *enabled pci:0000:00:01.0
PEGP S4 *disabled pci:0000:01:00.0
PEG1 S4 *disabled
PEGP S4 *disabled
PEG2 S4 *disabled
PEGP S4 *disabled
PS2K S4 *disabled
PS2M S4 *disabled
RP01 S4 *enabled pci:0000:00:1c.0
PXSX S4 *disabled pci:0000:02:00.0
RP02 S4 *disabled
PXSX S4 *disabled
RP03 S4 *disabled
PXSX S4 *disabled
RP05 S4 *disabled
PXSX S4 *disabled
RP06 S4 *disabled
PXSX S4 *disabled
RP07 S4 *disabled
PXSX S4 *disabled
RP08 S4 *disabled
PXSX S4 *disabled
RP04 S4 *enabled pci:0000:00:1c.3
GLAN S4 *enabled pci:0000:00:19.0
EHC1 S4 *enabled pci:0000:00:1d.0
EHC2 S4 *enabled pci:0000:00:1a.0
XHC S4 *enabled pci:0000:00:14.0
HDEF S4 *disabled pci:0000:00:1b.0
我检查了所有可以唤醒我电脑的 USB 设备,但它们都被禁用了。
cat /sys/bus/usb/devices/usb*/power/wakeup
disabled
disabled
disabled
disabled
我还使用 systemctl 启用了 nvidia-suspend.service、nvidia-resume.service 和 nvidia-hibernate.service,但它在暂停后仍然启动。
我检查了 /var/log/syslog 中的每一行,但找不到触发它的原因。我可以看到计算机进入了睡眠模式。所有 CPU 核心都离线了,突然间,ACPI PM 启动了低级恢复。知道我应该在哪里解决这个问题吗?我没有检查 Fedora 中的系统日志,但在切换到 Ubuntu 之前,同一台机器上也发生了同样的行为。这让我怀疑有一个常见问题,即 Nvidia 显卡驱动程序。任何帮助都非常感谢。
Feb 22 21:12:30 ModemManager[911]: <info> [sleep-monitor-systemd] system is about to suspend
Feb 22 21:12:30 NetworkManager[896]: <info> [1677129150.6844] manager: sleep: sleep requested (sleeping: no enabled: yes)
Feb 22 21:12:30 NetworkManager[896]: <info> [1677129150.6846] device (wlp5s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
Feb 22 21:12:30 google-chrome.desktop[4025]: [4019:4049:0222/211230.686636:ERROR:connection_factory_impl.cc(472)] ConnectionHandler failed with net error: -2
Feb 22 21:12:30 NetworkManager[896]: <info> [1677129150.6924] manager: NetworkManager state is now ASLEEP
Feb 22 21:12:30 wpa_supplicant[897]: wlp5s0: CTRL-EVENT-DSCP-POLICY clear_all
Feb 22 21:12:30 gnome-shell[2219]: Timelines with detached actors are not supported. <unnamed>[<Gjs_ui_panel_QuickSettings>:0x562f87160150] in animation of duration 150ms but not on stage.
Feb 22 21:12:30 wpa_supplicant[897]: wlp5s0: CTRL-EVENT-DSCP-POLICY clear_all
Feb 22 21:12:30 wpa_supplicant[897]: nl80211: deinit ifname=wlp5s0 disabled_11b_rates=0
Feb 22 21:12:33 systemd[1]: Reached target Sleep.
Feb 22 21:12:33 systemd[1]: Starting Record successful boot for GRUB...
Feb 22 21:12:33 systemd[1]: Starting NVIDIA system suspend actions...
Feb 22 21:12:33 suspend: nvidia-suspend.service
Feb 22 21:12:33 logger[5140]: <13>Feb 22 21:12:33 suspend: nvidia-suspend.service
Feb 22 21:12:33 systemd[1]: grub-common.service: Deactivated successfully.
Feb 22 21:12:39 systemd[1]: nvidia-suspend.service: Deactivated successfully.
Feb 22 21:12:39 systemd[1]: Finished NVIDIA system suspend actions.
Feb 22 21:12:39 systemd[1]: Starting System Suspend...
Feb 22 21:12:39 systemd-sleep[5162]: Entering sleep state 'suspend'...
Feb 22 21:12:39 kernel: [ 2783.804635] PM: suspend entry (deep)
Feb 22 21:12:51 kernel: [ 2783.812686] Filesystems sync: 0.008 seconds
Feb 22 21:12:51 kernel: [ 2783.812834] Freezing user space processes ... (elapsed 0.001 seconds) done.
Feb 22 21:12:51 kernel: [ 2783.814707] OOM killer disabled.
Feb 22 21:12:51 kernel: [ 2783.814708] Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
Feb 22 21:12:51 kernel: [ 2783.815648] printk: Suspending console(s) (use no_console_suspend to debug)
Feb 22 21:12:51 kernel: [ 2783.816460] e1000e: EEE TX LPI TIMER: 00000011
Feb 22 21:12:51 kernel: [ 2783.899582] sd 4:0:0:0: [sda] Synchronizing SCSI cache
Feb 22 21:12:51 kernel: [ 2783.899766] sd 4:0:0:0: [sda] Stopping disk
Feb 22 21:12:51 kernel: [ 2784.332643] ACPI: EC: interrupt blocked
Feb 22 21:12:51 kernel: [ 2784.411604] ACPI: PM: Preparing to enter system sleep state S3
Feb 22 21:12:51 kernel: [ 2784.472026] ACPI: EC: event blocked
Feb 22 21:12:51 kernel: [ 2784.472027] ACPI: EC: EC stopped
Feb 22 21:12:51 kernel: [ 2784.472028] ACPI: PM: Saving platform NVS memory
Feb 22 21:12:51 kernel: [ 2784.472104] Disabling non-boot CPUs ...
Feb 22 21:12:51 kernel: [ 2784.473541] smpboot: CPU 1 is now offline
Feb 22 21:12:51 kernel: [ 2784.475271] smpboot: CPU 2 is now offline
Feb 22 21:12:51 kernel: [ 2784.476872] smpboot: CPU 3 is now offline
Feb 22 21:12:51 kernel: [ 2784.478743] smpboot: CPU 4 is now offline
Feb 22 21:12:51 kernel: [ 2784.480462] smpboot: CPU 5 is now offline
Feb 22 21:12:51 kernel: [ 2784.481951] smpboot: CPU 6 is now offline
Feb 22 21:12:51 kernel: [ 2784.483436] smpboot: CPU 7 is now offline
Feb 22 21:12:51 kernel: [ 2784.485913] ACPI: PM: Low-level resume complete
Feb 22 21:12:51 kernel: [ 2784.485930] ACPI: EC: EC started
Feb 22 21:12:51 kernel: [ 2784.485931] ACPI: PM: Restoring platform NVS memory
Feb 22 21:12:51 kernel: [ 2784.486265] Enabling non-boot CPUs ...
Feb 22 21:12:51 kernel: [ 2784.486304] x86: Booting SMP configuration:
Feb 22 21:12:51 kernel: [ 2784.486305] smpboot: Booting Node 0 Processor 1 APIC 0x2
Feb 22 21:12:51 kernel: [ 2784.490345] CPU1 is up
Feb 22 21:12:51 kernel: [ 2784.494432] smpboot: Booting Node 0 Processor 2 APIC 0x4
Feb 22 21:12:51 kernel: [ 2784.496254] CPU2 is up
...
...
...
Feb 22 21:12:51 systemd-resolved[792]: Clock change detected. Flushing caches.
Feb 22 21:12:51 systemd[1]: fwupd-refresh.service: Deactivated successfully.
Feb 22 21:12:51 systemd[1]: Finished Refresh fwupd metadata and update motd.
Feb 22 21:12:51 systemd-sleep[5162]: System returned from sleep state.
Feb 22 21:12:51 bluetoothd[832]: Controller resume with wake event 0x0
Feb 22 21:12:51 kernel: [ 2790.922660] PM: suspend exit
Feb 22 21:12:51 systemd-sleep[5306]: /dev/sda:
Feb 22 21:12:51 systemd-sleep[5306]: setting Advanced Power Management level to 0xfe (254)
Feb 22 21:12:51 systemd-sleep[5306]: APM_level#011= 254
Feb 22 21:13:17 kernel: [ 2816.299694] watchdog: BUG: soft lockup - CPU#6 stuck for 26s! [nvidia-sleep.sh:5286]
答案1
我很久以前就遇到过类似的问题。显然,我的配置文件存在冲突。
执行时:
dpkg -l | grep -i nvidia
rc
我可以看到第一列中标有我未使用的软件包列表。
使用以下命令删除它们后,计算机开始正确挂起:
sudo apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')
我希望它有帮助。