lscpu
is a command which can be eternally useful when checking the
hardware capabilities of a given host. At it’s simplest, lscpu
can be run after
installing the util-linux
package (on Debian and Debian-based distros) with no
options, and will end up with an output similar to the below:
Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 69 Model name: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz Stepping: 1 CPU MHz: 2399.853 CPU max MHz: 2700.0000 CPU min MHz: 800.0000 BogoMIPS: 4789.29 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 3072K NUMA node0 CPU(s): 0-3 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
This tells us information such as the bit-type, number of cores (CPUs), number of threads, the vendor, model and frequency. Some of the more cryptic lines include ‘BogoMIPS‘ or ‘Bogus MIPS’ – a rough score for how much processing power is available to a CPU calculated by the Linux kernel when it boots – or the cache lines, which state how much cache memory your CPU features at each level.
Sockets refers to each physical CPU on the motherboard, which for the vast majority of workstations will be a straightforward value of 1. Cores per Socket refers to the number of physical cores on that socket, and threads per core is the number of threads a physical core can carry at once. This is often two for most recent x86 processors. Finally, CPUs is the number of logical threads as seen by the operating system; this is threads per core multiplied by cores per socket multiplied by the number of sockets; in this case, 2*2*1=4.
The flags at the bottom of this output is a run-down of everything your CPU can do. Some common examples include fpu
, floating point support; lm
, a 64-bit architecture; aes
, support for accelerated AES (Advanced Encryption Standard); smx
, a trusted platform module; vmx
or svm
, hardware virtualisation from Intel and AMD respectively; tm
, thermal monitoring (scaling back the clock speed to keep things cool); hypervisor
, the system is running on a hypervisor.
A full list of flags can be found in the Linux kernel source file cpufeatures.h.
Photo by Adi Goldstein on Unsplash