Client Management Suite

 View Only

Identifying Physical, Hyperthreaded and Multicore Processors in Windows 

Oct 16, 2007 02:10 PM

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 Vista was released, the various Windows operating systems were unable to identify the number of physical, logical and multicore processors.

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 OSes – one per OS. These hotfixes are available only by request from Microsoft and can be found at:

XP: http://support.microsoft.com/kb/936235/

2003: http://support.microsoft.com/kb/932370/

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 sets 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_comptersystem 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>

Statistics
0 Favorited
1 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
zip file
processor_custinv_source.zip   1 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Oct 18, 2007 11:08 AM

This comes at a perfect time. This has always been a pain point when trying to determine processor counts etc. for licensing needs.
Benjamin Z. Palmer
Architect | Workspace Design | The Hartford | Simsbury, CT 06082

Related Entries and Links

No Related Resource entered.