-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL 2 uses half the number of cores on AMD Threadripper 3990X #5423
Comments
Not sure if it is relevant but I am experiencing the same issue in hyper-V too. |
It's the kernel config. Look at https://github.com/microsoft/WSL2-Linux-Kernel/tree/master/Microsoft. In the config for x86_64 you will see it's set to 64. This is standard from the Linux kernel. What you can do is update the config to match the number of cores you have. Ideally WSL would do a check on the number of CPU cores and update the config appropriately in |
@WSLUser , thanks for the answer. Just to confirm, you meant updating
Are you suggesting that despite the range, WSL 2 uses the default value as a max value? My apologies if I misunderstood your suggestion. |
You have to create .wslconfig. https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-18945 |
@WSLUser thank you again for the suggestion and sorry for the misunderstanding on my part. I tried your method to change the number of processors. It works when I decrease the number of processors but unfortunately, it doesn't work passed the 64 processor (which is equivalent to 32 physical processors). it seems to still limit me to half of number of physical cores (64/2 = 32). |
@WSLUser Does this work also for multiple CPUs? i.e. Dual Xeon setup? |
Not sure. @craigloewen-msft would probably know better. In your case it appears the kernel config itself needs updating. You should be able to override the original value in .wslconfig as well. You should see the option in the release notes. And yes (sorry I didn't answer before), it's using the default value. So you'll overwrite it. I don't recommend going above 256. |
@WSLUser Thanks for all the help, I guess I will wait for the kernel to be updated. |
@AAlMutairi not yet,not sure if it applies to dual cpu setups as well. If it does, I'll try. |
Any updates or fixes to test? |
It affect compiling also when running make -j. Only half of CPUs used whereas WSL1 does not have this issue. Ryzen 2600, Ubuntu 20.04 WSL2 |
This basically blocks any usage of WSL 2, even if I check out my repo there, I lose 50% of my processing power.. That's simply a no go. |
@mozram, it is surprising that it was working for you in WSL 1. Unfortunately for me, Both don't work for me. |
@sanastasiou , hopefully any fix can work for both WSL 2 and hyper-V since the issue persist in both. |
Interestingly, even when I used mpich on windows, it only sees 32 physical cores. I guess this issue isn't just limited to WSL or hyper-V |
Any updates? |
Changing WSL config has 0 effect whatsoever. 2nd CPU is not recognized. |
I tried contacting AMD customer support about the issue and if they have any fixes but to no avail. |
Ben said "I am already looking into this, AMD brought this to my attention as well." |
Not quite true, I have a dual xeon setup and it only detects one of them. So it doesn't affect only 3990X |
@sanastasiou , my apologies, I meant within the AMD thread ripper line, only the 3990x is affected. by the way, did you test if the same issue persists when you use hyper-V? because it is the case for me. |
I have the same issue with Intel Xeon. I have two 6242R CPUs (2 sockets), and only 1 socket is available from WSL 2. |
@ykim362 Which Windows are you using? Do you have the same issue with hyper-V? |
@AAlMutairi how do I enable/how can I check this with Hyper-V? |
@sanastasiou it is similar to WSL in which you enable it through the "Turn Windows features on or off" as shown here: Then use the "Hyper-V quick create" as shown here (based on old windows but it is still the same): I guess you can install an Ubuntu VM for now. if you right click on the VM you can access it setting and change the number of cores and sockets you want. Then you can run and test. |
@AAlMutairi I was able to configure the number of virtual cores (2 x physical cores) with Hyper-V (on windows 10 enterprise). But, I am not sure it's really using all CPUs, or just doing virtually showing 2x more cpus. It was 40 logical cores (20 physical cores) by default, and even after I increased the number to 80 logical cores, it only shows as 1 socket. lscpu Architecture: x86_64 |
You can launch |
Can you please send compiled dll? Cant undestand how to compile by myself |
Hey guys got a dual Intel Xeon Gold 6430 with the same problem only utilising 64 out of my 128 cores; any chance that this pushed to upstream? We cant really compile from scratch as its a corporate environment however it still a slightly bigger issue for us as it wont be approved in a package push |
I'm hoping for some positive news given David Cutler mentioned in his interview with Dave's Garage that he's rocking a 96 core PC as his personal system. Given the need for either a Hyper-V change, or to override the scheduler (from root to core), I don't think this will happen before the next major version (25H2? or 12) |
Its just a overriding the scheduler thats the issue, you also need that custom dll to capture all cores, hoping they fix it soon. |
I have compiled .dlls for x86 and arm64 under releases on my fork. |
Hey, I'm pretty much a noob so please excuse the dumb questions. Can I do the hack without redoing everything that already is built on top of WSL? Sorry, I'm currently trying to pull of a project server for my finals for LLMs and I should've started by installing Ubuntu instead of Windows Server 2022, it's been a massive pain to even get Docker running. Now using Docker Desktop despite it not being supported but if it works it works... |
Never mind, I figured it out. Used Threads went from 44 to 88 but it still only uses 128GB of RAM instead of 256GB though. And I can't get Open-Webui to run in CPU only mode, it always uses the Titan Xp which isn't that great for very large models |
You can change ram with .wslconfig |
@xieyubo I was trying to follow your instruction, but where should I create Project.sln file? Windows? WSL2? and how can I build it? Sorry I'm just no familiar with it. |
Confirming this is still an issue with the latest kernel update. I had a small hope that we might see a fix as I saw some stuff about hyper-v fixes in the previous kernel update attempt. |
The issue being mentioned in this comment is about WSL2 not recognizing >64 cores. Unfortunately, the issue the author is facing is likely due to a problem with multiple CPUs, and it probably cannot be resolved with computecore.dll and Core Schedular (at least, it didn't resolve the issue in my environment). In the case of multiple CPUs, even though nproc and lscpu display the correct number of processors, MPI only uses cores for 1 CPU in Root Schedular and half of threads in Core Schedular. Root SchedularCore Schedular |
Hi Unfortunately, there is no development on this issue. There are constant requests on this issue, but they are marked as "duplicate requests" and directed to old notifications. Is there any development? Actually, there are multiple expectations regarding this NUMA issue; It would be really great if such a development could be made. Thank you in advance for your efforts. |
@muratyurdakul75 - I have a fix in PR for this - stay tuned... |
I can't wait. I hope there will be an improvement as soon as possible. :) |
I’m almost retired to wait for the fix 😵
…On Sat, 30 Nov 2024 at 15:30 Murat Yurdakul ***@***.***> wrote:
@muratyurdakul75 <https://github.com/muratyurdakul75> - I have a fix in
PR for this - stay tuned...
I can't wait. I hope there will be an improvement as soon as possible. :)
—
Reply to this email directly, view it on GitHub
<#5423 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCRJQDXROHBUO44J4M4GUL2DFZTPAVCNFSM4N75246KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJQHA4DQNRRG4ZA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm in the same situation. :) |
my project is python based. My solution is moved back from wsl docker to
normal python app run on windows with multiprocess startup and link its
data together. After that i’m able to assign which process mask i need then
expand to every single core. Did it since 2021 to now.
On Sat, 30 Nov 2024 at 15:34 Murat Yurdakul ***@***.***>
wrote:
… I’m almost retired to wait for the fix 😵
… <#m_-7220106275844444503_>
On Sat, 30 Nov 2024 at 15:30 Murat Yurdakul *@*.*> wrote:
@muratyurdakul75 <https://github.com/muratyurdakul75>
https://github.com/muratyurdakul75 <https://github.com/muratyurdakul75> - I
have a fix in PR for this - stay tuned... I can't wait. I hope there will
be an improvement as soon as possible. :) — Reply to this email directly,
view it on GitHub <#5423 (comment)
<#5423 (comment)>>, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ACCRJQDXROHBUO44J4M4GUL2DFZTPAVCNFSM4N75246KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJQHA4DQNRRG4ZA
<https://github.com/notifications/unsubscribe-auth/ACCRJQDXROHBUO44J4M4GUL2DFZTPAVCNFSM4N75246KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJQHA4DQNRRG4ZA>
. You are receiving this because you commented.Message ID: @.*>
I'm in the same situation. :)
—
Reply to this email directly, view it on GitHub
<#5423 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCRJQHYZRTID6GI3OJPYQT2DF2CVAVCNFSM4N75246KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENJQHA4DQNZRGE2A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is there an estimated date? |
PR just got merged, hoping to tag a new prelease build this week. |
Excellent news. Thank you very much for your efforts. :) |
Thank you!!! |
Hey I tried to use https://github.com/microsoft/WSL/releases/tag/2.4.8 |
Ah ok I was able to utilize all cores by switching from root scheduler to Core as described in the repo above:
|
Environment
Steps to reproduce
I am using AMD threadripper 3990x in my PC. when I use the command lscpu I get the following
Also when I use the command nproc, I get 64.
However, using both openmpi and mpich to run parallel job, mpi uses only 32 cores (half real cores). For this test I used the following code (copied from: https://mpitutorial.com/tutorials/mpi-hello-world/)
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: