0

I need to get CPU cores and details per CPU core. I use cat /proc/cpuinfo command an it works. But I need to get information for multiple CPU packages. I have only single CPU package. How would the output look like in this situation?

Example CPU setup: 2 CPU packages: CPU package1: Core i7-2000 (4 physical, 8 logical cores), CPU package2: Core i7-3000 (4 physical, 8 logical cores), total 8 physical, 16 logical cores.

Example 1:

processor   : 0
.   other info for same core
model name  : Intel(R) Core(TM) i7-2000
.
.   other cores for same CPU package
.
processor   : 7
.   other info for same core
model name  : Intel(R) Core(TM) i7-2000
.
processor   : 8
.   other info for same core
model name  : Intel(R) Core(TM) i7-3000
.
.   other cores for same CPU package
.
processor   : 15
.   other info for same core
model name  : Intel(R) Core(TM) i7-3000

or Example 2:

processor   : 0
.   other info for same core
model name  : Intel(R) Core(TM) i7-2000
.
.   other cores for same CPU package
.
processor   : 7
.   other info for same core
model name  : Intel(R) Core(TM) i7-2000
.
processor   : 0
.   other info for same core
model name  : Intel(R) Core(TM) i7-3000
.
.   other cores for same CPU package
.
processor   : 7
.   other info for same core
model name  : Intel(R) Core(TM) i7-3000


OS: Debian-like Linux, Kernel: 4.19
2
  • Try dedicated tool for Intel CPUs i7z. May 14 at 13:49
  • I do not have multiple CPU packages and I need to process the data in the /proc/cpuinfo or process it by using default system applications.
    – demirod
    May 14 at 13:52
0

In setups with multiple physical CPU packages, you won’t see varying model names — all the CPUs have to be matched. In most cases I would expect the enumeration order in /proc/cpuinfo to go over physical packages in order, but that can’t be guaranteed; what you need to do is look at the physical id in /proc/cpuinfo if you want to group the logical cores by physical socket. All the cores from a single socket will have the same physical id, and only those cores.

2
  • Stephen Kitt, about the you won’t see varying model names — all the CPUs have to be matched information: Is it valid only for PCs in tower chassis form or both for tower PCs with multiple packages and large scale servers (maybe for those have more than a few hundreds-thousands of cores). Note: I am a new Linux (notebook) user, I have migrated from a commercial OS.
    – demirod
    May 14 at 18:03
  • CPUs have to be matched in any tightly-coupled system, regardless of size. Basically, if CPUs are in the same system such that they will show up in the same /proc/cpuinfo, they have to match. May 14 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.