How to check if Intel Hyper-Threading is enabled in Linux

Last updated on August 7, 2021 by Dan Nanni

Hyper-Threading is an Intel's simultaneous multithreading (SMT) technology that is designed to improve execution parallelism of x86 CPU processors. With Hyper-Threading enabled, each physical core is represented as two "logical processors", each of which can execute jobs concurrently while sharing resources of the physical core. When one logical processor is halted or interrupted, the other logical processor on the same core can steal resources from the stalled processor. Thus, Hyper-Threading is expected to improve overall CPU throughput, and is particularly useful for multi-threaded applications which involve a mix of CPU- and I/O-intensive workloads, such as video encoding, 3D-rendering, gaming, etc.

If you would like to check whether or not Hyper-Threading is enabled on your Linux system, there are several ways to do it.

Method One: BIOS settings

Hyper-Threading is a CPU processor feature. Hence typically you need to use BIOS settings to check whether or not Hyper-Threading is enabled. BIOS menu varies across different systems, and Hyper-Threading setting is typically found under "Advanced", "Processors" or "Performance" related settings. For example, the Hyper-Threading control in Dell XPS 13 BIOS is shown below.

Method Two: lscpu

Suppose you do not have access to your system's BIOS menu for some reason (e.g., due to remote access). In that case, you can leverage the lscpu command which shows information about your system's CPU architecture. In particular, look for Thread(s) per core entry in its output. If this entry says "1", it means only one thread is available per core. Hence Hyper-Threading is disabled. If it says "2", it means Hyper-Threading is enabled.

Therefore, simply use the following command to check the status.

$ lscpu | grep Thread

Method Three: /sys/devices/system/cpu/smt/active

Another way to check the status of Hyper-Threading from the command line is to access the pseudo file located at /sys/devices/system/cpu/smt/active. The content of this file will be 1 (or on) if Hyper-Threading is enabled, and 0 (or off) otherwise.

$ cat /sys/devices/system/cpu/smt/active

Method Four: dmidecode

You can also check if Hyper-Threading is enabled by using the dmidecode command-line tool. Run it with -t processor, and compare "Core Count" and "Thread Count" in the output. If these two counts are the same, it means Hyper-Threading is not enabled. If "Thread Count" is twice of "Core Count", it means Hyper-Threading is enabled.

$ sudo dmidecode -t processor | grep Count

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for Us ‒ Feed ‒ Powered by DigitalOcean