Wake up issues from S0ix and S3 (black screen after resume)

Hello,

I have a particular laptop (84dd524) with a DGPU (1650 GTX).

I switched from Gentoo few days ago, resuming from S3/S0ix was working fine before I switched to CachyOS.

Here’s what I can report:

I had the same issue on Gentoo when I wanted to get rid of the ‘X’ program being ran on my DGPU, I noticed it with nvidia-smi, nothing was running in the DE except this one program, even on Wayland, so I wanted to remove it because it prevented me to unload the NVIDIA driver at runtime.

By digging a bit more, I noticed there was a particular X rule that started it:
/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

But when I removed it, I had the same exact issue: resuming from S3/S0ix didn’t work anymore and I’m not sure exactly why (yet?).

From what I can think of, it is highly related to a config in the user space driver that allows that program to be ran and is probably managing the DGPU, especially during sleep or somehow keep it activated in order to make it not fallen off the PCI bus. (I say this because I also noticed my that my wifi card also disappear if I don’t turn off the laptop and unplug power supply after it resumes, behind the scenes it’s probably a firmware issue but since I didn’t get that issue on Gentoo, I’m not sure what CachyOS is doing different)

Unfortunately, when I tried to compare both of the files on my Gentoo installation and nothing much is different except these 3 rules that is present on CachyOS:

Option "AllowEmptyInitialConfiguration"
ModulePath "/usr/lib/nvidia/xorg"
ModulePath "/usr/lib/xorg/modules"

I’m not sure it is related to it, but if you have any other ideas or what can cause such bugs, please let me know.

Thanks.

Best regards,
xutaxkamay.

What is the exact process that’s running? Is it just xorg?

Exactly, it seems to be something like this on Gentoo:

As root:

/usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_XSnejH -noreset -displayfd 16

I noticed also two more things:

  1. nvidia-smi is not being launched at boot when sddm starts with these commands, while on Gentoo it is launched, is this program maybe the one responsible for starting the X command ? (user kamay, which is myself)
/usr/bin/nvidia-smi dmon -d 2 -s pucm
  1. On CachyOS, there is an “unknown” display that shouldn’t be present at all…

Weird.

Is SDDM running using the Wayland backend? If not, please try to do so.

Oh right.

Ran Gentoo with editing /etc/sddm.conf.d/override.conf

[General]
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell
 
[Wayland]
CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1

Resume works normally on Gentoo without issues, but the X program is also gone, so you were correct assuming SDDM was still running under xorg I didn’t even realize it, thank you a lot.

I also tried it on CachyOS but the same issue occurs with a black screen.

After some tests though, I realized that I can switch to a tty on S3 (sleep to ram) easily and restart SDDM as a workaround for now. (on S0ix I can’t resume at all, the system or some firmware seem to crash but I don’t really care of it for now since it doesn’t work either on Gentoo anymore for some reasons, this is probably a firmware issue not the fault of CachyOS that I need to figure out myself later since I use a coreboot laptop)

It may be related to that “unknown” screen ?

I tried to create a new user if it was just some misconfiguration but it gets always detected for some reasons. I think the blackscreen from SDDM comes from there, it probably tries to switch to that screen, but since there’s no output, it can not.

I tried to switch from keyboard the screen (with the fn key) just in case but nothing worked to make the screen appear.

I must also say that when resuming, the screen brightness is completely gone aswell, except when I switch to a tty and screen brightness comes back and turn black again switch again to SDDM. (ctrl + alt + f3)

I also noticed that when I switch to a tty, SDDM appears for some milliseconds and then the tty appears. (weird)

That’s unfortunate.

Yeah, if you can find the differences between your Gentoo setup and CachyOS setup, we might know a bit more in what’s the problem or how to solve this.

I’ll try some things today to try to get S3 working on CachyOS, I’ll let you know. I feel like this is probably a misconfiguration somewhere or some bad default config somewhere (especially the duplicated screen, this one is really weird).

Thanks for the help.

One year later.. It seems like I have a lead, the problem seems to come from coreboot that fails to generate the correct ACPI tables:

When S3 works:

[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000000fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000001000-0x000000000009ffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000074565fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000074566000-0x00000000746b2fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000746b3000-0x000000007527afff] usable
[    0.000000] BIOS-e820: [mem 0x000000007527b000-0x000000007527dfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000007527e000-0x000000007528dfff] usable
[    0.000000] BIOS-e820: [mem 0x000000007528e000-0x0000000075298fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075299000-0x000000007529afff] usable
[    0.000000] BIOS-e820: [mem 0x000000007529b000-0x000000007529bfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000007529c000-0x000000007529dfff] usable
[    0.000000] BIOS-e820: [mem 0x000000007529e000-0x00000000752a9fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000752aa000-0x00000000752acfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000752ad000-0x00000000752adfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000752ae000-0x0000000075446fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075447000-0x0000000075494fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075495000-0x0000000075581fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075582000-0x0000000075582fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075583000-0x000000007567efff] usable
[    0.000000] BIOS-e820: [mem 0x000000007567f000-0x0000000075686fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x0000000075687000-0x00000000756a3fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000756a4000-0x00000000756b3fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000756b4000-0x00000000756fbfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000756fc000-0x00000000756fcfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000756fd000-0x000000007575efff] usable
[    0.000000] BIOS-e820: [mem 0x000000007575f000-0x0000000075762fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075763000-0x0000000075763fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075764000-0x0000000075766fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075767000-0x000000007576afff] usable
[    0.000000] BIOS-e820: [mem 0x000000007576b000-0x000000007576efff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000007576f000-0x0000000075775fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075776000-0x0000000075783fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075784000-0x0000000075792fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075793000-0x000000007579cfff] reserved
[    0.000000] BIOS-e820: [mem 0x000000007579d000-0x00000000759bbfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000759bc000-0x00000000759bdfff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000759be000-0x00000000759d8fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000759d9000-0x00000000759f1fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000759f2000-0x0000000075e03fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075e04000-0x0000000075e34fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075e35000-0x0000000075e4bfff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075e4c000-0x0000000075e4efff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075e4f000-0x0000000075f24fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075f25000-0x0000000075f28fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075f29000-0x00000000764adfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000764ae000-0x00000000765f1fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000765f2000-0x00000000765f5fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000765f6000-0x00000000765fdfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000765fe000-0x00000000768f0fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000768f1000-0x00000000803fffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ff520000-0x00000000ff59ffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000087fbfffff] usable

[    0.016405] ACPI: Early table checksum verification disabled
[    0.016409] ACPI: RSDP 0x00000000765FD014 000024 (v02 COREv4)
[    0.016413] ACPI: XSDT 0x00000000765FC0E8 00007C (v01 COREv4 COREBOOT 00000000      01000013)
[    0.016421] ACPI: FACP 0x000000007576E000 000114 (v06 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016427] ACPI: DSDT 0x00000000765F6000 00565C (v02 COREv4 COREBOOT 20110725 INTL 20230628)
[    0.016431] ACPI: FACS 0x00000000765F5000 000040
[    0.016434] ACPI: FACS 0x00000000765F5000 000040
[    0.016437] ACPI: SSDT 0x000000007575F000 003DDA (v02 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016441] ACPI: MCFG 0x000000007576D000 00003C (v01 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016444] ACPI: LPIT 0x000000007576C000 000094 (v00 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016448] ACPI: APIC 0x000000007576B000 000092 (v03 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016452] ACPI: DMAR 0x0000000075766000 0000A0 (v01 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016455] ACPI: DBG2 0x0000000075765000 000061 (v00 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016458] ACPI: HPET 0x0000000075764000 000038 (v01 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016462] ACPI: TPM2 0x00000000756FC000 00004C (v04 INTEL  EDK2     00000002      01000013)
[    0.016465] ACPI: FPDT 0x0000000075582000 000034 (v01 INTEL  EDK2     00000002      01000013)
[    0.016469] ACPI: BGRT 0x00000000752AE000 000038 (v01 INTEL  EDK2     00000002      01000013)
[    0.016471] ACPI: Reserving FACP table memory at [mem 0x7576e000-0x7576e113]
[    0.016472] ACPI: Reserving DSDT table memory at [mem 0x765f6000-0x765fb65b]
[    0.016473] ACPI: Reserving FACS table memory at [mem 0x765f5000-0x765f503f]
[    0.016474] ACPI: Reserving FACS table memory at [mem 0x765f5000-0x765f503f]
[    0.016475] ACPI: Reserving SSDT table memory at [mem 0x7575f000-0x75762dd9]
[    0.016476] ACPI: Reserving MCFG table memory at [mem 0x7576d000-0x7576d03b]
[    0.016476] ACPI: Reserving LPIT table memory at [mem 0x7576c000-0x7576c093]
[    0.016477] ACPI: Reserving APIC table memory at [mem 0x7576b000-0x7576b091]
[    0.016478] ACPI: Reserving DMAR table memory at [mem 0x75766000-0x7576609f]
[    0.016479] ACPI: Reserving DBG2 table memory at [mem 0x75765000-0x75765060]
[    0.016479] ACPI: Reserving HPET table memory at [mem 0x75764000-0x75764037]
[    0.016480] ACPI: Reserving TPM2 table memory at [mem 0x756fc000-0x756fc04b]
[    0.016481] ACPI: Reserving FPDT table memory at [mem 0x75582000-0x75582033]
[    0.016481] ACPI: Reserving BGRT table memory at [mem 0x752ae000-0x752ae037]

