Skip to content

Enable automatic vNUMA for large WSL VMs - #41741

Merged
Ben Hillis (benhillis) merged 3 commits into
microsoft:masterfrom
benhillis:fix/hcs-vnuma
Oct 2, 2026
Merged

Ben Hillis (benhillis) merged 3 commits into
microsoft:masterfrom
benhillis:fix/hcs-vnuma

Conversation

@benhillis

@benhillis Ben Hillis (benhillis) commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Enable automatic virtual NUMA topology generation for WSL virtual machines on Windows build 26100 and newer.

WSL previously omitted ComputeTopology.Numa from its HCS configuration. HCS therefore treated the VM as a single virtual NUMA node/socket, which fails when the requested processor count exceeds the supported per-socket topology. Emitting an empty Numa object asks HCS to derive the virtual topology from the requested resources and physical host topology.

This change:

  • adds optional NUMA serialization to the local HCS schema
  • enables automatic vNUMA for both WSL and WSLC virtual machines on Germanium/26100 and newer
  • preserves the existing HCS configuration on older Windows builds

Validation

  • Built the x64 Debug wsltests target successfully.
  • PR x64 and ARM64 package builds, formatting checks, WSL 1 tests, and WSLC tests pass.
  • The reporter's ETL confirms the root cause: WSL requested 384 processors without a Numa topology, and HCS rejected the single-node configuration with MaxVpCountPerSocketLimit: 256 and maxVpCountPerSocket: 384.
  • Validation of the private build on the reporter's 384-processor host is pending.

Fixes #41731

Add the HCS NUMA topology object so HCS can derive a supported virtual topology for large processor counts instead of requiring WSL to clamp the VM to 256 processors.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c
Copilot AI balanced review requested due to automatic review settings September 30, 2026 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The vNUMA setting must be gated to supported Windows builds to avoid VM creation regressions on older systems.

Review effort: Balanced
Findings: 2 High severity

Open (2)
What changed in this PR

Enables automatic HCS-derived vNUMA topology for large WSL and WSLC virtual machines.

Changes:

  • Adds optional NUMA serialization to the local HCS schema.
  • Enables automatic vNUMA for WSL and WSLC VMs.
  • Adds serialization and large-host processor-count coverage.
File Description
src/​windows/​common/​hcs_schema.h Adds optional NUMA topology serialization.
src/​windows/​service/​exe/​WslCoreVm.cpp Enables automatic vNUMA for WSL VMs.
src/​windows/​service/​exe/​HcsVirtualMachine.cpp Enables automatic vNUMA for WSLC VMs.
test/​windows/​HcsSchemaUnitTests.cpp Tests empty NUMA object serialization.
test/​windows/​UnitTests.cpp Tests processor counts above 256.
test/​windows/​CMakeLists.txt Registers the new schema test source.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/windows/service/exe/HcsVirtualMachine.cpp Outdated
Comment thread src/windows/service/exe/WslCoreVm.cpp Outdated
Preserve the existing single-node HCS configuration on older Windows builds where vNUMA topology creation is unsupported.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c
Copilot AI balanced review requested due to automatic review settings September 30, 2026 15:40
Comment thread src/windows/common/hcs_schema.h

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The high-processor-count test lacks the production OS-version gate and can fail on supported downlevel hosts.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

Comment thread test/windows/UnitTests.cpp Outdated
Comment thread test/windows/HcsSchemaUnitTests.cpp Outdated
Comment thread test/windows/UnitTests.cpp Outdated
Co-authored-by: Copilot <[email protected]>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c
Copilot AI balanced review requested due to automatic review settings September 30, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The serialization and high-processor-count tests claimed in the PR description are absent.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Comment thread src/windows/common/hcs_schema.h
@benhillis
Ben Hillis (benhillis) marked this pull request as ready for review October 1, 2026 00:02
@benhillis
Ben Hillis (benhillis) requested a review from a team as a code owner October 1, 2026 00:02
@benhillis
Ben Hillis (benhillis) enabled auto-merge (squash) October 2, 2026 00:49
OMIT_IF_EMPTY(j, processor, EnablePerfmonLbr)
}

struct Numa

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We can reuse EmptyObject for this

@benhillis
Ben Hillis (benhillis) merged commit 11c74d8 into microsoft:master Oct 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WSL fails to launch on a host with > 256 Logical Processors.

3 participants