Linux Lite Forums

Software - Support => Other => Topic started by: scottlovejoy3687 on April 15, 2019, 06:59:45 AM

Title: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 15, 2019, 06:59:45 AM
Iíve recently installed LL 4.4 on a circa 2014 gaming laptop. LL ran really smooth for the most part except when I would suspend the computer to put it to sleep.  When I woke up the computer, after unlocking, it becomes a lagging mess.  The usually smooth XFCE desktop lags when I try to switch between tabs and the mouse pointer is delayed when I move it around the screen. 

Iíve looked around the forums on askUbuntu and Ubuntu users have reported a problem with waking up from suspend.  It might be a problem with the kernel but Iím not sure.  The solutions on the forums have not worked for me.  One thing I have noticed though is that after waking my computer up, the fans in my laptop are running louder than usual and the xorg process is taking up more cpu than usual (15% - 50%).

Iíve installed the Nvidia proprietary drivers to play games, as the performance of Nouveau isnít there just yet.  I donít know if this might be the cause of the problem but I just wanted to give as much information as possible.  I hope Iím not the only one with this problem.


Thank you in advance.
Title: Re: Major lag after wake up from suspend
Post by: TheDead on April 15, 2019, 08:12:56 AM
Hi,

Just in case the nouveau driver does not resume correctly and runs the video card at 100% on resume,
I would try installing the nVidia proprietary drivers first.
Second, I would go in the BIOS (using the DELETE, F10 or  F2 keys on boot, depends on computer brand) and checking the power options.
Either changing the S1, S3 / S5 powersaving mode and/or activating "Repost Video on resume" (lesser chance though) in the case the kernel/drivers are not able to handle the wake up process or the current configuraiton.

Good luck!
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 15, 2019, 09:01:36 AM
I said in the question that I do have the proprietary drivers installed.  I will try what you have suggested and report back if it works or not.
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 15, 2019, 10:01:06 AM
Hello scottlovejoy3687,

when you tried some solution on askUbuntu was this one of the ones you have tried yet? - https://askubuntu.com/questions/792605/ubuntu-16-04-lts-too-slow-after-suspend-and-resume (https://askubuntu.com/questions/792605/ubuntu-16-04-lts-too-slow-after-suspend-and-resume)

On this thread at reply #9 there is a different solution that you can try https://bbs.archlinux.org/viewtopic.php?pid=1548933#p1548933 (https://bbs.archlinux.org/viewtopic.php?pid=1548933#p1548933)

and also some discussion in the same link of another way by turning swap off solving a similar issue.

