Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mactinkerlover

macrumors regular
Original poster
Sep 20, 2020
174
113
So with apple silicon, is there a way you can make something run only on the efficiency cores? As a stupid experiment, I want to run cinebench only om the efficiency cores to see how powerful the efficiency cores are alone? Any way to do this?
 
So with apple silicon, is there a way you can make something run only on the efficiency cores? As a stupid experiment, I want to run cinebench only om the efficiency cores to see how powerful the efficiency cores are alone? Any way to do this?
If you have code-level access you could set the threading priority through the QoS parameter to .background which should keep it on the efficiency cores.
But I'm not aware of any way of forcing the scheduler's behaviour, especially not without code level access, and even then the scheduler is free to put threads wherever it wants
 
If you have code-level access you could set the threading priority through the QoS parameter to .background which should keep it on the efficiency cores.
But I'm not aware of any way of forcing the scheduler's behaviour, especially not without code level access, and even then the scheduler is free to put threads wherever it wants
Any idea how to get code level access on a mac app? Could i get it somewhere in package contents or something?
 
Any idea how to get code level access on a mac app? Could i get it somewhere in package contents or something?
PS I was digging around the cinebench package contents. Would it be the unix executible file under MacOS folders in the package contents that would contain the code? Where in the code would I find and tweak to get it to run only on the efficiency cores or add the parameter?
 
Any idea how to get code level access on a mac app? Could i get it somewhere in package contents or something?

PS I was digging around the cinebench package contents. Would it be the unix executible file under MacOS folders in the package contents that would contain the code? Where in the code would I find and tweak to get it to run only on the efficiency cores or add the parameter?

You would want the source code. These benchmark applications are closed source. While perhaps technically possible to hack it into the binary with a hex editor doing that kind of thing is not something you just do real quick. And depending on how the compiler has laid out things adding another argument to a call could affect following procedures as well; Long version short. You can't.
My comment about having code access would be relating to benchmarks you code yourself or that come from open source that you can modify, not packaged apps or binaries
 
You would want the source code. These benchmark applications are closed source. While perhaps technically possible to hack it into the binary with a hex editor doing that kind of thing is not something you just do real quick. And depending on how the compiler has laid out things adding another argument to a call could affect following procedures as well; Long version short. You can't.
My comment about having code access would be relating to benchmarks you code yourself or that come from open source that you can modify, not packaged apps or binaries
Well, thanks for your reply! I guess this is something the developer would have to add or I would have to recompile another version of it myself which i definitely don't have the time or the know how to do that.
 
Well, thanks for your reply! I guess this is something the developer would have to add or I would have to recompile another version of it myself which i definitely don't have the time or the know how to do that.

Yes. And you also don't have the resources required; Geekbench and Cinebench are not open source projects. You can't just edit their source and recompile them, because only their respective companies have the source code.

However! I do not have an M1 so have no idea how or if this affects scheduling of performance/efficiency cores - my knowledge of scheduling is limited to what Apple's developer documentation says and working with A series chips on iOS. BUT! On macOS you can modify the "niceness" of a running process. The nice value is meant to represent how much priority the scheduler gives a given process relative to other process. Setting nice to 20 for a given process may make it more likely to run on efficiency cores, but would also lower its priority on those cores relative to other processes running on them, and I honestly would expect the scheduler to still push it to performance cores when it sees the high usage, especially if the app itself sets the QoS value to .priority; But it could be worth a try
 
Yes. And you also don't have the resources required; Geekbench and Cinebench are not open source projects. You can't just edit their source and recompile them, because only their respective companies have the source code.

However! I do not have an M1 so have no idea how or if this affects scheduling of performance/efficiency cores - my knowledge of scheduling is limited to what Apple's developer documentation says and working with A series chips on iOS. BUT! On macOS you can modify the "niceness" of a running process. The nice value is meant to represent how much priority the scheduler gives a given process relative to other process. Setting nice to 20 for a given process may make it more likely to run on efficiency cores, but would also lower its priority on those cores relative to other processes running on them, and I honestly would expect the scheduler to still push it to performance cores when it sees the high usage, especially if the app itself sets the QoS value to .priority; But it could be worth a try
Thanks for the reply. Can you give me what I would type into the terminal for the nice command? And also, what do I do to reset everything to default after I'm done?
 
Thanks for the reply. Can you give me what I would type into the terminal for the nice command? And also, what do I do to reset everything to default after I'm done?

As always the way to use the command can be found from its manual page. To view a manual type man <command>, in this case "man nice"

1610583714678.png
So to run the Geekbench program with the lowest priority for scheduling
nice -n +20 <pathToTheGeekbenchExecutable>

mind, the executable, not the app bundle
 
A bit late... but I just discovered that App Tamer can force an App to run with Efficiency cores, when in the background.
If you want the fontmost app running with such cores too, you have to hold the Option key while clicking on the App you want to limit, in App Tamer, to display this feature.

The software is available here, with 15 days of demo: https://www.stclairsoft.com/AppTamer/index.html
 
  • Like
Reactions: jchap
If anyone is interested in a command line approach, I’ve published a tool for this called runbg.

Source code is available here: runbg.swift on GitHub

Or download already compiled binary:

Bash:
mkdir -p /usr/local/bin
curl https://files.alinpanaitiu.com/runbg > /usr/local/bin/runbg
chmod +x /usr/local/bin/runbg
runbg

Usage examples:


Bash:
# Optimize all images on the desktop:
runbg imageoptim ~/Desktop

# Re-encode video with ffmpeg to squeeze more bytes:
runbg ffmpeg -i big-video.mp4 smaller-video.mp4

# Compile project in background:
runbg make -j 4
 
Well, while MacOS does not come with something like taskset on Linux, it does come with a command line tool for setting - besides various other things - the scheduling policies - amongst these the desired Quality of Service (QoS).
You are able to indicate a preference of your program to run on the energy-efficient cores by running a program from the terminal like this:

taskpolicy -c background your_program

I know people who force XCode this way to compile using the e-Cores.
 
Last edited:
  • Like
Reactions: pierrespartan
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.