Topic: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Just to make it clear - This is not an RME related issue! -
Just thought I should post here, as some people (including me) have had
problems with 2011 macbook pro's that have 10.7.x - 10.8.x OS installed.

This is my setup:
Macbook Pro 15" (early 2011)
2,2 GHz Intel Core i7, 8Gt 1333 Mhz DDR3, Intel HD Graphics 3000 512 Mt
OS X 10.8.2
Ableton Live 8.3.4
TMFX 0.989
Fireface UFX


I've had some audio dropouts, and also my cpu usage has often gone through the roof.
I just couldn't figure out what was causing this. Actually I still don't know exactly, but now
I know when this happens, what happens, and how to avoid it.

So...

The problem:

Kernel task uses all cpu (about 200-700%) and causes OS X and apps to freeze and become
very very slow. -> I'm not able to perform with my macbook pro and audio setup at all.

When this happens:

Only when the battery is charging, and to be more precise, only when the battery capacity is
in between 75-95%. So the problem suddenly appears at 75% capacity and disappears when
the capacity reaches the 95% level.
(It took me a while to figure out when exactly this happens, as I usually have my macbook on
my rack fully charged when playing or performing.)

This started when I upgraded my early 2011 macbook pro to 10.8.1 - this was a clean install
(and same problem remains with 10.8.2) pram reset, nvram reset, disc repair, and permission
repair have no effect. I also installed the latest update (02/2013) that fixed some battery issues
with 2011 macbooks, but that didn't help either.
(With 10.6.8 I had no problems like this whatsoever!)

I suppose (I'm not a technician) that os x 10.8. might handle battery charging differently than
10.6.8. Maybe the battery draws more power when the charge is in between 75-95%, and either
the processor is unable to get enough from the 85W power supply, or this is a heat issue and the
battery heats so much that the processor can't handle the heat (although I think the fans are not
spinning at full speed, so this might not be the case), or possibly something completely different..


I also found some similar reports here: https://discussions.apple.com/thread/41 … p;tstart=0


I did send a bug report to apple, and hopefully they'll fix this. Meanwhile I can't recommend it for
anyone with a 2011 macbook pro to upgrade from 10.6.8.
Or if you already have, make sure to have your battery fully charged before an important gig. While
this might only concern a small percentage of 2011 mbp owners, I still think it's good to know that
this kind of a bug exists. At least I won't be upgrading my mbp to a new one before they release the
hashwell upgrade.. I'll just have to try and remember to keep my battery full. neutral

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Upgrading from 10.6 to 10.7 or 10.8 is not a good idea for Ableton Live users anyway. Lion/ML's CPU management gets in the way of Live, or rather, Live isn't able to make the CPU increase its clock-rate and thus suffers from dropouts.

Your observation is interesting and might add another puzzle piece. I am using an early 2011 17" MBP myself and will take a look at this. One possible explanation would be that the communication between your Mac's battery and computer doesn't work properly with 10.8. This could cause the MBP to work at lowest CPU clock-rate, because it thinks that no battery is present. The latter normally happens when the battery is removed, because the tiny 85W power-supply cannot provide enough power on its own.

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Timur Born wrote:

Upgrading from 10.6 to 10.7 or 10.8 is not a good idea for Ableton Live users anyway. Lion/ML's CPU management gets in the way of Live, or rather, Live isn't able to make the CPU increase its clock-rate and thus suffers from dropouts.

Your observation is interesting and might add another puzzle piece. I am using an early 2011 17" MBP myself and will take a look at this. One possible explanation would be that the communication between your Mac's battery and computer doesn't work properly with 10.8. This could cause the MBP to work at lowest CPU clock-rate, because it thinks that no battery is present. The latter normally happens when the battery is removed, because the tiny 85W power-supply cannot provide enough power on its own.

Indeed, upgrading from 10.6.8 might not be a good idea for live users. I decided to give 10.8 a try when I bought a new SSD hard drive for faster boot up times. And for me, upgrading to 10.8 fixed all the weird midi issues I had with 10.6.8, forcing me to unplug and reconnect my midi devices and also to reboot way too often. With 10.8 they all work "plug and play"-way as I expect them to, so that's why I never went back to 10.6.8. Also audio works fine for me, as long as my battery level's not in between 75-95% and charging.  Rarely, but sometimes I do get dropouts with live even at full battery, but I hear it right away and closing and restarting live fixes this.

As for the battery management bug. I fear this might not be an ableton-only bug. But I haven't had the time to test with other processor hungry apps. It starts and stops immediately when the battery level reaches the percent limits, so I think this should be an easy fix for apple, if they just take this seriously. I'm sure someone at their end knows what exactly happens in battery management at these two percentage marks.

I also hope that the next week's Live 9 release (with 64bit support) will bring some improvements to live's cpu handling.

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

You can download Live 9's beta to check for yourself. wink

If you experience dropouts with Live then try a software called "SystemLoad" and put 10% load on each core.

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Timur Born wrote:

You can download Live 9's beta to check for yourself. wink

UUu yeah!! Thanks a lot for the tip! I hadn't noticed that, and of course it's good to try before buy. :-)
I still have to upgrade before next week to get the discount, but at least now I'll know beforehand if everything in my setup works.

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

6

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Thanks for the info! Much appreciated.

Regards
Matthias Carstens
RME

7 (edited by Timur Born 2013-02-28 12:58:09)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

I am currently trying to reproduce this on an early 2011 17" MBP (i7 2.1, 8 GB 1666 RAM), with no success yet.

Some questions: Does it make a difference whether you are disconnecting everything from your Mac, including external display USB device, UFX?

How is the UFX connected (Firewire or USB) and does that make a difference?

What is in your DVD drive bay, the DVD recorder or a second HD?

Does it help to raise the backside of your MBP up by placing something underneath it (watch out not to cover to much of the bottom plate and not to cover the air outlets at the hinge)? Try opening the screen just a hint further than 45°, but not much further and not less than 45°. The reports you linked to reported about a relation to heat, so my MBP is currently sitting on a cushion to help it heat up from loading the battery.

You wrote that you are using the internal Intel graphics, so I assume that Ableton Live is not running (it forces to use the dedicated GPU)?! What happens when you stop all applications (in combination with detaching all external devices)?

Install iStat Menu and take a look at its heat readings, which include current and max battery temps, plus the airflow temp around the DC in. Watch what happens with temps right before the battery reaches 75% and right before the CPU load increases. Also watch the amperages as reported by iStat.

One thing that comes to my mind is that the 75-95% range is special. Above 95% the MBP only load the battery once to 100% and then stops loading until it drops down below 95% again. This is in order to preserve battery life, as the last 5% produce the most heat. Regarding the 75% I can imagine that battery loading is successively slowed down from that point, something many modern loaders do in order to preserve battery life (heat) and keep the battery from melting down (not always successfully). I am currently measuring that.

8 (edited by Timur Born 2013-02-28 14:33:13)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

No luck reproducing your issues here yet and no perceivable change of amperage/power draw at 75%, but rather around 90%. It may start to very gently decline from the 75% point, but I really couldn't see any movement between 75% to 85%. Of course my 17" MBP uses a different (larger) battery, so things may vary.

Did you try to do a full unload (until the MBP switches off by itself) to load cycle?

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Little busy now, but I'll try to test with the iStat menu during the weekend.

What I can answer right now:

