Disable Hyperthreading in the Windows 7 registry

40,991

Solution 1

From the Intel Core Processor Datasheet, Volume 1, page 38:

Intel Hyper-Threading Technology

[...] This feature must be enabled using the BIOS and requires operating system support.

This is because hyperthreading is actual physical hardware on the CPU die, and thus can be enabled/disabled on a hardware level only.

If you know which application does not work well with hyperthreading, you can use a tool like StartAffinity if you have XP.

If you use Windows 7, there is a built in start command that can do this. Use the following command to launch a process with a particular processor affinity (again, the /AFFINITY argument was only added in Windows 7):

start /AFFINITY <mask> "C:\yourprogram.exe" 

Where <mask> should be replaced with the hexadecimal mask for the processors you want to run (the processor mask is just a binary mask enabling/disabling that affinity, so 00000101 enables CPU0 and CPU2, and 00000010 enables only CPU1).

To calculate the hex value, you can either convert the binary mask, or take the sum of 2 to the power of the cores you want to run the program on (starting from 0), and convert that value to hexadecimal.

For example, if I have a four-core system, and only want the process to execute on CPU0 and CPU2, I would add 20 + 22 = 1 + 4 = 5. Convert 5 to hex, which is just 5, and set that as your <mask>. You could also just convert 00000101 to hex as well. If you don't know how to convert these bases, you can just use this conversion table.

Solution 2

Disabling Hyper-threading is a BIOS-only affair.

I am assuming that you would like to disable Hyper-Threading because you have an application that is not optimized for this feature and may have reduced performance?

When looking at CPU numbering, the physical cores are odd numbered - so in a dual-core, HT system, cores 1 and 3 would be the "real" CPU's. If you select 2 cores in msconfig, CPU's 1 and 2 would be enabled so you would have a Physical and Logical (HT) CPU active - this would not benefit you if you are having issues with software that has issues with HT.

Share:
40,991

Related videos on Youtube

Moab
Author by

Moab

Updated on September 18, 2022

Comments

  • Moab
    Moab over 1 year

    Some bios's Do Not have the option to disable Hyperthreading of the CPU, it there a way to disable it in the Windows 7 Registry? Or a tool or software?

    I know about msconfig boot tab (advanced options) and disabling processors there, not sure if it disables complete cores or hyperthreads, or how to tell.

    32bit or 64bit Windows 7

    EDIT:

    Lets assume it is a dual core or more with hyperthreading.

    In Device manager it shows 4 processors on my i5 Intel Processor, and you cannot disable them either, dang.

    • Moab
      Moab almost 13 years
      I am thinking this is the impossible question of the month.
    • hicklypups
      hicklypups almost 13 years
      You really can't disable it in the BIOS? Is it the latest version?
    • Moab
      Moab almost 13 years
      Its a HP PC, well known for crippled bios's no matter the version.
    • HonanLi
      HonanLi almost 13 years
      Not all i5 Chips are created equal, some have 4 physical cores and Hyper-threading disabled, while some have 2 cores and Hyper-threading enabled - usually notebbooks use Hyper-threading and Desktop chips are more likely to be a quad-core variant. Are you using a Desktop or Notebook and do you know the i5 model?
    • surfasb
      surfasb almost 13 years
      I wouldn't worry too much about Hyperthreading. It has seen big improvements since the P4. It doesn't suck up performance nowadays.
    • Moab
      Moab almost 13 years
      @Dustin G, its not particular to a processor, i5 was an example, evidently a poor one, the main question remains, a non bios method to disable hyperthreading on any Intel processor.
  • Ben Voigt
    Ben Voigt almost 13 years
    Yes but... you could use Task Manager to set affinity to CPUs 1 and 3.
  • Moab
    Moab almost 13 years
    Dustin G, that is what I thought, but finding any articles on this is near impossible. Thanks.
  • Moab
    Moab almost 13 years
    I understand affinity, but this will not disable a hyperthread, only a complete core. I don't think it is possible inside the OS to disaable Only hyperthreading, only in the bios, but some bios's do not have that option, mostly on HP pc's, I was hoping someone could prove me wrong.
  • Breakthrough
    Breakthrough almost 13 years
    Each physical core shows up in the OS as two logical ones. If you disable one of those logical cores, you effectively disable hyperthreading, since instructions are only sent to one of the two logical cores, so no hyperthreading is actually done - the instruction queue is directly sent to the physical core.
  • Moab
    Moab almost 13 years
    I get it, but it only disables hyperthreading for that one core. I need both disabled.
  • Breakthrough
    Breakthrough almost 13 years
    @Moab Then you just enable all even or odd numbered cores to disable every other one, using the masks I listed above. So if you have four logical cores, use 00000101, or 5 in hex, as your hexmask to set only CPU0 and CPU2 as enabled. If you have 8 logical cores, your bitmask would be 01010101, or 55 in hex (to enable only CPU0, 2, 4, and 6).
  • Moab
    Moab almost 13 years
    How do I know which ones are the hyperthreading ones, odd? Thanks for your patience.
  • Breakthrough
    Breakthrough almost 13 years
    @Moab it doesn't technically matter, so long as you disable every other core. Every set of two logical cores make up the thread handlers for a single physical core.
  • Moab
    Moab almost 13 years
    Now I need to brush up on my math, thanks so much.
  • Moab
    Moab almost 13 years
    I don't think there is a registry hack, but I will give you the accepted answer.
  • Doktoro Reichard
    Doktoro Reichard about 10 years
    I'm not sure this answers the question, as process affinity isn't the same thing as Hyperthreading.
  • E. Attia
    E. Attia almost 10 years
    Fortunately, things are not based on what you are sure or not but how they are specified in MSDN (for instance) msdn.microsoft.com/en-us/library/windows/desktop/… GetLogicalProcessorInformation gives the process affinities maching physical / logical processors (this is an exact way). On hyperthreading systems with 2-logical cores SMT (such as hyperthreading) Core #0 is bit 0 and 1, Core #1 bit 2 and 3 of the affinity mask etc... (this is an empirical way). I would be grateful if you could avoid downvoting things you have only intuitions on ...