Identifying physical, hyperthreaded and multicore processors in Windows

Article:HOWTO8169  |  Created: 2007-10-16  |  Updated: 2007-10-17  |  Article URL http://www.symantec.com/docs/HOWTO8169
Article Type
How To




Question
How can I correctly identify physical, hyperthreaded, and multicore processors in Windows* Server 2003 and XP?

Answer

Correctly identifying the number and type of processors on Windows Server 2003 and XP computers has been difficult at best. Inventory for Windows can easily identify the number of physical or logical processors but has difficulty with logical and multicore processors. This issue is not limited to Altiris Inventory Solution.

Until Windows Vista was released, the various Windows operating systems were unable to identify the number of physical, logical, and multicore processors.

Windows Vista added the following new properties to WMI that provide for:

  • Number of physical processors
  • Number of logical processors
  • Number of cores

Even though Inventory for Windows provides a "cores" attribute in the inv_aex_hw_cpu table and hardware, inventory will attempt to correctly populate this column. However, processor information is still not complete.

Server 2003 and XP do not have the above properties in WMI by default. Microsoft has created two hotfixes that update WMI on these operating systems with one per operating system. These hotfixes are available only by request from Microsoft and can be found at the following locations

Custom Inventory can be implemented to capture the correct processor information as provided by the above properties.

Microsoft provides the following information regarding these hotfixes:

WMI properties before applying the hotfix

Win32_ComputerSystem

  • The NumberOfLogicalProcessors property is not available.
  • The NumberOfProcessors property returns the number of logical processors that are available on the system.
Win32_Processor
  • The number of Win32_Processor instances that are returned is equal to the number of logical processors that are available on the system.
  • The NumberOfCores property is not available.
  • The NumberOfLogicalProcessors property is not available.
WMI Properties after applying the hotfix

Win32_ComputerSystem

  • The NumberOfProcessors property returns the number of physical processors that are available on the system.
  • The NumberOfLogicalProcessors property returns the number of logical processors that are available on the system.

Win32_Processor

  • The number of NumberOfLogicalProcessors instances that are returned is equal to the number of logical processors that are available on the system.
  • The NumberOfCores property returns the number of cores that are available on the system.
  • The number of Win32_Processor instances that are returned is equal to the number of physical processors that are available on the system.

To determine whether hyperthreading is enabled for the processor, compare the value of the NumberOfCores property to the value of the NumberOfLogicalProcessors property. If hyperthreading is enabled in the BIOS for the processor, the value of the NumberOfCores property is less than the value of the NumberOfLogicalProcessors property.

For example, assume that a dual-processor system contains two processors that are each enabled for hyperthreading. This system can run four threads or four programs at the same time. In this case, the value of the NumberOfCores property is 2, and the value of the NumberOfLogicalProcessors property is 4.

Custom Inventory to Capture the New WMI Properties

The following custom inventory will capture these new WMI properties. These are just segments. The accompanying .zip file contains the complete source XML files.

The following custom inventory will query the "numberofcores" from the win32_processor class and set a variable with that value. Even though there may be multiple rows, the value for each row would be the same. It then queries the win32_computersystem class and gathers the 'numberofprocessors' and 'numberoflogicalprocessors'. It will populate one row in the table per computer resource.

  <rs:data>

<%foreach wmiobject="o" namespace="root\CIMV2" wql="SELECT * FROM Win32_processor" %>

<%set numberofcores = "wmi:o.numberofcores" %>

<%next%>

<%foreach wmiobject="o" namespace="root\CIMV2" wql="SELECT * FROM Win32_ComputerSystem" %>

<z:row

c0 ="<%writexml "%numberofcores%"%>"

c1 ="<%writexml "wmi:o.NumberOfProcessors"%>"

c2 ="<%writexml "wmi:o.NumberOfLogicalProcessors"%>"

/>

<%next%>

</rs:data>

This custom inventory will query only the win32_processor class and return various CPU-related information plus the number of cores and the number of logical processors. It will return one row for each physical processor on the computer resource. By creating a report that counts the number of rows, the counts of physical processors, cores and logical processors can be determined.

  <rs:data>

<%foreach wmiobject="o" namespace="root\CIMV2" wql="SELECT * FROM Win32_Processor" %>

<z:row

c1 ="<%writexml "wmi:o.Description"%>"

c2 ="<%writexml "wmi:o.Manufacturer"%>"

c3 ="<%writexml "wmi:o.Name"%>"

c4 ="<%writexml "wmi:o.NumberOfCores"%>"

c5 ="<%writexml "wmi:o.NumberOfLogicalProcessors"%>"

/>

<%next%>

</rs:data>


Attachments

processor_custinv_source.zip (2 kBytes)

Legacy ID



38797


Article URL http://www.symantec.com/docs/HOWTO8169


Terms of use for this information are found in Legal Notices