Can you disable CPU cores in OSX?

Discussion in 'Mac Pro' started by Anim, Jan 21, 2014.

  1. Anim macrumors 6502a

    Anim

    Joined:
    Dec 16, 2011
    Location:
    Macclesfield, UK
    #1
    Hi

    Just wondering if additional cores on the nMP (6,8,12) can be disabled with the belief that some software could benefit from higher turbo boost on 2 or 3 cores if forced, compared to lower clock rate speeds if all cores are available.

    Just a theory. No idea if this is possible in OSX or if it will have an impact on software that doesn't make good use of multi-threading within OSX.

    Anim
     
  2. 666sheep macrumors 68040

    666sheep

    Joined:
    Dec 7, 2009
    Location:
    Poland
    #2
    Yes, you can. Use Xcode Instruments.app. You can set active cores amount in preferences. You can enable/disable hyperthreading as well. See attachment.
     

    Attached Files:

  3. Anim thread starter macrumors 6502a

    Anim

    Joined:
    Dec 16, 2011
    Location:
    Macclesfield, UK
    #3
    Brilliant thanks.
     
  4. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #4
    My understanding of the way this works is if the app is not multi-threaded to start with then it will not use the extra cores anyways. So there is no need to disable as it will just use the turbo as a non-threaded app will do so. That is the whole point of the turbo non-threaded gets boost multi-threaded does not all done automatically by the logic built in the chip(s).
     
  5. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #5
    I'm interested in the result. Let us know if the theory pans out.
     
  6. CrazyNurse macrumors regular

    Joined:
    Oct 23, 2012
    #6
    Newb here to the MacPro…

    Why would you want to do this?

    Energy efficiency and Thermoregulation?:confused:
     
  7. Ludacrisvp macrumors member

    Joined:
    May 14, 2008
    #7
    Edit the /Library/Preferences/SystemConfiguration/com.apple.Boot.plist file. Add the cpus=1 flag inside the Kernel flags string section like shown below. then reboot.

    Code:
    $ cat /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Kernel</key>
    	<string>mach_kernel</string>
    	<key>Kernel Flags</key>
    	<string>cpus=1</string>
    </dict>
    </plist>
    https://developer.apple.com/library...nce/ManPages/man5/com.apple.Boot.plist.5.html
    Code:
         The com.apple.Boot.plist is a standard plist(5) format Core Foundation property list stored in XML for-mat. format.
         mat. Keys are generally strings like Kernel Flags, with either string or integer values. The following
         key-values are currently supported:
    
         Kernel Flags
                [string] This option specifies arguments to be passed directly to the kernel to change its
                behavior (although some kernel options are parsed by the booter as well for correctness). Common
                options include "debug=0x144" to enable kernel debugging, "-v" to enable verbose boot, "-s" to
                boot to single user mode, "cpus=1" to simulate a single core system, and "maxmem=1024" to cap
                available memory to 1024 MB RAM. All desired options should be space-separated within the
                <string> tag. The default value is the empty string.
     
  8. wheelhot macrumors 68020

    Joined:
    Nov 23, 2007
    #8
    I could be wrong, but I believe by disabling the other cores (providing the software you use doesn't make use of extra cores), it'll activate Intel Turbo Boost to run longer, so a 2.2 GHz CPU will perform at 3.2 GHz instead. So technically, those software that doesn't make use of the CPU cores will run faster
     
  9. Anim thread starter macrumors 6502a

    Anim

    Joined:
    Dec 16, 2011
    Location:
    Macclesfield, UK
    #9
    Yeah, thats my thinking. People do this on windows if you google about so it must have its uses somewhere. When my 6 core nMP arrives and I start testing it out I will throw this into the mix on some benchmarks and see what happens.

    Edit: Also, some benchmarks show that the 4 core nMP is quicker than the 6 core on some benchmarks due to the higher base clock speed. So, can I force a 6 core mac pro to kick its 3.9 turbo boost on by disabling 2 cores and run the same benchmark for example.

    ----------

    Cheers for that too.
     
  10. wheelhot macrumors 68020

    Joined:
    Nov 23, 2007
    #10
    I've ordered the 4 core nMP, no need to disable any cores :p

    And primarily why I preferred the 4 core vs 6 core is mainly for the higher base clock speed and the fact that the software I use doesn't make much use of multi-core. Though I'm now tempted to disable 2 cores in Windows and see if it'll boost the clock speed to be higher, as my 3D CAD software will love it.
     
  11. AidenShaw macrumors P6

    AidenShaw

    Joined:
    Feb 8, 2003
    Location:
    The Peninsula
    #11
    kill hyperthreading

    I noticed that the Xcode tool had a checkbox to turn off hyperthreading.

    That's definitely a win unless your important loads keep most of the virtual cores at 100%.
     
  12. Anim thread starter macrumors 6502a

    Anim

    Joined:
    Dec 16, 2011
    Location:
    Macclesfield, UK
    #12
    Yeah, also notice some people in the windows world disable hyper threading in BIOS. If it can squeeze a 10%+ boost from any hard working app/game then having this realtime toggle in OSX will make that so much easier to do.
     
  13. ha1o2surfer macrumors 6502

    Joined:
    Sep 24, 2013
    #13
    disable hyper threading causes a reduction in performance for mutlithreaded apps. Single threaded apps can see a little performance boost. I would leave hyper threading enabled as it can hurt performance. (Coming from a guy who has had it disabled for a couple months)
     
  14. goMac macrumors 603

    Joined:
    Apr 15, 2004
    #14
    You can disable the extra cores.

    This will not have an impact on performance or turbo boost, besides the performance decrease a loss of cores will bring.
     
  15. Ludacrisvp macrumors member

    Joined:
    May 14, 2008
    #15
    I really cannot see the benefit of doing this, clearly having multiple cores and threads help, as it is about the only way we have been making cpus "faster" for the last several years when we hit the 4GHz wall.
     
  16. AidenShaw macrumors P6

    AidenShaw

    Joined:
    Feb 8, 2003
    Location:
    The Peninsula
    #16
    If you have no more active threads than physical cores, hyperthreading can be slower than using just the physical cores.

    Of course, if your important tasks peg all the virtual cores for long periods of time - you'll want hyperthreading on.

    The threshold isn't single vs. multi - it's whether you have more active threads than physical cores for the work that's important to you.
     
  17. pukifloyd macrumors 6502a

    pukifloyd

    Joined:
    Jun 25, 2008
    Location:
    Scottsdale
    #17
    Another newb here :rolleyes:

    Will this work for a MBP? hypothetically, can I disable two cores out of the four to gain some extra battery life while just surfing internet or using pages? I'm sure it won't overclock the available cores since it'll only be safari that's running...unless safari uses all four cores. :confused:

    Sorry if this is a dumb idea...I just want to know if it's possible!
    Thank you guys.
     
  18. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #18
    Modern cpus already have the ability to shutdown unused cores if it is needed to conserve power.
     
  19. AidenShaw macrumors P6

    AidenShaw

    Joined:
    Feb 8, 2003
    Location:
    The Peninsula
    #19
    Intel CPUs can "park cores", essentially turning them on and off on the fly. Win7 and later do this when cores aren't needed.

    If Apple OSX supports "core parking", then there would be no point in manually doing it.

    Some people on the Internet have said that OSX supports parking, but searching Apple.com didn't get any hits.
     
  20. ha1o2surfer macrumors 6502

    Joined:
    Sep 24, 2013
    #20
    A single core app, when presented with a hyper threaded CPU, only uses 1/2 of a core.
     
  21. pukifloyd macrumors 6502a

    pukifloyd

    Joined:
    Jun 25, 2008
    Location:
    Scottsdale
    #21
    Interesting. I'll do some more research on this. Thanks guys!
     
  22. AidenShaw macrumors P6

    AidenShaw

    Joined:
    Feb 8, 2003
    Location:
    The Peninsula
    #22
    Apps don't have cores, they have processes with threads and fibers which are scheduled to run on logical cores.

    An app with a single executing thread uses one logical core.
    ________

    Your system, however, is always running lots of apps. (My W530 quad laptop right now has 225 processes and 1408 threads. It's running at 85% usage - or the equivalent of 7 of the 8 logical cores pegged.)

    Most of these are system processes and most of them are idle most of the time - so we tend to forget about them.

    The problem with hyperthreading is that there are times when there are idle physical cores (both logical cores idle) yet there are other physical cores running two threads (both logical cores busy).

    You don't want this to happen, and if your important loads have no more active threads than the number of physical cores, you can prevent it by disabling hyperthreading.
     
  23. liquid stereo macrumors regular

    Joined:
    Jan 21, 2005
    Location:
    Saint Paul
    #23
    MPI and hyperthreading

    This is informative
    http://www.nersc.gov/users/computat...performance-and-optimization/hyper-threading/


     

Share This Page