Laptop crashes when off A/C

If none of the more specific forums is the right place to ask

Laptop crashes when off A/C

Postby pistacie » 2017-08-05 12:44

Hello. I started a thread a while back because I was experiencing hard crashes (complete shutdown with no warning) when running MATLAB. I've since found out that the problem is not specific to MATLAB at all and occurs whenever my laptop is under heavy load while off A/C (had it happen while running Wine or Chromium). I've turned off all power management options in the BIOS (and tried setting everything to maximum performance) and I tried fiddling with the settings in xfce4-power-manager as well, but none of it seems relevant to my issue since it's mainly power saving through display behavior from what I could tell. I'm not sure what else could be causing issues on battery power only.

I've tried with a different battery and had the exact same problem, so I'm betting on it being down to some change in power management when switching to battery power, but not sure how to get any further. I've tried running strace and it outputs a very long list of the following:

poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}], 3, 10) = 0 (Timeout)
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)

I don't know if that's helpful at all. I've tried searching online but didn't find any solution, many people seemed to have the exact opposite problem (crashes when ON A/C). I'd greatly appreciate any ideas of possible fixes, I have zero issues while on A/C. Thanks.
pistacie
 
Posts: 7
Joined: 2017-06-25 19:37

Re: Laptop crashes when off A/C

Postby wizard10000 » 2017-08-05 12:58

This really sounds like a hardware or firmware issue. Since it only happens during heavy load that leads me to believe the laptop is drawing more power than the battery subsystem can provide.

If you have a multicore processor can you try disabling hyperthreading and all but one processor core in BIOS and see if it's still a problem? It'll be slow as heck but if the processor is drawing more juice than the battery can provide this might provide a little information. You can always re-enable those processor cores after troubleshooting.

The solution may be as simple as plugging the thing into the wall if you're gonna load up the processor :)

Hope this helps -
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1218
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Laptop crashes when off A/C

Postby pistacie » 2017-08-05 17:54

Hey Wizard, thanks for the reply!

I didn't have the problem on Windows on this laptop (it was awfully slow however even on a fresh install), so I assumed it was most likely firmware rather than the machine itself, or maybe some issue between BIOS and Linux specifically. I did try without hyperthreading but it didn't seem to make a difference. I just tried disabling multicore processing as well, and so far it didn't crash (and the speed difference wasn't as bad as I expected). I've concluded that the problem was "fixed" quite a few times already though, sometimes it runs fine for 30+ minutes and then shuts off, so I'll report back after giving it some more time under load, I suspect it will still crack under pressure.

You're definitely right about it not being the end of the world, but being able to work while on the road would be nice! If it means taking a slight hit in speed that's certainly preferable to losing all working files out of nowhere. I'll report back after giving it some more time on battery with multicore disabled.
pistacie
 
Posts: 7
Joined: 2017-06-25 19:37

Re: Laptop crashes when off A/C

Postby dasein » 2017-08-05 18:38

pistacie wrote:...the speed difference wasn't as bad as I expected...

It wouldn't be if you're only running one app. Don't be at all surprised, however, if multi-tasking takes a big performance hit.
User avatar
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Laptop crashes when off A/C

Postby wizard10000 » 2017-08-05 20:01

Hi, pistacie -

Sad to say but in most cases Microsoft does a better job with power management than Linux does :(

If the thing runs fine on a single core this might be one of the only times I ever recommend setting a CPU governor at powersave instead of ondemand or performance. Arch's wiki has the best writeup on CPU frequency governors - and you can switch between governors without rebooting. You need to be root to do it, but it can be done.

https://wiki.archlinux.org/index.php/CP ... cy_scaling

Here's my thinking -

Any task a processor executes takes X number of processor cycles and will use roughly the same amount of power regardless of CPU frequency; a lower clock speed will use the same amount of power for a given task but will spread it out over a longer period of time. If this was a desktop machine I'd recommend undervolting the processor but that's generally not possible on a laptop.

Knowing which processor you had would be helpful, but massaging either the acpi_cpufreq driver or intel_pstate driver might make the machine calm down.

If it was bad RAM you'd see a spontaneous reboot. If it was software you'd probably see a kernel panic but the only thing I can think of that'd make a machine just quit is a power issue.

Of course, I could be all wet - but it makes sense to me :)
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1218
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Laptop crashes when off A/C

Postby pendrachken » 2017-08-05 23:11

If I had to hazard a guess, with the info given so far, this is a thermal issue.


Check in the BIOS / EFI setup utility to make sure that there isn't an option for "silent", "quiet", "passive", or "fanless" modes that engage when the laptop is on battery power.

A good check for thermal shutdown would be to run a script that reads the CPU / GPU temps every couple seconds and dumps them to a file and syncs the disks, then load the CPU as hard as possible until you get a lockup / shutdown. Then it should just be a matter tailing the log file to see if you are near thermal shutdown limits for your particular CPU. If it gets smoking hot you know something in the cooling / scaling isn't working correctly on battery and narrows the field of what to look for down considerably.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P
pendrachken
 
Posts: 1291
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Laptop crashes when off A/C

Postby pistacie » 2017-08-10 10:37

Thanks for all the help and sorry for replying so late. When running on one core only, the laptop doesn't crash at all and while the performance hit isn't ideal, it's not to the point of being a dealbreaker for me. The processor is an i7-2640M.

I've set up a temperature display in my panel and it doesn't seem like it's running much cooler when using a single core. Furthermore there's no other options in the BIOS, it's very barebones and I tried every combination of power management settings. Since the single-core performance is fine for my purposes I'll go ahead with your solution wizard, thanks!
pistacie
 
Posts: 7
Joined: 2017-06-25 19:37

Re: Laptop crashes when off A/C

Postby wizard10000 » 2017-08-10 11:06

My first-generation i7 laptop will heat up and throttle back when maxing out *one* core. It's in a home server role now and is happy just serving up files and running network backups.

The comment that led me to believe the problem was not thermal is that you'd have probably mentioned that cooling fans were screaming before the thing shut down. Having both processor thermal protection and motherboard cooling circuits break down at the same time is a little unlikely, but I've been wrong before :)

You can disable processor cores on the fly; I've done it with my own old laptop. The reason I quit doing it is that the transition from four cores to one and back had crashed the machine a couple times over a couple months but you might have better luck.

Glad it worked :)
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1218
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!


Return to General Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable