Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a CPU intensive command on Mavericks (Opencv_traincasscade). Under Mountain Lion the process used to use all 8 cores all the way though. However after upgrading it drops to 1 core after a short time.

enter image description here

Could this be app nap? Is there anything I can do to fix this?

share|improve this question
up vote 7 down vote accepted

Being able to use multiple-cores or threads is dependent on the process. This is not AppNap or OS X causing the change.

Your process, opencv_traincascade, may be resource constrained after a few moments and thus reduced to queuing up tasks as it waits for disk access or another limited resource.

In this case you may need to switch to a different build of OpenCV:

Note that opencv_traincascade application can use TBB for multi-threading. To use it in multicore mode OpenCV must be built with TBB.

Installing OpenCV with TBB via brew:

brew install opencv --with-tbb
share|improve this answer
Thanks you for the answer, I will definitely give that a go. However, there are 2 reasons why I think it might not be the case. Firstly, the CPU did hit 800% for a few mins when it started, which suggested that OpenCV is capable of using all cores. Secondly I never encountered this problem on Mountain lion (however, I cant be 100% sure if it was the same build). The -mode parameter is related to rotation of feature detection not cores I believe. – Robert May 26 '14 at 14:33
Actually I take that back! You were right :D I'm going to answer for completeness. – Robert May 26 '14 at 16:49

Graham Miln was correct - the OpenCV installation was wrong.

To verify this:

otool -L /usr/local/lib/libopencv_core.2.4.9.dylib
# Look for libtbb.dylib in the response,
# if missing you need to reinstall with tbb.

To fix this (assuming you installed with homebrew):

brew uninstall opencv
brew info opencv # This will tell you about other flags you might be interested in.
brew install opencv --with-tbb  # Simples! :)
share|improve this answer
Rather than being a separate answer, consider appending this to your question. – Graham Miln May 26 '14 at 17:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.