-
Notifications
You must be signed in to change notification settings - Fork 841
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
Support hardware performance counters - WSL2 #4678
Comments
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Wait your ask is different. References above still worthy, but de-duped. |
I think this is a blocker for running rr in wsl2. |
Any plan to support hardware performance counters? |
@zexuan You can enable those thinkering with vmwp binary. It is self explanatory once you open it with let's say IDA (you need to patch only the initial calls in the function setting the flags). However you can't rr windows binaries so it's kind of pointless to me. |
@bsld Could you maybe expand how you did this? Hardware performance counters would be tremendously helpful for my work as I need reverse debugging and gdb Is this feature on the WSL2 roadmap at some point? |
The ProcessorSettings are read from some Or you patch vmwp.exe. |
FWIW |
rr is also way faster. AutoFDO is also prevented by the lack of hw perf counters. |
The patch doesn't work in Windows 10 Build 19042. Patched WSL cannot start and prints "Incorrect function." |
Well since they change the file with every update patching it is not really an option anyway. |
... and patching that way seems to be host-processor specific, too ... |
Any updates on this? |
This change is makings its way to the Store version of WSL soon. |
😕 Which change? Do you patch vmvp.exe in the distributed WSL? Which "store version" (only distributions are part of the store, not WSL itself, which is a Windows feature and therefore updated with Windows update)? ❓ |
No they finally fixed it but it's gonna be Win11-only it seems. |
Yay!
Oh no, the store is blocked (and there's no Win11 for a multitude of persons) - @benhillis Can you please ensure that this is getting to the WSL feature, too (or at least, if this is really necessary push that over to W10, too). |
@GitMensch - this is a perfect example of why we want to move to shipping outside of Windows. It is a very expensive proposition to change in-market versions of Windows and something like this would be unlikely to meet the bar. |
We are evaluating bringing the store version of WSL back to older versions of Windows 10, but cannot yet comment on timelines. |
So with the current store version - can someone please the output of: perf stat -e br_inst_retired.conditional true
dmesg | grep PMU |
Installed WSL preview from the Windows Store just now (I use W11 Insiders Beta channel):
Is it possible to post instructions/minimum versions to diagnose this issue? |
@oscarbg - would you please create a new issue for the corrupt bios issue? |
Does anyone know if this also affects |
Anybody got IPT working with this? |
fwiw |
We know that this won't land in Windows 10 - but is there any option to install the new WSL2 release in a Windows 11 "normal" version (no insider)? |
@GitMensch you have to install it using shell with admin rights. I'm away from home and don't have the command on my phone. |
@mati865 Thanks for the pointer - After uname -r
sudo apt update
sudo apt uprade
sudo apt install linux-perf
sudo sh -c 'echo -1 >/proc/sys/kernel/perf_event_paranoid'
dmesg | grep PMU
perf list | grep br_inst_retired I don't get any br_inst_retired perf events (which is different than @hbirler) but
Did I miss something? |
I've missed something - people that check for |
@benhillis probably needs to be updated for newer processors? |
Not sure, but I guess that's kernel related. Would be nice to get a 5.15 kernel, soon (release-ring has 5.10.102 as noted in the images above, not sure if insiders have a newer version). |
Ah yeah worth a try: https://github.com/nathanchance/WSL2-Linux-Kernel |
Upgrading the kernel to @nathanchance's version does not help me. |
So the |
Possibly related #8155 |
I am using Intel i9-12900K CPU with latest Windows 11, latest WSL2 (using dmesg | grep PMU
[ 0.040335] Performance Events: unsupported p6 CPU model 151 no PMU driver, software events only. Linux kernel version: uname -a
Linux evian-workstation 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
@benhillis is there any hope the decoupled WSL will still land on Win10? |
It just landed in KB5020030! |
I know. But after it you get the 1.0 store version via |
@Trass3r do you know if there is a KB5020030 equivalent for Win 11 22H2? (Even with WSL v1.0, perf counters are still not working for me, Alderlake with latest Win 11 updates) |
There's no need on Win11, that KB is more of backport of the changes that allow the separation of WSL from the base system. |
Hi, folks. Thanks for working on this! Could someone summarize where the state of hw perf counters on Windows 10 ended up? I read through this ticket and the related linked pages, but I'm not sure I fully followed it. My read here was that on an up-to-date Windows 10 22H2, doing My experienceI've got a home-made PC "fflewdur" with an AMD 3950x CPU, dual-booting Windows 10, 11, and Linux. To test this, I'd do a fresh install of Windows 10 or 11 from a bootable USB drive of the latest installer (downloaded a couple days ago) to a freshly-formatted volume, do a full Windows Update, full Microsoft Store update, sign in to OneDrive, and then run On a fresh Win 10 22h2 like that, doing
Note there were two "Windows Subsystem for Linux" items there. When watching the installation, I could see each one got its own progress bar. My machine state after a reboot:
In that new WSL Ubuntu:
I can see a WSL item showing as installed in both the Windows features and Microsoft Store (and Settings > Apps & features) interfaces. Over on the Windows 11 side of things on this same machine, the same process resulted in a WSL where the hw perf counters are working, and WSL only shows up in Settings > Apps & features, not in the "Turn Windows features on and off".
|
https://superuser.com/a/1754527
|
Any tigerlake updates? pwsh wsl update> wsl --update --pre-release --web-download
Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed. wsl ubuntu kernel version$ uname -a
Linux WIN-ER7KSLJRTMP 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux dmesg result$ dmesg | grep -i 'perf'
[ 0.078762] Performance Events: unsupported p6 CPU model 170 no PMU driver, software events only.
[ 0.327316] Performance counters on wsl ubuntu os version$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy I wish I could run rr debugger on my laptop. |
How to enable them - currently they are disabled by default:
[ 0.184805] Performance Events: unsupported p6 CPU model 142 no PMU driver, software events only.
I tried this guide. However when I type
Get-VM
the list is empty.The text was updated successfully, but these errors were encountered: