Processors
Processors (Intel® Core™, Intel® Xeon®, etc); processor utilities and programs (Intel® Processor Identification Utility, Intel® Extreme Tuning Utility, Intel® Easy Streaming Wizard, etc.)
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
12350 Discussions

Xeon - way to get number of cores per processor

jaroslawmusial
Beginner
273 Views

Hi. What is the "bulletproof" way of getting number of processor cores for Xeons (especially old ones)? 

I am asking because there is value called  Maximum number of processor cores in physical processor package (CPUID EAX[31:26] ) which usually shows good value but for some reason for old processors it may be wrong. For example Intel Processor E7220, 2 cores per processor - for 4-way server it showed 4 cores per processor. Oddly /proc/cpuinfo shows good value.

Could someone help with that?

0 Kudos
4 Replies
n_scott_pearson
Super User Retired Employee
254 Views

I use the Extended Topology Enumeration Leaf (0x0B) if it is supported:

  • Invoking CPUID with EAX = 0x0B, ECX = 0x00 will yield NumThreadsPerCore in EBX[0:15].
  • Invoking CPUID with EAX = 0x0B, ECX = 0x01 will yield NumThreads in EBX[0:15].
  • NumCores = NumThreads / NumThreadsPerCore.

If the Extended Topology Enumeration Leaf (0x0B) is not supported, my fallback is to use the Deterministic Cache Parameters

  • Invoking CPUID with EAX = 0x01, ECX = 0x00 will yield NumThreads in EBX[16:23].
  • Invoking CPUID with EAX = 0x04, ECX = 0x00 will yield NumCoresLessOne in EAX[26:31].
  • NumCores = NumCoresLessOne + 1.
  • NumThreadsPerCore = NumThreads / NumCores.

Hope this helps,

...S

jaroslawmusial
Beginner
239 Views

Thanks

We do it in similar way but unfortunately  that  is when we also observe double core count. 

 

Any idea what else we could take a look at? 

n_scott_pearson
Super User Retired Employee
229 Views

No that's the two ways that were recommended to me by the processor folks (*many* moons ago). I was in the Desktop Boards org, so rarely had to deal with multiprocessor situations, however.

You could try posting this question in the Servers forum; you should see more Xeon-savvy folks over there...

...S

jaroslawmusial
Beginner
198 Views

Hi

Thanks, I will post question in that forum.

Reply