The purpose of this tutorial is to show how to check a CPU’s instruction set on a Linux system. The instruction set of a CPU is, in simple terms, the capabilities that it possesses. For example, if your CPU supports hardware virualization, then that is part of its instruction set.
Information about the instruction set of your CPU is stored in Linux, at the operating system level. This means it is perfectly accessible for normal users, we just have to know where to look.
In this tutorial, we will see how to obtain the CPU instruction set on Linux, from both command line and GUI. This will also include information about whether the CPU is 32 bit or 64 bit. On a related note, check out our guide on how to check and monitor CPU utilization if you want to measure the performance of your CPU.
In this tutorial you will learn:
- How to check CPU instruction set from command line and GUI
- How to install hardinfo GUI program on major Linux distros
|Category||Requirements, Conventions or Software Version Used|
|System||Any Linux system|
|Software||procinfo, lscpu, hardinfo|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Check CPU instruction set via command line
There are several command line utilities we can use to obtain CPU information on Linux. The following methods show the most useful tools, which are installed by default on almost any Linux distribution.
/proc/cpuinfo virtual file contains a lot of information about the CPUs installed in our system. View it with the following command.
$ cat /proc/cpuinfo
The output from this command will look like this:
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 61 model name : Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz stepping : 4 microcode : 0xffffffff cpu MHz : 2294.689 cache size : 3072 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 20 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt flush_l1d arch_capabilities bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit srbds bogomips : 4589.37 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: ...
The information under “flags” (in bold) contains a list of capabilities for our CPU. They are all a bit cryptic and mostly meant to be read by machine code, so you would need to investigate the meaning of each flag in order to understand all the information in your CPU instruction set.
The only downside to this method is that it will output information for each logical processor, so the terminal can get a bit spammy – you could always pipe to
more to clean it up. Press
q to exit once the information starts to get repetitive.
$ cat /proc/cpuinfo | more
Most CPUs these days have multiple cores, and the operating system will perceive each one as an individual processor. Therefore, the
procinfo method could output the same information 16 times (assuming you have an 8 core CPU with multithreading).
Some other helpful information, in addition to the CPU instruction set, from the
/proc/cpuinfo virtual file is as follows:
- CPU make and model: Intel(R) Core(TM) i5-5300U
- CPU speed: 2.30GHz
- Number of CPU cores: 2
- Number of logical CPUs: 4
- CPU cache size: 3072 KB
- Enabled flags for the CPU (instruction set) – tells us what features the CPU is capable of
Another useful utility, which you may find a bit easier to use because of its concise output, is the
The output from this command will look like this:
Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 39 bits physical, 48 bits virtual CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 61 Model name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz Stepping: 4 CPU MHz: 2294.688 BogoMIPS: 4589.37 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32 KiB L1i cache: 32 KiB L2 cache: 256 KiB L3 cache: 3 MiB NUMA node0 CPU(s): 0 Vulnerability Itlb multihit: KVM: Mitigation: VMX unsupported Vulnerability L1tf: Mitigation; PTE Inversion Vulnerability Mds: Mitigation; Clear CPU buffers; SMT Host state u nknown Vulnerability Meltdown: Mitigation; PTI Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Full generic retpoline, STIBP disab led, RSB filling Vulnerability Srbds: Unknown: Dependent on hypervisor status Vulnerability Tsx async abort: Not affected Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtr r pge mca cmov pat pse36 clflush mmx fxsr sse s se2 ht syscall nx rdtscp lm constant_tsc rep_go od nopl xtopology nonstop_tsc cpuid tsc_known_f req pni pclmulqdq monitor ssse3 cx16 pcid sse4_ 1 sse4_2 x2apic movbe popcnt aes xsave avx rdra nd hypervisor lahf_lm abm 3dnowprefetch invpcid _single pti fsgsbase avx2 invpcid rdseed md_cle ar flush_l1d
Once again, we have marked the flags in bold text, which contain information about the CPU instruction set.
This command tells us a lot of the same information, but some of it is easier to interpret. In particular, we get a nicer breakdown of CPU cores. Here is how to interpret:
- Sockets: 1 (this is the actual number of physical CPUs)
- Cores per socket: 2 (therefore we have 2 cores total)
- Threads per core: 2 (2 threads x 2 cores = 4 logical CPUs)
lscpu command also gives us information about our hypervisor and various cache sizes.
There are even more command line utilities available, but they are not installed by default on some distros, and all the information we need can usually be obtained from the two utilities covered above.
Check CPU instruction set via GUI application
If you would prefer to use a GUI application to view CPU info, rather than fiddle with the command line, there is a very handy program called “hardinfo” that can be installed on any major Linux distribution. You can use the appropriate command below to install hardinfo with your system’s package manager.
$ sudo apt install hardinfo
$ sudo dnf install hardinfo
$ sudo pacman -S hardinfo
After it is installed, you can either open it from your system’s app launcher, or just execute the
hardinfo command in a terminal.
The application shows us information about all of our system’s hardware, but to see CPU info specifically, click on the processor tab in the left pane.
Highlight your CPU, and check the bottom pane for a lot of detailed information. In the screenshot below, we have expanded the information pane to better information about the CPU’s instruction set.
In this tutorial, we saw how to obtain the instruction set for our installed CPUs on a Linux system. This included two command line methods, as well as a GUI application. This should tell you enough about your system, without needing to check the manual or research your PC specs.