In the absence of a manually entered K-Group assignment, Windows assigns nodes to groups in a manner that minimizes the number of groups. Windows uses empirically measured inter-node distances from the previous boot to minimize the distance between nodes assigned within each group. Administrators may override the automatic group assignment using one of two methods: by using BCDEdit, or by modifying the registry.
Note: Windows Server 2008 R2 uses the following override priority: A manually added registry entry will override BCDEdit settings; in turn, BCDEdit settings will override the OS's automatic group assignment.
Using BCDEdit to configure K-Group assignments
Administrators can utilize BCDEdit to override the default K-Group assignment. BCDedit allows changes to the settings for
groupsize and
maxgroup. This method is documented on the following MSDN page:
Boot Parameters to Test Drivers for Multiple Processor Group SupportUsing the registry to manually configure K-Group assignmentsThe second method of manually assigning processor groups is through adding a registry entry which manually configures the K-Group assignments based on the particular system’s preferred NUMA characteristics.
Key: HKLM\System\CurrentControlSet\Control\NUMA
Value: “Group Assignment”
Type: REG_BINARY
Data:
Proximity Domain Count (N)
Proximity ID of domain 0
Group assignment for domain 0
Proximity ID of domain 1
Group assignment for domain 1
...
Proximity ID of domain N-1
Group assignment for domain N-1
The "Data" field is a series of ULONG values (4-byte unsigned integers).
Important: Be sure to assign the proximity domain containing the BSP to group 0. Windows assures the BSP has group affinity {Group 0, Number 0}.
ScenarioFor example, consider the following scenario:
- A machine has 80 logical processors evenly distributed among 4 NUMA nodes.
- The BIOS’s System Resource Affinity Table (SRAT) defines the NUMA nodes with proximity IDs 0x11, 0x12, 0x13, 0x14.
- The Boot System Processor (BSP) is in proximity domain 0x11.
Here are two examples of how to assign nodes manually in this scenario.
Example 1:
You wish to assign nodes
0x11 and
0x12 to
group 0, and nodes
0x13 and
0x14 to
group 1.
Prepare the table as follows:
Name | Value | Value as ULONG |
Proximity Domain Count | 4 | 04 00 00 00 |
Proximity ID of domain 0 | 0x11 | 11 00 00 00 |
Group assignment for domain 0 | 0 | 00 00 00 00 |
Proximity ID of domain 1 | 0x12 | 12 00 00 00 |
Group assignment for domain 1 | 0 | 00 00 00 00 |
Proximity ID of domain 2 | 0x13 | 13 00 00 00 |
Group assignment for domain 2 | 1 | 01 00 00 00 |
Proximity ID of domain 3 | 0x14 | 14 00 00 00 |
Group assignment for domain 3 | 1 | 01 00 00 00 |
Note: You must assign proximity domain ID 0x11 to group 0 because domain ID 0x11 contains the BSP.
To configure the registry according to this table, concatenate all the 4-byte ULONG values from the rightmost column into a single long binary value.Run this command:
reg.exe add HKLM\System\CurrentControlSet\Control\NUMA /v "Group Assignment" /t REG_BINARY /f /d "040000001100000000000000120000000000000013000000010000001400000001000000"
Example 2:You wish to assign nodes
0x11 and
0x12 to
group 0, node
0x13to
group 1, and node
0x14 to
group 2.
Prepare the table as follows:
Name | Value | Value as ULONG |
Proximity Domain Count | 4 | 04 00 00 00 |
Proximity ID of domain 0 | 0x11 | 11 00 00 00 |
Group assignment for domain 0 | 0 | 00 00 00 00 |
Proximity ID of domain 1 | 0x12 | 12 00 00 00 |
Group assignment for domain 1 | 0 | 00 00 00 00 |
Proximity ID of domain 2 | 0x13 | 13 00 00 00 |
Group assignment for domain 2 | 1 | 01 00 00 00 |
Proximity ID of domain 3 | 0x14 | 14 00 00 00 |
Group assignment for domain 3 | 2 | 02 00 00 00 |
Note: You must assign proximity domain ID 0x11 to group 0 because domain ID 0x11 contains the BSP.
To configure the registry according to this table, concatenate all the 4-byte ULONG values from the rightmost column into a single long binary value.Run this command:
reg.exe add HKLM\System\CurrentControlSet\Control\NUMA /v "Group Assignment" /t REG_BINARY /f /d "040000001100000000000000120000000000000013000000010000001400000002000000"
Reboot for the configuration to be applied. If the configuration is incorrect in any way (i.e. the data is the wrong length, proximity IDs are incorrect,
or invalid group numbers are specified), the group assignment data is ignored, and the machine will boot as if no group assignment data had been specified.
Once completed, and after a reboot, there are two simple ways to validate if group assignment for the target machine’s NUMA configuration has been applied correctly:
- Perfmon. Add counters, select “Processor Information“, and view the instance tuples which convey {NUMA node, zero-based index of
the processor within that node}. This only shows how many nodes are present, and how many processors are in each node. - Taskmgr. With this alternative, one can view the node-to-group mappings. Choose the Processes tab, right-click any process,
select “Set Affinity…”, and choose any group to see which nodes are within that group. This shows which group each node is in.