我最近在电脑上安装了 Ubuntu 22.04.2,系统挂起似乎不起作用。我一直在论坛上寻找答案,因为这似乎是一个常见问题,但我找不到与任何解决方案相匹配的明显问题。
具体来说,在运行时systemctl suspend
,系统似乎正确进入睡眠状态,但随后立即唤醒。查看日志时dmesg
,没有明显的错误,systemctl status suspend.target
似乎证实了这一点:
○ suspend.target - Suspend
Loaded: loaded (/lib/systemd/system/suspend.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
May 17 09:42:37 systemd[1]: Reached target Suspend.
May 17 09:42:37 systemd[1]: Stopped target Suspend.
以下是dmesg
after的输出systemctl suspend
:
[ 4077.436687] PM: suspend entry (deep)
[ 4077.446548] Filesystems sync: 0.009 seconds
[ 4077.572957] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 4077.574776] OOM killer disabled.
[ 4077.574777] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 4077.575932] printk: Suspending console(s) (use no_console_suspend to debug)
[ 4077.576759] serial 00:04: disabled
[ 4077.576851] r8169 0000:05:00.0 enp5s0: Link is Down
[ 4077.712510] [drm] free PSP TMR buffer
[ 4077.822253] amdgpu 0000:08:00.0: amdgpu: MODE1 reset
[ 4077.822257] amdgpu 0000:08:00.0: amdgpu: GPU mode1 reset
[ 4077.822403] amdgpu 0000:08:00.0: amdgpu: GPU smu mode1 reset
[ 4078.418257] ACPI: PM: Preparing to enter system sleep state S3
[ 4078.754702] ACPI: PM: Saving platform NVS memory
[ 4078.754804] Disabling non-boot CPUs ...
[ 4078.756772] smpboot: CPU 1 is now offline
[ 4078.759487] smpboot: CPU 2 is now offline
[ 4078.762431] smpboot: CPU 3 is now offline
[ 4078.764663] smpboot: CPU 4 is now offline
[ 4078.766895] smpboot: CPU 5 is now offline
[ 4078.769094] smpboot: CPU 6 is now offline
[ 4078.769686] Spectre V2 : Update user space SMT mitigation: STIBP off
[ 4078.771213] smpboot: CPU 7 is now offline
[ 4078.773289] smpboot: CPU 8 is now offline
[ 4078.775313] smpboot: CPU 9 is now offline
[ 4078.777171] smpboot: CPU 10 is now offline
[ 4078.779119] smpboot: CPU 11 is now offline
[ 4078.779899] ACPI: PM: Low-level resume complete
[ 4078.779921] ACPI: PM: Restoring platform NVS memory
[ 4078.780115] LVT offset 0 assigned for vector 0x400
[ 4078.780680] Enabling non-boot CPUs ...
[ 4078.780716] x86: Booting SMP configuration:
[ 4078.780716] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 4078.780826] microcode: CPU1: patch_level=0x0a20120a
[ 4078.783530] ACPI: \_SB_.PLTF.C002: Found 2 idle states
[ 4078.786823] CPU1 is up
[ 4078.786840] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 4078.786968] microcode: CPU2: patch_level=0x0a20120a
[ 4078.789112] ACPI: \_SB_.PLTF.C004: Found 2 idle states
[ 4078.790796] CPU2 is up
[ 4078.790814] smpboot: Booting Node 0 Processor 3 APIC 0x6
[ 4078.790909] microcode: CPU3: patch_level=0x0a20120a
[ 4078.793061] ACPI: \_SB_.PLTF.C006: Found 2 idle states
[ 4078.794806] CPU3 is up
[ 4078.794822] smpboot: Booting Node 0 Processor 4 APIC 0x8
[ 4078.794917] microcode: CPU4: patch_level=0x0a20120a
[ 4078.797071] ACPI: \_SB_.PLTF.C008: Found 2 idle states
[ 4078.798875] CPU4 is up
[ 4078.798890] smpboot: Booting Node 0 Processor 5 APIC 0xa
[ 4078.799007] microcode: CPU5: patch_level=0x0a20120a
[ 4078.801163] ACPI: \_SB_.PLTF.C00A: Found 2 idle states
[ 4078.802851] CPU5 is up
[ 4078.802866] smpboot: Booting Node 0 Processor 6 APIC 0x1
[ 4078.802994] microcode: CPU6: patch_level=0x0a20120a
[ 4078.805156] ACPI: \_SB_.PLTF.C001: Found 2 idle states
[ 4078.806904] Spectre V2 : Update user space SMT mitigation: STIBP always-on
[ 4078.806918] CPU6 is up
[ 4078.806940] smpboot: Booting Node 0 Processor 7 APIC 0x3
[ 4078.807039] microcode: CPU7: patch_level=0x0a20120a
[ 4078.809200] ACPI: \_SB_.PLTF.C003: Found 2 idle states
[ 4078.810937] CPU7 is up
[ 4078.810953] smpboot: Booting Node 0 Processor 8 APIC 0x5
[ 4078.811070] microcode: CPU8: patch_level=0x0a20120a
[ 4078.813227] ACPI: \_SB_.PLTF.C005: Found 2 idle states
[ 4078.814946] CPU8 is up
[ 4078.814961] smpboot: Booting Node 0 Processor 9 APIC 0x7
[ 4078.815062] microcode: CPU9: patch_level=0x0a20120a
[ 4078.817220] ACPI: \_SB_.PLTF.C007: Found 2 idle states
[ 4078.818977] CPU9 is up
[ 4078.818992] smpboot: Booting Node 0 Processor 10 APIC 0x9
[ 4078.819095] microcode: CPU10: patch_level=0x0a20120a
[ 4078.821252] ACPI: \_SB_.PLTF.C009: Found 2 idle states
[ 4078.823000] CPU10 is up
[ 4078.823016] smpboot: Booting Node 0 Processor 11 APIC 0xb
[ 4078.823140] microcode: CPU11: patch_level=0x0a20120a
[ 4078.825297] ACPI: \_SB_.PLTF.C00B: Found 2 idle states
[ 4078.827033] CPU11 is up
[ 4078.827967] ACPI: PM: Waking up from system sleep state S3
[ 4078.840112] xhci_hcd 0000:02:00.0: xHC error in resume, USBSTS 0x401, Reinit
[ 4078.840115] usb usb1: root hub lost power or was reset
[ 4078.840116] usb usb2: root hub lost power or was reset
[ 4078.840693] [drm] PCIE GART of 512M enabled (table at 0x0000008000300000).
[ 4078.840728] [drm] PSP is resuming...
[ 4078.840779] serial 00:04: activated
[ 4078.897675] nvme nvme0: Shutdown timeout set to 10 seconds
[ 4078.899643] nvme nvme0: 32/0/0 default/read/poll queues
[ 4078.923848] [drm] reserve 0xa00000 from 0x81fe200000 for PSP TMR
[ 4079.014729] r8169 0000:05:00.0 enp5s0: Link is Down
[ 4079.019015] amdgpu 0000:08:00.0: amdgpu: RAS: optional ras ta ucode is not available
[ 4079.036388] amdgpu 0000:08:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
[ 4079.036390] amdgpu 0000:08:00.0: amdgpu: SMU is resuming...
[ 4079.036392] amdgpu 0000:08:00.0: amdgpu: smu driver if version = 0x0000000f, smu fw if version = 0x00000013, smu fw program = 0, version = 0x003b2900 (59.41.0)
[ 4079.036395] amdgpu 0000:08:00.0: amdgpu: SMU driver if version not matched
[ 4079.036443] amdgpu 0000:08:00.0: amdgpu: use vbios provided pptable
[ 4079.090189] amdgpu 0000:08:00.0: amdgpu: SMU is resumed successfully!
[ 4079.091461] [drm] DMUB hardware initialized: version=0x02020013
[ 4079.153056] ata1: SATA link down (SStatus 0 SControl 330)
[ 4079.153077] ata4: SATA link down (SStatus 0 SControl 300)
[ 4079.153131] ata6: SATA link down (SStatus 0 SControl 330)
[ 4079.156814] ata2: SATA link down (SStatus 0 SControl 330)
[ 4079.258843] usb 1-1: reset full-speed USB device number 2 using xhci_hcd
[ 4079.291036] [drm] kiq ring mec 2 pipe 1 q 0
[ 4079.295257] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 4079.295626] [drm] JPEG decode initialized successfully.
[ 4079.295644] amdgpu 0000:08:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[ 4079.295645] amdgpu 0000:08:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[ 4079.295645] amdgpu 0000:08:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[ 4079.295646] amdgpu 0000:08:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
[ 4079.295646] amdgpu 0000:08:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
[ 4079.295647] amdgpu 0000:08:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
[ 4079.295647] amdgpu 0000:08:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
[ 4079.295647] amdgpu 0000:08:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
[ 4079.295648] amdgpu 0000:08:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
[ 4079.295648] amdgpu 0000:08:00.0: amdgpu: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
[ 4079.295649] amdgpu 0000:08:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
[ 4079.295649] amdgpu 0000:08:00.0: amdgpu: ring sdma1 uses VM inv eng 13 on hub 0
[ 4079.295650] amdgpu 0000:08:00.0: amdgpu: ring vcn_dec_0 uses VM inv eng 0 on hub 1
[ 4079.295650] amdgpu 0000:08:00.0: amdgpu: ring vcn_enc_0.0 uses VM inv eng 1 on hub 1
[ 4079.295651] amdgpu 0000:08:00.0: amdgpu: ring vcn_enc_0.1 uses VM inv eng 4 on hub 1
[ 4079.295651] amdgpu 0000:08:00.0: amdgpu: ring jpeg_dec uses VM inv eng 5 on hub 1
我检查了所有我知道的显而易见的东西,我的内存swap
比 RAM 多,我的 BIOS 设置在电源管理方面没有任何明确阻止睡眠/挂起的内容,我正在使用 Ubuntu 打包的 AMD 驱动程序,没有任何外围设备的专有驱动程序。
这是一台定制 PC:32 GB RAM(34 GB 交换)、AMD Radeon RX6600、AMD® Ryzen 5 5600X、Gigabyte B550M 主板。
答案1
重新安装后,通过谷歌搜索修复方法,发现此问题在本轮直播中提出。
这很可能是“技嘉 B550 系列主板在 Linux 上无法退出挂起状态” GPP0/GPP8 错误,似乎发生在 NVME SSD 上。我无法诊断,每个错误都变成了一个干扰,直到有人看到我的日志,并且之前已经见过它。我无法退出挂起状态,只能通过掷骰子并在内存失去电量(或任何过程)之前关闭和打开后开关来唤醒。
来自 Reddit 帖子https://www.reddit.com/r/archlinux/comments/11urtla/comment/jg46a0p:
GPP 桥接器是导致此问题的原因,可能是安装了 nvme ssd 时导致的。禁用桥接器的唤醒功能可解决此问题。
https://bbs.archlinux.org/viewtopic.php?id=284401是初步的解决方案,
$ sudo sh -c "echo GPP0 > /proc/acpi/wakeup"
$ sudo sh -c "echo GPP8 > /proc/acpi/wakeup"
https://www.reddit.com/r/archlinux/comments/11urtla/comment/jg46a0p添加一个 systemd 服务,该服务每次启动时都会更改它:
创建一个 systemd 服务在每次启动时执行此操作也是有意义的。创建一个名为 /etc/systemd/system/sleep-workaround.service 的文件,内容如下:
[Unit]
Description=Workaround for Gigabyte B550 AC bios sleep bug
[Service]
ExecStart=/bin/sh -c "echo GPP0 > /proc/acpi/wakeup && echo GPP8 > /proc/acpi/wakeup"
[Install]
WantedBy = multi-user.target
然后使用 [sudo systemctl daemon-reload 和] sudo systemctl enable sleep-workaround 启用该服务。我希望这些信息最终能对某些人有所帮助。
即使已经闲置了 6 个月,也要在这里发布,希望它能引起人们的关注。如果你不知道自己在寻找什么,那么调试起来就很困难。
由于这里未启用 DM,有评论声誉的人能否回复上面的帖子并提醒 @scrollout?他们的问题已被关闭,但这是同一个问题。