Cannot hibernate if ram is used 17 March 2023, 18:49:23 I am now using Hyprland on my desktop.I am trying the nouveau drivers for my (nvidia) card.I have trouble when hibernating if there is some ram used it fails:Code: [Select]echo disk > /sys/power/statebash: echo: write error: Cannot allocate memoryI have a 20gb swap file that was working fine, when I was using bspwm (xorg) with the proprietary driver.Sometimes when resuming it is stuck and I have to unplug the power, if there was some ram usage when I hibernated.I searched the error and I found this https://forums.gentoo.org/viewtopic-t-1134165-start-0.html.Indeed I cannot hibernate if ram is above 50% it seems.I have only 4gb of ram so I can't have much opened.Is normal that I need 50% of ram free?
Re: Cannot hibernate if ram is used Reply #1 – 17 March 2023, 19:55:58 Try thisCode: [Select]echo platform > /sys/power/diskecho disk > /sys/power/state
Re: Cannot hibernate if ram is used Reply #2 – 17 March 2023, 20:55:40 Code: [Select]echo platform > /sys/power/diskecho disk > /sys/power/statebash: echo: write error: Cannot allocate memory(No output for the first command).
Re: Cannot hibernate if ram is used Reply #3 – 17 March 2023, 21:25:51 Shame!I know it works for me with the two lines but not always with just the second.Some other stuff to read and tryhttps://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html
Re: Cannot hibernate if ram is used Reply #4 – 18 March 2023, 09:59:35 From the above Gentoo link:QuoteDocumentation/power/pci.rst: The freezing of devices is carried out after enough memory has been freed (atthe time of this writing the image creation requires at least 50% of system RAMto be free) in the following three phases:I can hibernate with only "echo disk > /sys/power/state" when I have enough ram free.Is it possible to write the image directly to the disk instead of pre-creating it in ram? I didn't have this problem before. Last Edit: 18 March 2023, 10:08:47 by kiblaster
Re: Cannot hibernate if ram is used Reply #5 – 19 March 2023, 20:28:12 Try dropping all caches before attempting to hibernate; if it fails again, there's something rotten:Code: [Select]# echo 3 >| /proc/sys/vm/drop_caches
Re: Cannot hibernate if ram is used Reply #6 – 20 March 2023, 20:40:22 It still fails "Cannot allocate memory" if there is some ram used.
Re: Cannot hibernate if ram is used Reply #7 – 20 March 2023, 21:00:39 Try older kernels. If it worked before got to be a kernel change that broke it. As the command you are using is talking to it directly.
Re: Cannot hibernate if ram is used Reply #8 – 20 March 2023, 22:31:33 I tried "6.1.12-artix1-1", same allocation error.Is it possible that the change from nvidia to nouveau is preventing me to hibernate?
Re: Cannot hibernate if ram is used Reply #9 – 20 March 2023, 22:53:08 Quote from: kiblaster – on 20 March 2023, 22:31:33Is it possible that the change from nvidia to nouveau is preventing me to hibernate?Possibly. In my limited experience video drivers have caused problems coming back from suspend/hibernation not going into it. But I wouldn't rule it out without testing it.It would still be kernel related in a way as both drivers have kernel modules. If you are able swap back. try it, see what happens. You are probably gonna solve it by trial and error or one day , after an update, it just starts working again.If it did work what have you changed since ? It has to be one of, or a combination of, those things.And as I said it has to be low level as the command you use is low level.
Re: Cannot hibernate if ram is used Reply #10 – 23 March 2023, 20:20:03 I was holding back the kernel and then I was missing the nvidia modules after rebooting.So I tried the nouveau.I updated the kernel and I installed the nvidia package.The problem persist.
Re: Cannot hibernate if ram is used Reply #11 – 23 March 2023, 22:59:29 Quote from: kiblaster – on 23 March 2023, 20:20:03I was holding back the kernel and then I was missing the nvidia modules after rebooting.nvidia-dkms is what you want. The nvidia driver is tied to a specific kernel with each version. nvidia-dkms isn't. Last Edit: 23 March 2023, 23:10:54 by gripped
Re: Cannot hibernate if ram is used Reply #12 – 24 March 2023, 18:54:33 Before when I installed nvidia it didn't "activate" it as the first time.I was still using nouveau.I installed nvidia-dkms, blacklisted nouveau and enabled the nvidia-uvm module.And I am back on X11, I can hibernate fine. Last Edit: 04 May 2023, 18:38:50 by kiblaster