Cobra MK III
Můj nový počítač
chatGPT - hibernace
2023.04.02 19:38:11 HowTo chatGPT gentoo Gilhad

Viz též

1   chatGPT - Rubber Duck session o problémech s hibernací

Gilhad > hello

chatGPT > Hello! How can I assist you today?

Gilhad >

  • I have installed two Gentoo Linux system on my PC.
  • One is few years old and hibernation works there good, the other in new and actual and hibernation does not work.
  • When I press Power Button, it goes as usual (screen blanks, disc is used, then screen flash back for second and then again blanks and computer halts (goes off) as expected).
  • But when I press Power button to turn it up, I can see EFI "bios" messages, then screen goes blank and monitor draw "Input not supported" floating around. I should see the tux logos and booting messages about starting services here. Then computer turns off.
  • When I press Power Button again, the computer start as usual, but does full boot instead of reading stored hibernation image.
  • I have this lines in /etc/acpi/default.sh, than manages the Power Button press:
echo /dev/nvme0n1p16 > /sys/power/resume
echo shutdown > /sys/power/disk
echo disk > /sys/power/state
  • The nvme0n1p16 partition is swap of size 50GB, which is large.
  • The system is on partition nvme0n1p15 of size 100GB, where only 27GB is used.
  • In the kernel configuration (/usr/src/linux/.config) there is only one line, which mention the nvme disc:
# grep nvme0 /usr/src/linux/.config
CONFIG_CMDLINE="root=/dev/nvme0n1p15 net.ifnames=0 vga=ask amdgpu.gpu_recovery=1 amdgpu.lockup_timeout=3000 resume=/dev/nvme0n1p16"

There is no log about the unsuccessfull start in /var/log - just the shutdown and then the full boot.

chatGPT > It sounds like the hibernation process is not completing successfully on your new Gentoo Linux system. There are a few things you can try to troubleshoot the issue:

  1. Check the swap partition: Make sure that your swap partition is properly set up and available. You can use the "swapon" command to check if the swap partition is currently active.
  2. Check the kernel configuration: Double-check that your kernel configuration has the necessary options enabled for hibernation. You may want to try enabling the "CONFIG_HIBERNATION" option and recompiling your kernel.
  3. Check the hibernation image: Verify that the hibernation image is being properly created and stored. You can use the "file" command to check the hibernation image file, and make sure it exists in the expected location.
  4. Check the log files: Look for any error messages or clues in the system log files. Check the output of the "dmesg" command and look for any errors related to hibernation or resume.
  5. Try a different method of hibernation: If none of the above steps resolve the issue, you may want to try a different method of hibernation. For example, you could try using the "pm-hibernate" command instead of relying on the Power Button press.

Hopefully, one of these steps will help you get hibernation working on your new Gentoo Linux system.

Gilhad >

  1. the swap partition is set correctly
swapon
NAME            TYPE      SIZE USED PRIO
/dev/nvme0n1p16 partition  50G   0B   -2
  1. the kernel is compiled with hibernation enabled
grep CONFIG_HIBERNATION /usr/src/linux/.config
CONFIG_HIBERNATION=y
CONFIG_HIBERNATION_SNAPSHOT_DEV=y
  1. there is no hibernation file, there is hibernation partition /dev/nvme0n1p16
  2. there is no error in the log files, but there are no logfiles for the failed attempt
  3. the same method works on the same computer with older version of the system

chatGPT > Based on the information you have provided, it seems that the hibernation process is not creating a hibernation image file on the new Gentoo Linux system. This could be due to a variety of reasons, such as a misconfiguration in the kernel or ACPI settings.

Here are a few additional steps you can try to troubleshoot the issue:

  1. Check ACPI settings: Make sure that your ACPI settings are properly configured for hibernation. You can check the "ACPI_SLEEP" kernel option in your kernel configuration to ensure that it is set to "y".
  2. Check hibernation settings: Verify that your hibernation settings are properly configured. You can check the contents of the "/sys/power/state" file to see which power states are available, and ensure that "mem" is included.
  3. Try a different hibernation method: If the Power Button press method is not working, you could try a different method of initiating hibernation. For example, you could try using the "hibernate" command, which is part of the "hibernate-script" package.
  4. Check for any error messages during hibernation: If hibernation fails to create a hibernation image, there may be some error messages displayed on the console. You can check the contents of the "/var/log/messages" file to see if any error messages were logged during the hibernation process.
  5. Try a different kernel version: If all else fails, you could try using a different kernel version to see if hibernation works on that version. You can try installing a different kernel version and configuring it with the necessary options for hibernation.

Hopefully, one of these steps will help you get hibernation working on your new Gentoo Linux system.

Gilhad >

  1. the Acpi is configured for hibernation and it visibly reacts to Power Button (and logs it to log file, that it is going to hibernate)
grep ACPI_SLEEP /usr/src/linux/.config
CONFIG_ACPI_SLEEP=y
  1. the hibernation is set to disk, so the computer can be turned off. Power states include both mem and disc
cat /sys/power/state
freeze mem disk
  1. the Power Button is working. It logs the Power Button press and starts hibernation and turns the computer off.
  2. there are no error messages displayed on the console and /var/log/messages contains just usual lines, no errors.

chatGPT > Since you have verified that your ACPI settings, hibernation settings, and Power Button are all properly configured, it seems that the issue may be related to the hibernation image file not being created.

One possibility is that there is not enough free space on the swap partition to create the hibernation image. You mentioned that the swap partition is 50GB in size, but you did not mention how much free space it currently has. To check this, you can use the "free" command to see how much memory and swap space is currently in use:

free -h

If the swap space is almost completely full, you may need to increase the size of the swap partition or reduce the amount of memory in use before hibernating.

Another possibility is that there is an issue with the hibernation process itself. You could try using the "hibernate" command to initiate hibernation and see if it creates a hibernation image. To do this, first install the "hibernate-script" package:

emerge hibernate-script

Then, run the following command to hibernate the system:

hibernate

If this works, it may indicate that there is an issue with the Power Button method of hibernation. You can try to troubleshoot this further by looking at the logs to see if there are any error messages or by testing with a different kernel version.

If neither of these steps work, you could try creating a new swap partition specifically for hibernation. To do this, you would need to create a new partition, format it as swap, and then modify your kernel configuration and ACPI settings to use this new partition for hibernation.

I hope one of these suggestions helps you get hibernation working on your new Gentoo Linux system.

Gilhad > The swap is not much used, it is free as usual.

free -h
               total        used        free      shared  buff/cache   available
Mem:            31Gi       628Mi        29Gi       5.0Mi       673Mi        30Gi
Swap:           49Gi          0B        49Gi

I would rather fix this method (and find the reason, why it fails on the new system, but works on the old one), than trying blindly other methods

chatGPT > I see. In that case, one possibility is that there is a difference in the kernel configuration between your old and new Gentoo Linux systems that is causing the hibernation process to fail on the new system.

You mentioned that you have checked the kernel configuration on the new system and found that hibernation is enabled. However, it may be worth double-checking that all the necessary options are set correctly.

You can try comparing the kernel configuration files between your old and new systems to see if there are any differences that could be causing the issue. You can do this by running the following command on both systems:

diff /usr/src/linux/.config-old /usr/src/linux/.config-new

Replace "/usr/src/linux/.config-old" and "/usr/src/linux/.config-new" with the actual paths to the kernel configuration files on your old and new systems, respectively.

Look for any differences in the options related to hibernation and ACPI. If you find any differences, try updating the kernel configuration on the new system to match the old system, rebuild the kernel, and see if hibernation works.

Another possibility is that there is a difference in the ACPI implementation between your old and new systems that is causing the hibernation process to fail on the new system. You can try comparing the ACPI tables between the two systems to see if there are any differences.

To do this, you can use the "acpidump" command to dump the ACPI tables on both systems:

acpidump > acpi-tables-old
acpidump > acpi-tables-new

Then, you can compare the contents of the "acpi-tables-old" and "acpi-tables-new" files to see if there are any differences.

If you find any differences, you may need to investigate further to determine if they are related to the hibernation process. This could involve analyzing the ACPI code, modifying the ACPI tables, or contacting the manufacturer for support.

I hope these suggestions help you identify the cause of the hibernation issue on your new Gentoo Linux system.

2   acpidump

# acpidump|grep "^[^ ]" |sort> acpidump.OLD
# acpidump|grep "^[^ ]" |sed "s/@.*//"|sort> acpidump.OLD
# diff -y acpidump.OLD acpidump.NEW
APIC           APIC
CDIT           CDIT
CRAT           CRAT
DSDT           DSDT
FACP           FACP
FACS           FACS
FIDT           FIDT
FPDT           FPDT
HPET           HPET
IVRS           IVRS
MCFG           MCFG
PCCT           PCCT
RSD PTR      <
SSDT           SSDT
SSDT           SSDT
SSDT           SSDT
SSDT           SSDT
SSDT           SSDT
SSDT           SSDT
UEFI           UEFI
WPBT           WPBT
WSMT           WSMT
XSDT         <

APIC @ 0xd93ebd08                                             | APIC @ 0x0000000000000000
CDIT @ 0xd93ffb08                                             | CDIT @ 0x0000000000000000
CRAT @ 0xd93fe4b0                                             | CRAT @ 0x0000000000000000
DSDT @ 0xd93e01f8                                             | DSDT @ 0x0000000000000000
FACP @ 0xd93ebbf0                                             | FACP @ 0x0000000000000000
FACS @ 0xd98ece00                                             | FACS @ 0x0000000000000000
FIDT @ 0xd93ebeb0                                             | FIDT @ 0x0000000000000000
FPDT @ 0xd93ebe68                                             | FPDT @ 0x0000000000000000
HPET @ 0xd93f8478                                             | HPET @ 0x0000000000000000
IVRS @ 0xd93f8560                                             | IVRS @ 0x0000000000000000
MCFG @ 0xd93f8438                                             | MCFG @ 0x0000000000000000
PCCT @ 0xd93f8630                                             | PCCT @ 0x0000000000000000
RSD PTR @ 0xd93e0000                                          | SSDT @ 0x0000000000000000
SSDT @ 0xd93ebf50                                             | SSDT @ 0x0000000000000000
SSDT @ 0xd93ec110                                             | SSDT @ 0x0000000000000000
SSDT @ 0xd93f4da8                                             | SSDT @ 0x0000000000000000
SSDT @ 0xd93f84b0                                             | SSDT @ 0x0000000000000000
SSDT @ 0xd93f86a0                                             | SSDT @ 0x0000000000000000
SSDT @ 0xd93ffb38                                             | UEFI @ 0x0000000000000000
UEFI @ 0xd93f84d8                                             | WPBT @ 0x0000000000000000
WPBT @ 0xd93f8520                                             | WSMT @ 0x0000000000000000
WSMT @ 0xd9401888                                             <
XSDT @ 0xd93e00a0                                             <

[OLD] # uname -a
Linux cobra-mk3 5.4.38-gentoo #11 SMP Thu Feb 3 02:06:40 CET 2022 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux