Linux tips: How to find out if a your CPU supports HT (Hyper-Threading)?
Intel introduced Hyper-Threading Technology (HT) in its line of Xeon processors in 2002. HT Technology enables multiprocessor servers to act as if they had twice as many processors installed. Intel’s HT Technology allows a single processor to handle two independent sets of instructions at the same time. In essence, HT Technology converts a single physical processor into two virtual processors. Currently HT is present in other Intel CPUs besides the high level Xeons, like Pentium 4 (with 800MHz CPU bus speed) or Pentium 4 Extreme Edition and the dual-core Pentium Extreme Edition.
For more details see Intel’s site: http://www.intel.com/products/ht/hyperthreading_more.htm
In order to make use of Hyper-Threading in Linux, you will need Hyper-Threading enabled in kernel. But how can you find out if your CPU supports HT? We can get the information from our running Linux system about its CPU by looking into /proc. For example, bellow you can see the output taken from a Xeon system:
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.20GHz
stepping : 3
cpu MHz : 3201.940
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
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 nx lm pni monitor ds_cpl cid cx16 xtpr
bogomips : 6404.17
Inside the flags section we are looking for a “ht” flag. If it is present, this means that the system supports HT.
Let’s look on another sample taken from a Pentium4 CPU (the un-needed infos were removed):
model name : Intel(R) Pentium(R) 4 CPU 3.20GHz
cpu MHz : 3192.092
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
Again this system also supports HT. If you don’t see the HT flag, then your system doesn’t support HT. Obviously this will not be available on AMD processors as this is an Intel technology (this might not be true anymore with newer AMD CPUs). Here is an example from an AMD Opteon system:
model name : AMD Opteron(tm) Processor 242
cpu MHz : 1593.326
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
If your CPU supports HT, then you can take advantage of this technology only if HT support is enabled in your running kernel. You can either install a kernel provided by your Linux distribution with HT support (one that has *SMP* inside its name for ex.) or you can compile your own kernel and include HT support.
Once you are running a HT enabled kernel your should normally see the virtual CPU as a regular extra CPU (you will see 2 CPUs on a single CPU system, 4 CPUs on a dual processor system, etc.). You can easily check this with:
cat /proc/cpuinfo
If you still see only one CPU even after you have installed a HT enabled kernel, then you might want to check:
- HT is not disabled in BIOS.
- APCI is enabled in BIOS.
Share This








24th July 2006, 21:41
Hi,
how can I check the usage of the cpu’s independently, like in ‘top’ show 2 cpu’s there?
thanks.
Ralph Liebessohn
25th July 2006, 01:13
Hey Ralph,
In top you can press 1 (the number one i mean), and the line “Cpu(s)” will change and show one line for each available CPU (real or virtual - HT): Cpu0, Cpu1, etc.
Cheers,
- Marius -
ps. I have deleted the email from your comment so you will not get harvested by spam bots ;-).
25th July 2006, 13:34
Thank you Marius!
That’s only that, press 1 and see another CPU.
And thanks again about the e-mail.
Ralph Liebessohn
26th August 2006, 22:53
My processor has HT in its flags:
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 7
(…)
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 up cid
My BIOS settings for HT is “AUTOâ€. I have compiled the kernel with SMP support:
Linux matilda 2.6.17-gentoo-r4 #1 SMP PREEMPT Sat Aug 26 12:24:22 CEST 2006 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GNU/Linux
Unfortunately, cat /proc/cpuinfo shows 1 CPU only. Your example shows cpu family 15 model 4, while mine is family 15 model 2. Maybe it makes a difference. Or maybe /proc/cpuinfo is mistaken.
Is SMP sufficient to use HT? What else can I check?
28th August 2006, 19:14
Automatthias,
You might want to look at the APIC configuration. Is it enabled in BIOS? Is it enabled in kernel? If you have it disabled for some reason you might want to try to pass the kernel parameter acpismp=force at boot time.
Also you might get some extra information from your dmesg output.
I hope that this will help you identify the problem.
21st September 2006, 07:13
Hi, I have a Pentium 4 1.6GHz CPU (socket 423) that DOES NOT support HT, but in flags it shows ht, how can it be possible?
21st September 2006, 07:21
Raul,
I have no idea why that would happen… Everytime I have seen the HT flag it was correct, but it is also true that I have not seen such an old P4 CPU in a while… Sorry about that, but I don’t have a clue why this would happen… Maybe someone else can give us some more infos if they have on hand a similar system.
7th December 2006, 23:00
check for “siblings: >1″ in cpuinfo, also. I also know some old P4 with ht flag visible.
1st February 2007, 17:20
I have a box with an Intel Celeron 2.66GHz and /proc/cpuinfo also shows the ht flag. When I boot an SMP kernel on this box there’s still just 1 cpu according to /proc/cpuinfo.
Seems like the ht flag is not definitive proof that an SMP kernel will actually give you two (”virtual”) CPU’s.
2nd February 2007, 10:30
http://www.mail-archive.com/opensuse-factory@opensuse.org/msg06876.html says (talking about a Celeron processor):
“Your processor does support hyperthreading, architecturally speaking, hence the HT flag. But you have only one virtual core. So for all practical purposes, your chip is not hyperthreaded.”
19th March 2007, 09:16
Nils,
Thank you for your comment explaining this issue regarding the Celeron’s with HT flags.
Thanks,
- Marius -
4th April 2007, 06:28
Hi Marius
I have a dual xeon sun box that has HT. I thought it was already turned on, but when i top 1 it only shows two procs. I wonder, how can i tell if i have both procs running without HT or if i have one running with HT enabled, and the other (real) proc is not operating?
thanks
Tom
4th April 2007, 07:31
Tom,
You can get that information from /proc/cpuinfo. Look for ‘physical id’ and if that is the same then you have only one real CPU. If that is different you have 2 CPUs and no HT. Also with newer dual core processors (probably not the case from what you are saying) you can look for ‘core id’.
For ex:
cat /proc/cpuinfo | egrep physical
physical id : 0
physical id : 0
4th April 2007, 07:41
Sensational. Thank you.
Best,
Tom
19th June 2007, 11:08
Hi Marius
I’m a little confused about HT and dual-core XEON cpus. If I have a HP proliant server DL380 G5 with two XEON 5160 cpus, smp kernel configured and loaded and HT enabled in BIOS, how many cpus should i see in my RHEL4 with top? 4 ?
Thanks in advance and best regards
Markus
19th June 2007, 11:26
Hi Markus,
Yes you should see 4 CPUs. Still those are not HT ones, but you see the dual cores (for each real CPU one extra core). This should look more or less (taken from a similar system):
cat /proc/cpuinfo | grep ‘core id’
core id : 0
core id : 0
core id : 1
core id : 1
19th June 2007, 12:25
Hi Marius
Thanks for the fast reply. But I don’t see those ‘core id’
I see the following if I look into cpuinfo:
processor : 0
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
.
physical id : 0
siblings : 2
.
processor : 1
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
.
physical id : 3
siblings : 2
.
processor : 2
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
.
physical id : 0
siblings : 2
.
processor : 3
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
.
physical id : 3
siblings : 2
Is here ’siblings’ the magic word which tells me that my server is running in HT mode?
Thanks again & regards
Markus
19th June 2007, 14:06
Hi Markus,
The ‘physical id’ should indicate the same real CPU. I am not sure why you don’t see the ‘core id’. Maybe are you running a 2.4.x kernel? My output was from 2.6.21 running on dual dual-core woodcrest 5130 CPUs.
It is true that I have not seen such CPU exactly as the one you have (5160) but I assumed they should look very similar… Apparently not… ;-).
ps. you can also check dmesg as it might give some useful information on this issue..
19th June 2007, 14:13
Hi Marius
I’m running Linux 2.6.9-5.ELsmp and here is the whole output of cpuinfo (just from processor 0):
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
stepping : 6
cpu MHz : 3000.109
cache size : 64 KB
physical id : 0
siblings : 2
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
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 syscall lm pni monitor ds_cpl est tm2 cx16 xtpr ts
bogomips : 5947.39
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
Thanks & regards
Markus
19th June 2007, 16:27
Markus,
this is most certainly caused by your kernel. Can you try to upgrade to the latest RHEL kernel and see if you see a difference? On stock kernels this info (core id) apparently appeared starting with 2.6.11:
http://thread.gmane.org/gmane.linux.kernel/287715
The RHEL kernel is obviously not following the stock version with many ‘internal’ changes even if the version looks smaller. Anyway it should be a good idea to upgrade to the latest rhel kernel (if you are running rhel4 then this is probably kernel-smp-2.6.9-55.EL).
Let me know…
21st August 2007, 09:03
how can i check from the user interface if HT is enabled or not.
my appication cant read the same from BIOS.
4th October 2007, 23:39
Hi Marius,
Do you have a complete list of what all the flags mean? CPU-Z for Windows and CPUID for Linux are useful tools, but it’s all still a little bit cryptic!
Mark
5th October 2007, 21:49
Hi Mark,
Sorry I don’t. Maybe you can find something like that on CPU manufacturers (intel or amd) developer sites.
20th February 2008, 15:03
Hi Mark,
check http://www.intel.com/design/xeon/applnots/241618.htm (pdf document, p. 24f) for all the flags explained.
Regards,
Boris.
20th February 2008, 17:51
Thanks for this Boris. Regards, Mark