install uProf in WSL2

I am trying to install uProf for c++ code profiling in my machine with a AMD Ryzen ThreadRipper 3960X.

I downloaded the .deb file and tried to install with:

sudo dpkg --install amduprof_x.y-z_amd64.deb

However, I get the error:

ERROR: Linux headers is required for installing AMD Power Profiler driver. Please install the sources using
sudo apt-get install linux-headers-5.10.60.1-microsoft-standard-WSL2 and then start the installation again.

I tried to install the headers and got:

Reading package lists... Done
Building dependency tree Reading state information... Done
E: Unable to locate package linux-headers-5.10.60.1-microsoft-standard-WSL2 E: Couldn't find any package by glob 'linux-headers-5.10.60.1-microsoft-standard-WSL2'
E: Couldn't find any package by regex 'linux-headers-5.10.60.1-microsoft-standard-WSL2'

I tried to check the headers I am using with:

uname -r

and got:

5.10.60.1-microsoft-standard-WSL2

What is the problem here?

Kind regards

1

1 Answer

WSL does not use the kernel from the distribution, but a specific kernel made by Microsoft. While the Microsoft kernel does support modules, it isn't compiled to use any, and in addition Microsoft doesn't ship packages for its kernel headers (although thesource is available on GitHub).

Your distro isn't responsible for Microsoft's kernel, so they also don't ship any headers for it, so there is no point in consulting its repository.

As a result, it isn't really possible to build kernel modules for WSL. If you want to use something that requires kernel modules, you'll need a real Linux system, either in a VM or on real hardware.

Your other option is to compile your own kernel.

For more information on compiling a WSL2 kernel, see the Stack Exchange post
WSL 2 does not have /lib/modules/.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like