How many physical and logical CPU cores in your computer

Physical cores are just that, physical cores within the CPU.

Logical cores are the abilities of a single core to do 2 or more things simultaneously (through the use of hyper-threading)

We can get the number of physical and logical CPU cores using lscpu command in Linux as follows.

$ lscpu
Architecture:           x86_64
CPU op-mode(s):         32-bit, 64-bit
Byte Order:             Little Endian
CPU(s):                 32
On-line CPU(s) list:    0-31
Thread(s) per core:     2
Core(s) per socket:     8
Socket(s):              2

In the above example, the computer has 2 CPU sockets.
Socket(s):              2

Each CPU socket has 8 physical cores. Hence, the computer has 16 physical cores in total.
Core(s) per socket:     8

Each physical CPU core can run 2 threads.
Thread(s) per core:     2

These threads are the core’s logical capabilities. The total number of logical cores = CPU sockets × physical cores per socket × threads per physical core. Therefore, the computer has 2 × 8 × 2 = 32 logical cores in total.
CPU(s):                 32

References
https://unix.stackexchange.com/questions/88283/so-what-are-logical-cpu-cores-as-opposed-to-physical-cpu-cores
https://en.wikipedia.org/wiki/Hyper-threading

Leave a Reply