When S3 doesn’t work:

[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000000fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000001000-0x000000000009ffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000074565fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000074566000-0x00000000746b2fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000746b3000-0x000000007527afff] usable
[    0.000000] BIOS-e820: [mem 0x000000007527b000-0x000000007527dfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000007527e000-0x000000007528dfff] usable
[    0.000000] BIOS-e820: [mem 0x000000007528e000-0x0000000075298fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075299000-0x000000007529afff] usable
[    0.000000] BIOS-e820: [mem 0x000000007529b000-0x000000007529bfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000007529c000-0x000000007529dfff] usable
[    0.000000] BIOS-e820: [mem 0x000000007529e000-0x00000000752a9fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000752aa000-0x00000000752acfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000752ad000-0x00000000752adfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000752ae000-0x0000000075446fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075447000-0x0000000075494fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075495000-0x0000000075581fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075582000-0x0000000075582fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075583000-0x000000007567efff] usable
[    0.000000] BIOS-e820: [mem 0x000000007567f000-0x0000000075686fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x0000000075687000-0x00000000756a3fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000756a4000-0x00000000756b3fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000756b4000-0x00000000756fbfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000756fc000-0x00000000756fcfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000756fd000-0x000000007575efff] usable
[    0.000000] BIOS-e820: [mem 0x000000007575f000-0x0000000075762fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075763000-0x0000000075763fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075764000-0x0000000075766fff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000075767000-0x000000007576afff] usable
[    0.000000] BIOS-e820: [mem 0x000000007576b000-0x000000007576efff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000007576f000-0x0000000075775fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075776000-0x0000000075783fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075784000-0x0000000075792fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075793000-0x000000007579cfff] reserved
[    0.000000] BIOS-e820: [mem 0x000000007579d000-0x00000000759bbfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000759bc000-0x00000000759bdfff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000759be000-0x00000000759d8fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000759d9000-0x00000000759f1fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000759f2000-0x0000000075e03fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075e04000-0x0000000075e34fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075e35000-0x0000000075e4bfff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075e4c000-0x0000000075e4efff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075e4f000-0x0000000075f24fff] usable
[    0.000000] BIOS-e820: [mem 0x0000000075f25000-0x0000000075f28fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000075f29000-0x00000000764adfff] usable
[    0.000000] BIOS-e820: [mem 0x00000000764ae000-0x00000000765f1fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000765f2000-0x00000000765f5fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000765f6000-0x00000000765fdfff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000765fe000-0x00000000768f0fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000768f1000-0x00000000803fffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ff520000-0x00000000ff59ffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000087fbfffff] usable

