How is NUMBER_OF_PROCESSORS env variable generated?

11,201

Solution 1

Okay... I'm really curious why you want to run Windows 7 on these servers instead of Windows server editions. Can you give more specifics on your environment?

You're using an HP ProLiant BL460c Gen9 server with two very high-end Intel E5-2697v3 14-core CPUs.

While HP manufactured workstation-specific blade servers up until the Gen8 ProLiant line, there's no Gen9 equivalent yet.

At this point, I suspect a few things:

  • Windows 7 Enterprise can support two CPU sockets and 64 logical cores, but you're only seeing one socket's worth of CPUs. I suppose you're expecting to see 28 cores?

  • Is your system fully updated from an OS perspective? If not, please run all OS updates. This is a new CPU released a few weeks ago on a VERY new server platform. I doubt you'll find other people with this combination of OS and hardware right now.

  • Are you up-to-date on system firmware? If not, update it.

  • HP did not intend for this server model to be used with Windows 7, so doing so would kill your ability to run health management agents and the value-add drivers on the hardware.

  • You can potentially use Windows 2008 R2 drivers/firmware for the system, but it's all unsupported.

Solution 2

As far as I know, $ENV:NUMBER_OF_PROCESSORS is derived from WMI, using: Win32_ComputerSystem.NumberOfLogicalProcessors

To add to the confusion, Win32_ComputerSystem also reports the number of physical CPUs as NumberOfProcessors.

You can use WMIC or PowerShell to assess these values:

Get-WmiObject -Class Win32_ComputerSystem|Select NumberOf*

If your machine shows NumberOfProcessors as just 1, you might either have a hardware issue, or an license activation issue, since only the Enterprise, Professional and Ultimate editions of Windows 7 will recognize more than one physical CPU

Solution 3

Windows 7 is not a supported operating system to run on that hardware, which is a good enough explanation for me at to why it's not correctly reporting on your installed hardware. The other reasons in Mathias' answer may ultimately be the cause too, but generally speaking, "unsupported configuration" is a good enough explanation for professional systems administration purposes.

As far as Windows systems, only Windows Server OSes 2003 and above are supported on the BL460Cs, and for that matter, on most HP server hardware.

Solution 4

Justin, I posted a comment earlier but it was not seen as an answer - however it did lead to the solution for myself, so I have reposted below with workings and the solution to help you understand the logic for my scenario, and you can then judge if you have the same one.

Evening Justin I see the same issue with HP proliant blade bl460c generation 9 windows windows 2012 r2 . the generation 8's reported everything correctly. Did you find a solution. My findings are 'echo %NUMBER_OF_PROCESSORS%' returns an incorrect \ inconsistent response compared with msinfo32, taskmanager and even Get-WmiObject -Class Win32_ComputerSystem | fl Number*

The reported number is 8, the correct number is 16.

Havings discussed with both HP and Microsoft this appears to be due to NUMA nodes and interleaving.

it was resolved by entering the bies and setting 'node interleaving' to disabled. after this the '%number_of_processors% ' variable returned the same number of processors as the logical taskmaster settings. So this resolved the issue for me.

for more information on NUMA settings please see: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363804(v=vs.85).aspx

Share:
11,201

Related videos on Youtube

Justin
Author by

Justin

Updated on September 18, 2022

Comments

  • Justin
    Justin over 1 year

    I have a couple of HP BL460Cs that are being tested to determine which processor we want to go with when we start upgrading our equipment, and there's a problem with this environment variable on one of them.

    The blade is running Windows 7 Enterprise, and the NUMBER_OF_PROCESSORS variable reports 14 processors, but there are two 14 core processors installed in the machine, so we should be seeing double that number. I was able to verify that both processors are installed and detected by the machine via msinfo32 and device manager.

    Is there something that could be messing with how the variable is generated? What process does Windows even use to set this number? I know that it can be edited, but it's just reset after reboot, so that doesn't really help. Any insight you guys have would be immensely appreciated.

    Update: Decided to rebuild the machine as Windows 2008R2 in order to see if it would change or fix the issue, but it persisted. So, the technically incompatible configuration is likely not the cause.

    • joeqwerty
      joeqwerty over 9 years
      The blade is running Windows 7 Enterprise - That sounds like an expensive workstation. Out of curiosity, why are you running Windows 7 on them?
    • ewwhite
      ewwhite over 9 years
      What model, generation and CPU is currently installed in the BL460c's?
    • Justin
      Justin over 9 years
      The blades are Gen9, this one's using an Intel E5-2697 v3
    • ewwhite
      ewwhite over 9 years
      Oh wow... That's surprising. Why are you planning to use them as workstations? Would virtualizing them be a better option?
  • Mathias R. Jessen
    Mathias R. Jessen over 9 years
    +1, throw Win7 out the window and install Server 2008 R2 (or 2012 R2)
  • Justin
    Justin over 9 years
    Thanks for the helpful reply! This was my guess, and I only came as far as asking because using WMI returns NumberOfLogicalProcessors as 28. Our other servers both have two processors, eight cores each, and the env variable is correct on both of them.
  • Mathias R. Jessen
    Mathias R. Jessen over 9 years
    That's pretty interesting. What happens if you disable hyper-threading on the machine?
  • Justin
    Justin over 9 years
    Hyper-threading is already disabled.
  • Justin
    Justin over 9 years
    Thanks for an incredibly detailed answer! To points 1, 2, and 3: yes, up-to-date, up-to-date. We're looking into running the windows 2008 drivers on the system.
  • Justin
    Justin over 9 years
    Added an update to the original question, the problem persisted after rebuilding the blade as 2008 R2.
  • HopelessN00b
    HopelessN00b over 9 years
    @Justin In that case, tell me, this blade... the 2nd proc isn't disabled in the BIOS, right? And both rows of RAM dimms are populated, right? Making those assumptions, I'd have to say chipset driver, like Ed suggested.
  • Justin
    Justin over 9 years
    All processors active, according to BIOS. We did install drivers after rebuilding to 2008 R2, with chipset being one of them, but no dice. The servers are colocated, so unless there's a method of confirming the status of the RAM without physically opening the server, I can't confirm. It does look like both slots are populated via ILO. Why might that be causing the issue?
  • Justin
    Justin over 9 years
    Added an update to the original question, even after rebuiliding the machine as 2008 R2 and updating the drivers, we saw the same issue. :(
  • ewwhite
    ewwhite over 9 years
    Did you update server firmware?
  • ewwhite
    ewwhite about 9 years
    This may be fixed with an upcoming firmware release.