For this problem these are the solutions on Dell community - https://www.dell.com/community/Inspiron/Suspend-resume-problems-on-Ubuntu-18-04/td-p/6072410
 (https://www.dell.com/community/Inspiron/Suspend-resume-problems-on-Ubuntu-18-04/td-p/6072410)
A similar but going further solution is - http://nu-one.blogspot.com/2017/09/slow-cpu-after-resume-ubuntu-1604-lts.html
 (http://nu-one.blogspot.com/2017/09/slow-cpu-after-resume-ubuntu-1604-lts.html)
If you are unsure about doing any of these please await for one of the advanced members to look over and review the links (as I am not sure of the best route) but they will know which is more likely to be the one, or if there is a better way, and save you time.

Title: Re: Major lag after wake up from suspend
Post by: TheDead on April 16, 2019, 08:16:28 AM
Lots of different way to go.
Reading the links also mentions that turning off "SpeedStep" in my BIOS fixed the problem for some... but this seems to also disable TurboBoost I guess this would also consume more power because CPU would not clock down and stay at "default" frequency. I would try the other things first. ;)

Godd luck!
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 16, 2019, 03:43:28 PM
Thank you all for the suggestions and solutions. The first solution I tried was the one that involved changing the cpu mode from powersave to performance.  That didn't solve the problem.  Turning sleepsafe or whatever in the bios didn't work either.  It actually made the problem worse.  Turning swap off didn't work either.  I tried the msr solution and wrote a script for a service like they did in the solution, but that didn't work either.  I'm honestly confused why my computer is doing this in the first place.  If I don't suspend my computer at all, Linux Lite is just fine.  I might just back up my files and do a clean install and see if that fixes anything.

I don't know if this helps, but the specific model of my laptop is an MSI Apache GE70-2PE.
Title: Re: Major lag after wake up from suspend
Post by: TheDead on April 17, 2019, 08:49:31 AM
There was some mention in third (dell) link about problems not coming back at all from suspend because of of an nVidia video card.
This could be related... installing the nVidia driver was the first step but some command lines to manage hardware feature are also mentionned.

Also, in any case, I never tried it with Linux and this may be a questions for other member here.. I don't know how well Linux handles a Laptop with two videocards.
Some have special features activating the discrete (nVidia) card when using 3D/performance and using the "standard" integrated video card for "normal" desktop work.
This 'switching' even gave me trouble on a few Laptops with official manufacturer Windoze installations. :-S
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 17, 2019, 02:04:16 PM
In the machine are you using an SSD ?

This link discusses how SSD are different speeds if booted from battery or AC power, and the percentage difference varies by the manufacturer of the SSD, there can be some work arounds possibly if it is after suspend or speed decreasing by #'s of read/writes re; (Trim ?) - https://askubuntu.com/questions/844459/ubuntu-ssd-was-fast-is-now-extremely-slow (https://askubuntu.com/questions/844459/ubuntu-ssd-was-fast-is-now-extremely-slow)
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 17, 2019, 05:45:18 PM
@bitsnpcs My laptop has a 7200 rpm hard drive, but no sad ( I wish ).  As for the dual GPUs, it does let me switch between the intel and Nvidia graphics. Iíll see if using the intel graphics makes any difference.  As I said before, the sad fix wonít work for me.
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 17, 2019, 06:04:48 PM
@scottlovejoy3687 I have not managed to find any other info that may be about this yet, there were just some other links but they about overclocking and temperatures causing issues, they were to do with going in to suspend or shutdown, not waking from it though.
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 17, 2019, 06:17:39 PM
So I donít know if this is a fix or not, but checking the box ďsave session for future loginsĒ before suspending  seems to fix the problem.  I donít know if this is a solution but it seems to work.

Edit: This improved it a little, by the lag is still there.
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 17, 2019, 06:28:18 PM
I donít know if his helps, but it seems that the only parts that are lagging are parts of the xfce desktop ( the window manager, panel, menu, etc. ).  Navigating within applications seems to work fine.

When I open htop, the processes that seem to take up the most cpu % are:  "/usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch" and the second process is "/usr/lib/firefox/firefox -contentproc -childID 8 -isForBrowser -prefsLen 8301 -prefMapSize 182175 -parentBuildID 20190410105841".   The xorg is the process that can take up to 60% of my cpu.  It sporadically jumps all over the place.
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 17, 2019, 06:57:36 PM
There was this bug - https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/838208  (https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/838208)

There are some discussions (other links/searches) about Compiz, and separately discussions about compositing, that in either when they were disabled it was solving it.
It was saying how where "fancy effects" were being used by desktop environment, or apps (only Firefox was specified in one post, but in others no apps were specified), then this was causing the spike in CPU useage from 60 til 100% and slowness/lag after suspend/sleep, not improving unless reboot was done. After which still being higher than usual until the feature was disabled. (summary info from a multiple links)

Have you tried -

Menu > ALL > Window Manager Tweaks

In the GUI select the Tab named "Compositor" untick the first item named "Enable display compositing" 
Click close.
Does this help it improve or not ?
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 17, 2019, 07:33:24 PM
@bitsnpcs It does not improve it unfortunately.  When I try to use firefox after waking up from suspend, it starts to use up to 50% cpu as well.  It's happening as i type this.  I also tried using a slightly older kernel to see if that fixed the problem...no difference at all.
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 17, 2019, 07:38:09 PM
Have you tried -

Menu > System > Lite Tweaks
select "zRam", and "Preload Apps", try this individually then at the same time.
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 17, 2019, 07:54:09 PM
That doesnít work either :(
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 17, 2019, 07:56:55 PM
I am out of ideas of what to search about for potential things to try. I will think about it a bit and search some more tomorrow.

Does this work ?

https://www.perl.com/article/fixing-a-sluggish-linux-after-suspend-resume/ (https://www.perl.com/article/fixing-a-sluggish-linux-after-suspend-resume/)
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 18, 2019, 06:25:37 PM
no it doesn't work
Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 18, 2019, 06:27:37 PM
That didn't work either.  I'm going to take a break from Linux Lite and switch to Xubuntu, as they are very similar.  Xubuntu also has updated Nvidia drivers and other updated software in general.  Again, thank you for all the help!
Title: Re: Major lag after wake up from suspend
Post by: bitsnpcs on April 18, 2019, 07:36:17 PM
It is unfortunate I was unable to locate a link having a solution for the particular computer.
Other members may yet find it.
Or some advanced /experienced members may actually know the answer themselves, but they may be busy and not on the forums at the current timeframe.

Whilst taking your break I hope you find a solution for using a Linux OS on this particular computer you write of.



Title: Re: Major lag after wake up from suspend
Post by: TheDead on April 18, 2019, 09:02:55 PM
Heya,

1. I read a similar related post today.
When you wake up the computer. Try and Disable the nVidia card and re-enable it after wards.
This solved the "lag" in this case.

2. If it was not mentioned, Have you tried the same on the live USB Linux Lite 4.x and maybe 3.8?

3. If you go the Xubuntu way, please reply back here with your results.

Title: Re: Major lag after wake up from suspend
Post by: scottlovejoy3687 on April 22, 2019, 07:58:49 PM
So I tried Xubuntu for a couple of days and it suffered from more or less the same problem...

I'm thinking it might be something to do with my dual graphics, and Nvidia driver support for Linux is subpar when compared to AMD, at least for open source. My first PC build will be full team red.

As of right now, I'll refrain from suspending my computer for now and just lock the screen when I need to leave my desk.