-my UFX is always connected with firewire. (So much gear connected to USB already.)
-original dvd recorder inside, no mods there
-I've always kept my macbook raised a bit to let the air flow underneath, but I also just bought this cooler to go under it. Don't know if it will help, but it can't do any harm to try to keep things a bit cooler. The rack gear under my laptop (UFX, yamaha rack synth, and a couple of effects) do generate some heat as well.
-I've done a full battery unload, yes. I try to do it every once in a while.
-I do have an external display connected. (Only 1440x900 resolution, if I remember correctly. Lower than the internal "HD" display's resolution anyway, and I keep the display in mirrored mode) Actually I just wrote what hardware my macbook has. Forgot it has "two" graphic cards. I have to check my preferences to see which one is actually being used.. I haven't even thought of that. Probably using the separate graphics card anyway, I assume.


But I'll get back after testing some more..
Thanks to you for testing also!

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Yes, if when you are using an external display the discrete GPU is used, not the Intel one. Some people in the thread you linked to connected the issue with having the discrete GPU active, so its worth a try to disconnect everything (including UFX and display), close all software (especially Live) and see what happens.

Also try the UFX via USB instead of FW to make sure it's not the culprit at this point. Macbook's FW in combination with audio interfaces behaved erratically concerning CPU load in the past.

11 (edited by bsfreq 2013-03-04 02:47:17)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

All right.. I did 4 tests today measuring with istat menus, and taking lots of screenshots.

It appears that this might indeed be a heat issue, but also a combination of other things. Let me know what you think.

all the screenshots are here: (about 75mb zip file. Sorry, I didn't have the time to take off unnecessary images or make them smaller)

-----------
The 1st test was done the way I've set up normally:
-FW connection to UFX,
-Ableton Live 8.3.4,
-External display connected in mirror mode (both screens at 1440x900 resolution)

I started Live, played something in, and kept live looping after that. I let the battery drain down to 66% before connecting to (85w magsafe) charger. CPU usage (ableton cpu meter) stayed at about 25% all the time. At 18.46, I connected the charger and at first things were running smoothly, - you can see the battery meter is calculating the charge up time, at 18.49 showing 6:31h charge up time, and everything is still ok. At 19.00, only 10 minutes later you can see the battery charge up time is down to 1:20h, so it's charging faster, and that's when the trouble started! (anything above 50% = trouble expected) Just look at the cpu meters.

I then disconnected my external display at 19.01 (all the higher resolution images with ableton window not taking up all the space, are taken when external display is disconnected) And the cpu levels started dropping. They didn't go as low as they should (normally 19-21%) and instead kept at around 30-40%.

Then reconnected the external display and cpu usage started rising again.
The heat is not changing that much, so I think the problem might be simply related to power usage. But again, I'm really not an expert so hopefully someone with better knowledge can step in..

At 19.35, I disconnect the power adapter. CPU usage drops immediately down to 25%!!!

19.37, - connect to power again, and CPU starts rising..

Rest is pretty much the same. Disconnecting the display a couple of times, and just saving readings.

After 95% capacity, the cpu meter stays at around 30%. Still actually a bit more than usually, but acceptable anyway.
-------------------------------

The 2nd test was done with UFX connected via USB. Really no difference there.
Just watch when the battery is charging, when disconnected from power, and when using the internal display only.

---------------------------------

The 3rd test was done with USB connection, but using Live9 Beta (64bit) instead.
The problems remained, but the CPU usage didn't go just as high.
Also the idle (not playing) CPU usage is down to 10% instead of 20%. So some improvement there.  Just a short test here.

-------------------------------------

The last test was done with the laptop cooler and spinning fans under my macbook. Settings were the same as in test no.1.

NOW THIS IS HOW IT SHOULD BE! smile cpu meter at 20% all the time, even when charging.
I guess the cooler does something. But honestly, to me it looks that the heat difference is not that big. Even the laptop fan speed is pretty much the same as in other tests. But I guess it's just enough to keep things running.

Without the cooler, I was able to keep things running somewhat ok with the external display, by using
nosleep extension, that allows me to close my macbook lid and internal display, while keeping external display running. However, I often need to access my laptop display, keyboard and mouse too, so this is just a bad backup solution for me.

I still think I should blame the 10.8 power management for this issue. I had my macbook on the very same rack when using 10.6.8, and everything ran ok there. The os x should be able to keep things running smoothly - and simply charge the battery slower if necessary! Or there should be some software to disable charging, when computing power is really needed.

I'm tired, probably unclear with my writing, and need to go to sleep now. Hopefully you can still find some info from this post. smile

Good night!

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

One more thing to try is to run the external display in extended mode instead of mirroring. Mirroring has to resize down the image for your external display (unless it uses 1440x900 natively) and I am not so sure that this is done by the GPU with OS X, especially after the Retina changes.

And there is another caveat: CPU load percentages are relative to the current clock-rate. So 40% of 800 mHz is better than 20% of 2200 mHz.

Try running a tool called SystemLoad with 10-20% (ore even more) load on all cores while doing your tests. This will keep the CPU clock-rate more stable.

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

I actually need to have the same content on the two displays, so that's why I run them mirrored.
(One reason is that I have programmed mouse movements and clicks to do multiple tasks for me quickly in between, and in the middle of songs. And they depend on the resolution of the screen to hit the right spot)
1440x900 is the native resolution of my external display, and when connecting, os x just drops the internal display to that resolution too.

I tried the systemload, but results were more or less the same as in my first test. At first it seemed a bit more stable, but when the problems kicked in, they kicked in again. Cpu didn't go all the way up to 100% this time, but problems were the same anyway.. So after battery starts loading more intensively, the cpu meter starts rising. A good indicator for me is when my programmed keypress combos start to slow down. Then I know that audio drops will happen soon too.

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

The display/resolution stuff was only meant for testing (getting away from non native resolutions). But in the end all of this sounds like an OS X or Macbook bug (or a combination of OS X with the 15" MBP as my 17" does not show this kind of behavior).

Did I miss this or did you not report yet what happens when you disconnect _all_ external devices while the battery is loading?

What happens when you restart the Mac while the battery is within the 75-95% state? Does CPU load go off the roof right after rebooting?

One more thing comes into my mind: A broken battery electronic/communication that makes the Mac think that it's running without any battery at all while running within the 75-95% boundary. You could screw open the bottom place of the MBP, umplug the battery cable (it's a single easily found plug) and compare if the resulting performance and CPU load are the same as what you experience.

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Timur Born wrote:

Did I miss this or did you not report yet what happens when you disconnect _all_ external devices while the battery is loading?

No you didn't miss. I forgot to mention it. Unplugging USB devices does nothing, unplugging external display drops cpu a bit, and unplugging UFX (disconnecting ableton audio device) drops cpu to normal idle levels. Also quitting ableton drops the cpu usage to normal idle levels.

Timur Born wrote:

What happens when you restart the Mac while the battery is within the 75-95% state? Does CPU load go off the roof right after rebooting?

Yes it does. I quitted ableton, rebooted (actually had somekind of a crash while rebooting.. report here) Then started ableton again, and cpu meter jumped right up to over 80%

Timur Born wrote:

One more thing comes into my mind: A broken battery electronic/communication that makes the Mac think that it's running without any battery at all while running within the 75-95% boundary. You could screw open the bottom place of the MBP, umplug the battery cable (it's a single easily found plug) and compare if the resulting performance and CPU load are the same as what you experience.

I quickly took my MBP to a local apple repair last friday, and they did some kind of a quick test and said that the communication between mac and the battery should be fine. However I might take this back for them to do some more testing..

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Ah, wait a minute. ;-)

This only happens while Ableton Live is running? Not with other software?

17 (edited by bsfreq 2013-03-04 15:56:20)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Timur Born wrote:

Ah, wait a minute. ;-)

This only happens while Ableton Live is running? Not with other software?

Well ableton live is the one software I've been testing with. And I also know how live should behave.  (I said I fear this might not be an ableton-only bug, but I really don't know.) I tried rendering with final cut pro, and the cpu is up to 100%, but I don't know how that software is supposed to behave. Maybe it's ok to have it render with 100% cpu usage. No need to perform or worry about audio cut offs while rendering. On apple support communities discussion people don't mention the apps they're using, so I assumed this might be a more universal problem and not exlusively an ableton issue.


But that's right, my post was all along about problems with cpu usage while using ableton on 10.8.2.

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Ok, then I will test this again, because I only tested without running Live (expecting a general issue). Ableton Live generally has issues with both 10.7 and 10.8 because of CPU power-management. This could just be another culprit. Will check and get back to you.

19 (edited by bsfreq 2013-03-05 13:42:06)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Timur Born wrote:

Ok, then I will test this again, because I only tested without running Live (expecting a general issue). Ableton Live generally has issues with both 10.7 and 10.8 because of CPU power-management. This could just be another culprit. Will check and get back to you.

Cool, thanks a lot for your trouble!

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

20 (edited by Timur Born 2013-03-06 11:27:16)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Do you load any specific Live set or just load Live with an empty set and let it run idle? Still no luck reproducing with Live 8.3.4. Are you running your kernel in 32-bit or 64-bit mode (default is 32-bit, which is what I just tested).

21 (edited by bsfreq 2013-03-08 21:13:13)

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

Timur Born wrote:

Do you load any specific Live set or just load Live with an empty set and let it run idle? Still no luck reproducing with Live 8.3.4. Are you running your kernel in 32-bit or 64-bit mode (default is 32-bit, which is what I just tested).

Hi Timur, and sorry for the delay.

I tried to determine whether my 10.8.2 uses 32 or 64 bit kernel. (my system is in finnish, but in system info -> software, it only says something like "boot state: normal" nothing about 32 or 64bit. So where to find this info?

On this apple support page they say that "If you are using OS X Mountain Lion, switching to a 32-bit kernel is not supported. Mountain Lion uses 64-bit mode."

In iddle mode the cpu usage is naturally down do decent percentages. What set I'm running doesn't matter. Can you try to reach the 20% cpu usage (live's cpu meter) somehow? Play some audio, have some effects on tracks and drop the sample buffer down to get cpu high enough. 20% is the normal cpu usage in my sets when playing. And it stays steadily there unless I'm charging..

RME Fireface UFX+ | RME Fireface UFX | RME Babyface Pro |

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

any further progress this issue? i may have a related problem.. were you able to isolate this to a heat problem??

soundcloud.com/wndfrm

Re: Kernel_task uses up all cpu% when charging my 2011 mbp at 75-95%

When I tried to reproduce the problem I used both 32 and 64 bit kernels and tried to several CPU load scenarios. Unfortunately I have not been able to reproduce it on my setup.