microsoft / WSL

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

Consider backporting PMU support for Alder Lake #8155

Open trympet opened 2 years ago

trympet commented 2 years ago

Is your feature request related to a problem? Please describe. There is no PMU driver for the Intel Alder Lake platform. Hardware event sampling does not work with VTune or perf.

vtune -collect hotspots -knob sampling-mode=hw -knob sampling-interval=0.5 /home/trym/source/stud/tdt4186/practical2/build/release/webserver /tmp 8889 12 24
vtune: Error: Unable to perform driverless collection on this platform.
vtune: Error: Cannot enable event-based sampling collection: Architectural Performance Monitoring version is 0. Make sure the vPMU feature is enabled in your hypervisor.
root@DESKTOP-CMKEO60:~# dmesg | grep -i pmu
[    0.177428] Performance Events: unsupported p6 CPU model 151 no PMU driver, software events only.

Describe the solution you'd like Backport the driver or provide an alternate solution.

Additional context AFAIK, the only workarounds are to use Hyper-V or dual boot.

https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.13-Perf-Alder-Lake
https://lore.kernel.org/lkml/20210311114814.GA5829@zn.tnic/T/

cpuid.txt

Trass3r commented 2 years ago

Reportedly a newer kernel alone is not enough: https://github.com/microsoft/WSL/issues/4678#issuecomment-1138625875 Your cpuid report does not list the features either:

   Architecture Performance Monitoring Features (0xa):
      version ID                               = 0x0 (0)
      number of counters per logical processor = 0x0 (0)
      bit width of counter                     = 0x0 (0)
      length of EBX bit vector                 = 0x0 (0)
      core cycle event not available           = false
      instruction retired event not available  = false
      reference cycles event not available     = false
      last-level cache ref event not available = false
      last-level cache miss event not avail    = false
      branch inst retired event not available  = false
      branch mispred retired event not avail   = false
      fixed counter  0 supported               = false
...
      fixed counter 31 supported               = false
      number of fixed counters                 = 0x0 (0)
      bit width of fixed counters              = 0x0 (0)
      anythread deprecation                    = false
clemenswasser commented 1 year ago

@benhillis are you aware of this issue and is there maybe even a fix coming? It's very frustrating not to have PMU support for Alderlake… (Especially since Hyper-V supports it, as @trympet pointed out)

clemenswasser commented 1 year ago

I've hit this today again, since I wanted to profile something under Linux. Why is this not being fixed?!? "Plain" Hyper-V already supports PMU's with Alderlake! I hope you can understand that this is really frustrating as a user 😞...

topolarity commented 1 year ago

I'm interested in this feature, as well.

WSL2 has been a great experience for me, but it's a real shame not to be able to get HW perf counters on newer CPUs.

tyler274 commented 1 year ago

This is also an issue for me as well.

samlihaha commented 1 year ago

This is also an issue for me as well +1.

clemenswasser commented 1 year ago

I've also asked on Twitter: https://twitter.com/clemenswasser/status/1669265762991714304 Seems like we're just being ghosted 💀, which is extremely disappointing since many require performance counters support and they already work when using Hyper-V... @benhillis @craigloewen-msft ping, are you working on this?