Hibernation/ suspending not working

My system is not willing to hibernate when I use that as a shutdown option. It appears my system is going down, but I always end directly back at SDDM. My system hangs when coming out of suspend mode with a black-screen and a mouse pointer. Forcing me to do a hard reset. I’ve been looking with Google, but haven’t found a solution.

# swapon
NAME TYPE SIZE USED PRIO
/dev/sdc1 partition 16.6G 0B -1

# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-4.4.79-4-default root=UUID=32f8d34f-9f5f-4956-9202-fb3bb6a69cac resume=/dev/sdc1 splash=silent quiet showopts

Note: Initially the resume device was sdb1, but Partitioner gave back sdc1 as that is the swap device. I updated that setting by running Yast2 Boot-loader.

# blkid | grep -i swap
/dev/sdc1: UUID=“9c598fac-3f5f-4197-8bc9-4a4648aa193a” TYPE=“swap” PARTUUID=“000b2a66-01”

My system is having 16G of ram of which 14G is available to the system the other 2 are used by my AMD APU.

Do you have suggestions what I can try to get hibernation and suspend to work properly.

These sorts of issues can be challenging to diagnose… it may well relate to the graphics driver behaviour. Often a bug report is needed to help resolve these kinds of issues.

Does the following work successfully?

systemctl hibernate

Following an unsuccessful hibernate/thaw cycle you might try examining the journal log from the previous boot with something like

sudo journalctl --boot=-1 | tail -n120

https://forums.opensuse.org/showthread.php/523129-Help-with-getting-information-about-the-hibernate?p=2814479#post2814479
Depending on what the issue is, other diagnostic approaches may be necessary (and beyond my experience to assist in a meaningful way).

If you really feel like getting your hands dirty and have the required technical knowledge, there is a diagnostic approach described here which consists of a custom service designed to run a script that will capture process kill events and signal events on shutdown, and some scripts to help with this. I’ve never needed to get ‘under the hood’ to do this so can only offer limited guidance. YMMV.

Post the details of your graphics hardware as well

/usr/sbin/hwinfo --gfxcard
egrep "Unload|LoadModule" /var/log/Xorg.0.log

Once experiment to try…

Switch away to another VT eg Ctrl+Alt+F2, login as same user, do

systemctl hibernate

Does that complete successfully? Wake up the computer and when you finally get the prompt switch back to the graphical desktop session with Ctrl+Alt+F7

If that works, we should be able to automate it with a systemd script in installed in the /usr/lib/systemd/system-sleep/ directory.

For experimental purposes, I created a basic script (/usr/lib/systemd/system-sleep/vtswitch.sh) and made it executable with

chmod +x /usr/lib/systemd/system-sleep/vtswitch.sh

It is invoked when hibernating/suspending, and again on resuming/thawing…

#!/bin/bash

case $1 in

pre)

#sleeping
        chvt 2
        echo "Going to sleep..."
        sleep 2
;;
post)

#wakeup
        echo "Waking again..."
        sleep 2
        chvt 7
;;
esac

For more info…

man man systemd-suspend.service

This will only be useful for those who find that they can hibernate (or suspend) successfully from a VT console, but not from a graphical session. Some users with AMD graphics (and proprietary driver) find this is the case.

No the first time I did that I got back to SDDM directly.

I now did it again and my system was frozen. After resetting my system I was expecting to come back in my pre-hibernation state, but that was not the situation, only Grub was skipped upon boot.

sudo journalctl --boot=-1 | tail -n120


Aug 15 16:04:44 MyOS sudo[3239]:     tneo : TTY=pts/0 ; PWD=/home/tneo ; USER=root ; COMMAND=/usr/bin/systemctl hibernate
Aug 15 16:04:44 MyOS sudo[3239]: pam_unix(sudo:session): session opened for user root by tneo(uid=0)
Aug 15 16:04:44 MyOS sudo[3239]: pam_systemd(sudo:session): Cannot create session: Already running in a session
Aug 15 16:04:44 MyOS sudo[3239]: pam_unix(sudo:session): session closed for user root
Aug 15 16:04:44 MyOS systemd[1]: Reached target Sleep.
Aug 15 16:04:44 MyOS systemd[1]: Starting Hibernate...
Aug 15 16:04:45 MyOS kernel: PM: Hibernation mode set to 'platform'
Aug 15 16:04:45 MyOS systemd-sleep[3254]: INFO: running /usr/lib/systemd/system-sleep/grub2.sleep for hibernate
Aug 15 16:04:45 MyOS systemd-sleep[3254]: INFO: Running prepare-grub ..
Aug 15 16:04:45 MyOS systemd-sleep[3254]:   running kernel is grub menu entry openSUSE Leap 42.3 (vmlinuz-4.4.79-4-default)
Aug 15 16:04:45 MyOS systemd-sleep[3254]:   preparing boot-loader: selecting entry openSUSE Leap 42.3, kernel /boot/4.4.79-4-default
Aug 15 16:04:45 MyOS systemd-sleep[3254]:   running /usr/sbin/grub2-once "openSUSE Leap 42.3"
Aug 15 16:04:45 MyOS systemd-sleep[3254]:     time needed for sync: 0.3 seconds, time needed for grub: 0.1 seconds.
Aug 15 16:04:45 MyOS systemd-sleep[3254]: INFO: Done.
Aug 15 16:04:45 MyOS systemd-sleep[3254]: Suspending system...

**
sudo /usr/sbin/hwinfo --gfxcard**


09: PCI 01.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.378]
  Unique ID: vSkL.Yq0G9QwQsG1
  SysFS ID: /devices/pci0000:00/0000:00:01.0
  SysFS BusID: 0000:00:01.0
  Hardware Class: graphics card
  Model: "ATI Kaveri [Radeon R7 Graphics]"
  Vendor: pci 0x1002 "ATI Technologies Inc"
  Device: pci 0x1313 "Kaveri [Radeon R7 Graphics]"
  SubVendor: pci 0x1043 "ASUSTeK Computer Inc."
  SubDevice: pci 0x85cb 
  Driver: "radeon"
  Driver Modules: "drm"
  Memory Range: 0xe0000000-0xefffffff (ro,non-prefetchable)
  Memory Range: 0xf2000000-0xf27fffff (ro,non-prefetchable)
  I/O Ports: 0xf000-0xf0ff (rw)
  Memory Range: 0xfeb00000-0xfeb3ffff (rw,non-prefetchable)
  Memory Range: 0xfeb40000-0xfeb5ffff (ro,non-prefetchable,disabled)
  IRQ: 45 (25488 events)
  I/O Ports: 0x3c0-0x3df (rw)
  Module Alias: "pci:v00001002d00001313sv00001043sd000085CBbc03sc00i00"
  Driver Info #0:
    Driver Status: radeon is active
    Driver Activation Cmd: "modprobe radeon"
  Config Status: cfg=new, avail=yes, need=no, active=unknown


Primary display adapter: #9

grep “Unload|LoadModule” /var/log/Xorg.0.log


    19.262] (II) LoadModule: "glx"
    19.280] (II) LoadModule: "radeon"
    19.283] (II) LoadModule: "fglrx"
    19.284] (II) UnloadModule: "fglrx"
    19.284] (II) Unloading fglrx
    19.284] (II) LoadModule: "ati"
    19.476] (II) LoadModule: "modesetting"
    19.479] (II) LoadModule: "fbdev"
    19.480] (II) LoadModule: "vesa"
    19.527] (II) LoadModule: "fbdevhw"
    19.561] (II) LoadModule: "fb"
    19.563] (II) LoadModule: "dri2"
    19.563] (II) LoadModule: "glamoregl"
    20.015] (II) LoadModule: "ramdac"
    20.015] (II) UnloadModule: "modesetting"
    20.015] (II) Unloading modesetting
    20.015] (II) UnloadModule: "fbdev"
    20.015] (II) Unloading fbdev
    20.015] (II) UnloadSubModule: "fbdevhw"
    20.015] (II) Unloading fbdevhw
    20.015] (II) UnloadModule: "vesa"
    20.016] (II) Unloading vesa
    20.353] (II) LoadModule: "libinput"

The same happened. System seems to be switching off (as expected), but is not responding to me pressing the power button or any other input. I need to press the reset button to switch my system back on.

Strange. You seem to have the proprietary (and deprecated) ‘fglrx’ driver present, but it doesn’t work on Leap 42.2+, and not surprisingly it is unloaded and the open source radeon driver used instead. Hopefully, others can advise further here.

Yes that indeed is weird. I did not install that. This is a fresh 42.3 install (expect for /home).

I’m at the limits of my knowledge here, but perhaps the amdgpu driver (open source graphics driver for the latest AMD Radeon graphics cards) might be an option worth considering? I honestly don’t know whether it will change the hibernation behaviour or not. However, if you’re not adverse to experimentation and reverting if necessary… :wink: …then keep reading…

There was a recent thread discussing this driver, and in particular this post described how to install the latest stable kernel and upgrade the Xorg stack (which will be needed to support the “Kaveri [Radeon R7 Graphics]” chipset).

For Leap 42.3 you’ll need to use the following Xorg repo
http://download.opensuse.org/repositories/X11:/XOrg/openSUSE_Leap_42.3/

and a ‘zypper dup’ needed to upgrade.

YMMV.

That’s worth a shot to try. I’ll do that later this week. Keep you posted.

I was in two minds about suggesting it (I don’t have experience with doing this or AMD hardware to play with), but nothing ventured nothing gained, so I’ll be interested in your results. You might try doing nothing more than upgrading the kernel to start with, before taking the additional steps to use the amdgpu driver. Hopefully, others can advise further here.

I upgraded to the 4.12 kernel with success (fixes another issue I had). So that was done.
I followed the other steps as suggested in the post.

After reboot I get the following output for: /sbin/lspci -nnk | grep -A3 VGA
00:01.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Kaveri [Radeon R7 Graphics] [1002:1313]
Subsystem: ASUSTeK Computer Inc. Device [1043:85cb]
Kernel driver in use: radeon
Kernel modules: radeon, amdgpu

So the kernel module is loaded, but the driver is not.

I then continued with the suggested steps to fix:

Added radeon to the blacklist.
Added the suggested 20-amdgpu.conf file
Ran mkinitrd (I saved the screen output to a file if handy)

After reboot I don’t get anywhere, falling to prompt. I reverted changes and got back into X again.

I did not upgrade the X-stack. I was not sure that the X repo was more up to date than my 42.3 install. If that would be the case I can give it another shot.

With regards to the hibernation issue:
It goes into sleep mode and after a few seconds it provides me SDDM to log-in. So there is some improvement as the freeze is gone. :slight_smile: