microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.42k stars 823 forks source link

Unable to allocate more than 32 CPU cores to WSL2 #11860

Open KaneGreen opened 3 months ago

KaneGreen commented 3 months ago

Windows Version

Microsoft Windows [Version 10.0.22631.3958]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu-24.04

Other Software

OS: Windows 11 Pro for Workstations 23H2

Repro Steps

  1. I'm using a workstation with one AMD EPYC 7K62 48-Core Processor. So, I have 48 physical cores and 96 logical cores.

  2. Enable these features in Control Panel: Hyper-V, Virtual Machine Platform, Windows Hypervisor Platform and Windows Subsystem for Linux.

  3. Install the latest WSL from https://github.com/microsoft/WSL/releases/latest

  4. the WSL configuration in file %USERPROFILE%/.wslconfig

    [wsl2]
    memory=40GB
    processors=40
    defaultVhdSize=256GB
    nestedVirtualization=false
    
    [experimental]
    autoMemoryReclaim=dropcache
    sparseVhd=true

    In this configuration, I tried to allocate 40 CPU cores to WSL.

  5. Install Ubuntu-24.04 from Microsoft Store.

  6. Run the command lscpu in the WSL terminal to check how many CPU cores are available.

Expected Behavior

I hope I can get 40 logical cores available in WSL.

    Thread(s) per core:  2
    Core(s) per socket:  20
    Socket(s):           1

or

    Thread(s) per core:  1
    Core(s) per socket:  40
    Socket(s):           1

Actual Behavior

But I get 32 logical cores available in WSL.

    Thread(s) per core:  2
    Core(s) per socket:  16
    Socket(s):           1

I also tried to set processors to other values, and I found that:

In short, I can't use more than 32 cores.

Diagnostic Logs

No response

github-actions[bot] commented 3 months ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

KaneGreen commented 3 months ago

/emailed-logs

github-actions[bot] commented 3 months ago
Diagnostic information ``` Found '/emailed-logs', adding tag 'emailed-logs' ```
xiaokentrl commented 2 months ago

I really love the Dynamic-Wallpaper software. If there were a Windows or Linux version, I would be willing to purchase it for a lifetime.