...

[    0.016567] ACPI: Early table checksum verification disabled
[    0.016571] ACPI: RSDP 0x00000000765FD014 000024 (v02 COREv4)
[    0.016575] ACPI: XSDT 0x00000000765FC0E8 00007C (v01 COREv4 COREBOOT 00000000      01000013)
[    0.016582] ACPI: FACP 0x000000007576E000 000114 (v06 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016589] ACPI: DSDT 0x00000000765F6000 00565C (v02 COREv4 COREBOOT 20110725 INTL 20230628)
[    0.016592] ACPI: FACS 0x00000000765F5000 000040
[    0.016595] ACPI: FACS 0x00000000765F5000 000040
[    0.016598] ACPI: SSDT 0x000000007575F000 003DDA (v02 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016602] ACPI: MCFG 0x000000007576D000 00003C (v01 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016605] ACPI: LPIT 0x000000007576C000 000094 (v00 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016609] ACPI: APIC 0x000000007576B000 000092 (v03 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016612] ACPI: DMAR 0x0000000075766000 0000A0 (v01 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016616] ACPI: DBG2 0x0000000075765000 000061 (v00 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016619] ACPI: HPET 0x0000000075764000 000038 (v01 COREv4 COREBOOT 00000000 CORE 20230628)
[    0.016623] ACPI: TPM2 0x00000000756FC000 00004C (v04 INTEL  EDK2     00000002      01000013)
[    0.016626] ACPI: FPDT 0x0000000075582000 000034 (v01 INTEL  EDK2     00000002      01000013)
[    0.016630] ACPI: BGRT 0x00000000752DB000 000038 (v01 INTEL  EDK2     00000002      01000013)
[    0.016632] ACPI: Reserving FACP table memory at [mem 0x7576e000-0x7576e113]
[    0.016634] ACPI: Reserving DSDT table memory at [mem 0x765f6000-0x765fb65b]
[    0.016634] ACPI: Reserving FACS table memory at [mem 0x765f5000-0x765f503f]
[    0.016635] ACPI: Reserving FACS table memory at [mem 0x765f5000-0x765f503f]
[    0.016636] ACPI: Reserving SSDT table memory at [mem 0x7575f000-0x75762dd9]
[    0.016637] ACPI: Reserving MCFG table memory at [mem 0x7576d000-0x7576d03b]
[    0.016638] ACPI: Reserving LPIT table memory at [mem 0x7576c000-0x7576c093]
[    0.016638] ACPI: Reserving APIC table memory at [mem 0x7576b000-0x7576b091]
[    0.016639] ACPI: Reserving DMAR table memory at [mem 0x75766000-0x7576609f]
[    0.016640] ACPI: Reserving DBG2 table memory at [mem 0x75765000-0x75765060]
[    0.016641] ACPI: Reserving HPET table memory at [mem 0x75764000-0x75764037]
[    0.016641] ACPI: Reserving TPM2 table memory at [mem 0x756fc000-0x756fc04b]
[    0.016642] ACPI: Reserving FPDT table memory at [mem 0x75582000-0x75582033]
[    0.016643] ACPI: Reserving BGRT table memory at [mem 0x752db000-0x752db037]

It’s a weird issue because it only works when I load another bootloader that is large enough (like around 100mb) and it seems like coreboot regenerates the acpi tables that avoids somehow being them corrupted (BGRT perhaps?)

The reassuring thing is that it isn’t related to CachyOS which is great.

EDIT:

Okay something I can finally reproduce clearly, S3 sleep crashes at resume when a USB-C device isn’t plugged into the USB-C port (thunderbolt ?), when it is plugged, it works, I can remove it fine after the laptop sleeps, but if I remove it while linux is running and I make it sleep, the system crashes at resume (I repeat it but it’s a NV4x TGL with nvidia DGPU, this happens on both dgpu being disabled/enabled btw)

It works on my other installation of Gentoo, but not live gui, probably due to some useflags or settings related to thunderbolt being different