Install uProf in Wsl2

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 the source 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

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

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.