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

Shiunbird

macrumors newbie
Original poster
Nov 20, 2020
22
12
Hello everyone,

I've been happily running a cMP 4.1 -> 5.1 with Mojave now, and the following hardware setup:

- 2x X5675
- 64GB ECC RAM (6 sticks)
- RX580 (Orinoco, flashed MacVidCards)
- TB3, NVMe
- Dual boot Windows 10 and Mojave.

When I boot into Windows, the CPU throttles down when the computer is idle, helping reduce power consumption. I can also see that it turbo boots to 3.3GHz when I push the system hard. In Mac OS, when I run the following code:

Code:
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>

uint64_t rdtsc(void)
{
    uint32_t ret0[2];
    __asm__ __volatile__("rdtsc" : "=a"(ret0[0]), "=d"(ret0[1]));
    return ((uint64_t)ret0[1] << 32) | ret0[0];
}

int main(int argc, const char * argv[])
{
    uint64_t startCount = rdtsc();
    sleep(1);
    uint64_t endCount = rdtsc();

    printf("Clocks per second: %llu", endCount - startCount);

    return 0;
}

I always get that the computer is running at 3.06 GHz. I can't use the Intel Power Gadget, because it is not compatible with dual socket systems. My questions are:

- Does OpenCore affect the computer's ability to throttle down? I don't want to uninstall OpenCore just to test my hypothesis.
- If that's the case, are there any OpenCore flags that I could adjust?
- When I run the code above, does it upspeed the CPU to execute?

This is not serious and I can live without it, but it would be very nice to save 5-10W. My OpenCore configuration is attached.

Thanks, as always.
 

Attachments

  • config.txt
    13.7 KB · Views: 105

startergo

macrumors 603
Sep 20, 2018
5,022
2,283
Hello everyone,

I've been happily running a cMP 4.1 -> 5.1 with Mojave now, and the following hardware setup:

- 2x X5675
- 64GB ECC RAM (6 sticks)
- RX580 (Orinoco, flashed MacVidCards)
- TB3, NVMe
- Dual boot Windows 10 and Mojave.

When I boot into Windows, the CPU throttles down when the computer is idle, helping reduce power consumption. I can also see that it turbo boots to 3.3GHz when I push the system hard. In Mac OS, when I run the following code:

Code:
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>

uint64_t rdtsc(void)
{
    uint32_t ret0[2];
    __asm__ __volatile__("rdtsc" : "=a"(ret0[0]), "=d"(ret0[1]));
    return ((uint64_t)ret0[1] << 32) | ret0[0];
}

int main(int argc, const char * argv[])
{
    uint64_t startCount = rdtsc();
    sleep(1);
    uint64_t endCount = rdtsc();

    printf("Clocks per second: %llu", endCount - startCount);

    return 0;
}

I always get that the computer is running at 3.06 GHz. I can't use the Intel Power Gadget, because it is not compatible with dual socket systems. My questions are:

- Does OpenCore affect the computer's ability to throttle down? I don't want to uninstall OpenCore just to test my hypothesis.
- If that's the case, are there any OpenCore flags that I could adjust?
- When I run the code above, does it upspeed the CPU to execute?

This is not serious and I can live without it, but it would be very nice to save 5-10W. My OpenCore configuration is attached.

Thanks, as always.
That is a good question. @h9826790 I think you did some test in this respect, correct? VMM is disabled during this test in OSX, right?
 

startergo

macrumors 603
Sep 20, 2018
5,022
2,283
Try this:
Code:
#include <sys/sysctl.h>
#include <sys/time.h>

  int mib[2];
  size_t len;
  mib[0] = CTL_KERN;
  mib[1] = KERN_CLOCKRATE;
  struct clockinfo clockinfo;
  len = sizeof(clockinfo);
  int result = sysctl(mib, 2, &clockinfo, &len, NULL, 0);
  assert(result != -1);
  log_trace("clockinfo.hz: %d\n", clockinfo.hz);
  log_trace("clockinfo.tick: %d\n", clockinfo.tick);
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
That is a good question. @h9826790 I think you did some test in this respect, correct? VMM is disabled during this test in OSX, right?
Correct, turn on the VMM will lock the CPU at the base clock speed in macOS, can't go up, and won't go down.

However, I don't know if his code can really read the CPU clock speed in real time.

So far, in macOS, I can only get the CPU real time clock speed via Linkpack (when the test start). All other software either doesn't work, or can only read the base clock speed.
 

startergo

macrumors 603
Sep 20, 2018
5,022
2,283
Hello everyone,

I've been happily running a cMP 4.1 -> 5.1 with Mojave now, and the following hardware setup:

- 2x X5675
- 64GB ECC RAM (6 sticks)
- RX580 (Orinoco, flashed MacVidCards)
- TB3, NVMe
- Dual boot Windows 10 and Mojave.

When I boot into Windows, the CPU throttles down when the computer is idle, helping reduce power consumption. I can also see that it turbo boots to 3.3GHz when I push the system hard. In Mac OS, when I run the following code:

Code:
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>

uint64_t rdtsc(void)
{
    uint32_t ret0[2];
    __asm__ __volatile__("rdtsc" : "=a"(ret0[0]), "=d"(ret0[1]));
    return ((uint64_t)ret0[1] << 32) | ret0[0];
}

int main(int argc, const char * argv[])
{
    uint64_t startCount = rdtsc();
    sleep(1);
    uint64_t endCount = rdtsc();

    printf("Clocks per second: %llu", endCount - startCount);

    return 0;
}

I always get that the computer is running at 3.06 GHz. I can't use the Intel Power Gadget, because it is not compatible with dual socket systems. My questions are:

- Does OpenCore affect the computer's ability to throttle down? I don't want to uninstall OpenCore just to test my hypothesis.
- If that's the case, are there any OpenCore flags that I could adjust?
- When I run the code above, does it upspeed the CPU to execute?

This is not serious and I can live without it, but it would be very nice to save 5-10W. My OpenCore configuration is attached.

Thanks, as always.
Code:
g5@G5s-Mac-Pro cpu_freq_logger-master % /Users/g5/Library/Developer/Xcode/DerivedData/cpuclock-ddnkeeehsssdjzbscwqdlgmmkvex/Build/Products/Debug/cpuclock
Clocks per second: 3464906939%                                                                                                                                                                       g5@G5s-Mac-Pro cpu_freq_logger-master % /Users/g5/Library/Developer/Xcode/DerivedData/cpuclock-ddnkeeehsssdjzbscwqdlgmmkvex/Build/Products/Debug/cpuclock
Clocks per second: 3459538204%                                                                                                                                                                       g5@G5s-Mac-Pro cpu_freq_logger-master % /Users/g5/Library/Developer/Xcode/DerivedData/cpuclock-ddnkeeehsssdjzbscwqdlgmmkvex/Build/Products/Debug/cpuclock
Clocks per second: 3475396010%                                                                                                                                                                       g5@G5s-Mac-Pro cpu_freq_logger-master % /Users/g5/Library/Developer/Xcode/DerivedData/cpuclock-ddnkeeehsssdjzbscwqdlgmmkvex/Build/Products/Debug/cpuclock
Clocks per second: 3464001460%                                                                                                                                                                       g5@G5s-Mac-Pro cpu_freq_logger-master % /Users/g5/Library/Developer/Xcode/DerivedData/cpuclock-ddnkeeehsssdjzbscwqdlgmmkvex/Build/Products/Debug/cpuclock
Clocks per second: 3461711534%                                                                                                                                                                       g5@G5s-Mac-Pro cpu_freq_logger-master % /Users/g5/Library/Developer/Xcode/DerivedData/cpuclock-ddnkeeehsssdjzbscwqdlgmmkvex/Build/Products/Debug/cpuclock
Clocks per second: 3467308101%

I ran that code several times outside of OC. If you are expecting to see idle speed like in Windows I don't think it is gonna happen.
 
  • Like
Reactions: h9826790

Shiunbird

macrumors newbie
Original poster
Nov 20, 2020
22
12
Hello everyone,

I'm sorry it took me so long to get back to you on this.
I removed my RX 580 and installed my RX 560. The system idles at 120W.

I couldn't run the code posted by startergo. gcc gives me tons of warnings. I went to xcode to try to fix it, there's something wrong with the array there, but I have a very rudimentary knowledge of programming, so it would take me too long to fix.

BUT...

I donwloaded linpack and... voila:
Code:
This is a SAMPLE run script for running a shared-memory version of
Intel(R) Distribution for LINPACK* Benchmark. Change it to reflect
the correct number of CPUs/threads, problem input files, etc..
*Other names and brands may be claimed as the property of others.
Thu Jan 14 11:35:38 CET 2021
Sample data file lininput.

Current date/time: Thu Jan 14 11:35:38 2021

CPU frequency:    1.974 GHz
Number of CPUs: 2
Number of cores: 12
Number of threads: 12

Parameters are set to:

Number of tests: 9
Number of equations to solve (problem size) : 15000 14000 13000 12000 11000 10000 8000  6000  1000
Leading dimension of array                  : 15000 14008 13000 12008 11000 10008 8008  6008  1000
Number of trials to run                     : 1     2     2     2     2     2     2     3     4   
Data alignment value (in Kbytes)            : 4     4     4     4     4     4     4     4     4   

Maximum memory requested that can be used=1800304096, at the size=15000

=================== Timing linear equation system solver ===================

Size   LDA    Align. Time(s)    GFlops   Residual     Residual(norm) Check
^C

1.974 GHz! I think we are good.
(with OpenCore)
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
Hello everyone,

I'm sorry it took me so long to get back to you on this.
I removed my RX 580 and installed my RX 560. The system idles at 120W.

I couldn't run the code posted by startergo. gcc gives me tons of warnings. I went to xcode to try to fix it, there's something wrong with the array there, but I have a very rudimentary knowledge of programming, so it would take me too long to fix.

BUT...

I donwloaded linpack and... voila:
Code:
This is a SAMPLE run script for running a shared-memory version of
Intel(R) Distribution for LINPACK* Benchmark. Change it to reflect
the correct number of CPUs/threads, problem input files, etc..
*Other names and brands may be claimed as the property of others.
Thu Jan 14 11:35:38 CET 2021
Sample data file lininput.

Current date/time: Thu Jan 14 11:35:38 2021

CPU frequency:    1.974 GHz
Number of CPUs: 2
Number of cores: 12
Number of threads: 12

Parameters are set to:

Number of tests: 9
Number of equations to solve (problem size) : 15000 14000 13000 12000 11000 10000 8000  6000  1000
Leading dimension of array                  : 15000 14008 13000 12008 11000 10008 8008  6008  1000
Number of trials to run                     : 1     2     2     2     2     2     2     3     4  
Data alignment value (in Kbytes)            : 4     4     4     4     4     4     4     4     4  

Maximum memory requested that can be used=1800304096, at the size=15000

=================== Timing linear equation system solver ===================

Size   LDA    Align. Time(s)    GFlops   Residual     Residual(norm) Check
^C

1.974 GHz! I think we are good.
(with OpenCore)
For info, Since few years ago, only the 32bit version can accurately determine the CPU clock speed.

For 64bit version, it always reports something that's around 2GHz. And can't figure out that relationship to the actual clock speed.
 

Shiunbird

macrumors newbie
Original poster
Nov 20, 2020
22
12
You are right. Linpack32 does a better job.

But I think the CPU spikes up as soon as measurements start. I left my system on for some minutes, closed everything I could and at some point I was idling at 115W - I've never seen such low numbers coming out of hwmonitor.

