Can you disable CPU cores in OSX?

Anim

macrumors 6502a
Original poster
Dec 16, 2011
614
22
Macclesfield, UK
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
 

MacUser2525

macrumors 68000
Mar 17, 2007
1,781
198
Canada
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
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).
 

CrazyNurse

macrumors regular
Oct 23, 2012
147
3
Newb here to the MacPro…

Why would you want to do this?

Energy efficiency and Thermoregulation?:confused:
 

Ludacrisvp

macrumors 6502
May 14, 2008
334
121
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/mac/documentation/Darwin/Reference/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.
 

wheelhot

macrumors 68020
Nov 23, 2007
2,080
249
Newb here to the MacPro…

Why would you want to do this?

Energy efficiency and Thermoregulation?:confused:
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
 

Anim

macrumors 6502a
Original poster
Dec 16, 2011
614
22
Macclesfield, UK
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
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.

----------

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.
Cheers for that too.
 

wheelhot

macrumors 68020
Nov 23, 2007
2,080
249
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.
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.
 

AidenShaw

macrumors P6
Feb 8, 2003
18,086
4,147
The Peninsula
kill hyperthreading

Newb here to the MacPro…

Why would you want to do this?

Energy efficiency and Thermoregulation?:confused:
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%.
 

Anim

macrumors 6502a
Original poster
Dec 16, 2011
614
22
Macclesfield, UK
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%.
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.
 

ha1o2surfer

macrumors 6502
Sep 24, 2013
348
12
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)
 

goMac

macrumors 604
Apr 15, 2004
6,765
782
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
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.
 

Ludacrisvp

macrumors 6502
May 14, 2008
334
121
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.
 

AidenShaw

macrumors P6
Feb 8, 2003
18,086
4,147
The Peninsula
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)
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.
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.
 

pukifloyd

macrumors 6502a
Jun 25, 2008
985
83
Scottsdale
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.
 

MacUser2525

macrumors 68000
Mar 17, 2007
1,781
198
Canada
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.
Modern cpus already have the ability to shutdown unused cores if it is needed to conserve power.
 

AidenShaw

macrumors P6
Feb 8, 2003
18,086
4,147
The Peninsula
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.
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.
 

ha1o2surfer

macrumors 6502
Sep 24, 2013
348
12
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.
A single core app, when presented with a hyper threaded CPU, only uses 1/2 of a core.
 

pukifloyd

macrumors 6502a
Jun 25, 2008
985
83
Scottsdale
Modern cpus already have the ability to shutdown unused cores if it is needed to conserve power.
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.
Interesting. I'll do some more research on this. Thanks guys!
 

AidenShaw

macrumors P6
Feb 8, 2003
18,086
4,147
The Peninsula
A single core app, when presented with a hyper threaded CPU, only uses 1/2 of a core.
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.
 

liquid stereo

macrumors regular
Jan 21, 2005
163
19
Saint Paul
MPI and hyperthreading

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


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.
 

IG88

macrumors 6502
Nov 4, 2016
488
477
I know this is an old thread, but this is what I did on my 2018 MBP 15. The setting is for logical cores. My MBP has 12 logical cores and I want to run 8:

sudo nvram boot-args="cpus=8"

Then reboot.

You can then open Activity Monitor". Click on the "CPU" tab at the bottom of the Activity Monitor window to display processor-use stats and a live stacked-column activity graph.

Any benchmark test will show you that 8 logical cores are running.
 

Ludacrisvp

macrumors 6502
May 14, 2008
334
121
I know this is an old thread, but this is what I did on my 2018 MBP 15. The setting is for logical cores. My MBP has 12 logical cores and I want to run 8:

sudo nvram boot-args="cpus=8"

Then reboot.

You can then open Activity Monitor". Click on the "CPU" tab at the bottom of the Activity Monitor window to display processor-use stats and a live stacked-column activity graph.

Any benchmark test will show you that 8 logical cores are running.
I’m curious as to why you’d want to do this?