As soon as I launched linpack32 I got 3.457 GHz - and I think this is the highest multiplier (x26?) I can get. On Windows, I've only ever seen x25 - but it cools down well and it can stay there indefinitely.

You are right that linpack64 shows around 2GHz no matter what. Both versions don't seem to use hyperthreading. I only get 1200% CPU usage out of activity monitor.
If I run one instance of linpack I get 1200% CPU usage and 260-280W. If I run two instances, I get 2400% CPU usage and 300W.

I think I will measure power out of the wall on Windows and on the Mac in idle and compare.

Does anyone with Intel Power Gadget could confirm that? I'd assume that dual socket systems would clock down as well, but won't be able to know for sure it seems.
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
You are right. Linpack32 does a better job.

But I think the CPU spikes up as soon as measurements start. I left my system on for some minutes, closed everything I could and at some point I was idling at 115W - I've never seen such low numbers coming out of hwmonitor.

As soon as I launched linpack32 I got 3.457 GHz - and I think this is the highest multiplier (x26?) I can get. On Windows, I've only ever seen x25 - but it cools down well and it can stay there indefinitely.

You are right that linpack64 shows around 2GHz no matter what. Both versions don't seem to use hyperthreading. I only get 1200% CPU usage out of activity monitor.
If I run one instance of linpack I get 1200% CPU usage and 260-280W. If I run two instances, I get 2400% CPU usage and 300W.

I think I will measure power out of the wall on Windows and on the Mac in idle and compare.

Does anyone with Intel Power Gadget could confirm that? I'd assume that dual socket systems would clock down as well, but won't be able to know for sure it seems.
x26 max make sense for X5675. This is what you expect when only 1-2 cores active (e.g. when you just start linpack)

And x25 max when all cores active is also correct. Windows always this number max, not sure why.

Intel Power Gadget won't work with Westmere Xeon, single / dual processor is irrelevant. If you force install / run it, most likely your cMP will crash straight away (this is what I got anyway).
 

handheldgames

macrumors 68000
Apr 4, 2009
1,943
1,170
Pacific NW, USA
x26 max make sense for X5675. This is what you expect when only 1-2 cores active (e.g. when you just start linpack)

And x25 max when all cores active is also correct. Windows always this number max, not sure why.

Intel Power Gadget won't work with Westmere Xeon, single / dual processor is irrelevant. If you force install / run it, most likely your cMP will crash straight away (this is what I got anyway).

Intel Extreme tuning utility works well on a 990x. If the x5675 is unlocked, it may be an option.
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
You are right. Linpack32 does a better job.

But I think the CPU spikes up as soon as measurements start. I left my system on for some minutes, closed everything I could and at some point I was idling at 115W - I've never seen such low numbers coming out of hwmonitor.

As soon as I launched linpack32 I got 3.457 GHz - and I think this is the highest multiplier (x26?) I can get. On Windows, I've only ever seen x25 - but it cools down well and it can stay there indefinitely.

You are right that linpack64 shows around 2GHz no matter what. Both versions don't seem to use hyperthreading. I only get 1200% CPU usage out of activity monitor.
If I run one instance of linpack I get 1200% CPU usage and 260-280W. If I run two instances, I get 2400% CPU usage and 300W.

I think I will measure power out of the wall on Windows and on the Mac in idle and compare.

Does anyone with Intel Power Gadget could confirm that? I'd assume that dual socket systems would clock down as well, but won't be able to know for sure it seems.
Just find out a way to monitor each CPU core's speed.

Open terminal and enter
Code:
sudo powermetrics --show-cpu-qos
Screenshot 2021-01-23 at 23.12.31.png
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
When I run a yes command in the background, clearly the CPU run at the Turbo Boost speed.
Screenshot 2021-01-23 at 23.55.19.png


And some CPU core can run at quite low clock speed when at idle
Screenshot 2021-01-24 at 00.04.25.png

So, it should be accurate
 
Last edited:
  • Like
Reactions: Macschrauber
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.