0

I built and configured a kernel in WSL2 (wsl-5.4.91, gcc 9.4.0, Ubuntu 18.04 WSL)

While installing MLNX_OFED I get the error that there are no files in the lib/modules//build/scripts.

I there an easy way to copy the scripts in there?

I read this but didn't get far: https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules


Here is how I got there:

home/thilo/MLNX_OFED_LINUX-5.4-1.0.3.0-ubuntu18.04-x86_64# ./mlnxofedinstall --add-kernel-support

but I got the following error:

ERROR: Failed executing "MLNX_OFED_SRC-5.4-1.0.3.0/install.pl --tmpdir /tmp/MLNX_OFED_LINUX-5.4-1.0.3.0-5.4.91-MS-new-WSL2+/mlnx_iso.127_logs --kernel-only --kernel 5.4.91-MS-new-WSL2+ --kernel-sources /lib/modules/5.4.91-MS-new-WSL2+/build --builddir /tmp/MLNX_OFED_LINUX-5.4-1.0.3.0-5.4.91-MS-new-WSL2+/mlnx_iso.127 --without-dkms --without-debug-symbols --build-only --distro ubuntu18.04" ERROR: See /tmp/MLNX_OFED_LINUX-5.4-1.0.3.0-5.4.91-MS-new-WSL2+/mlnx_iso.127_logs/mlnx_ofed_iso.127.log Failed to build MLNX_OFED_LINUX for 5.4.91-MS-new-WSL2+

Opening the mlnx_ofed_iso.127 file to see for the error

Logs dir: /tmp/MLNX_OFED_LINUX-5.4-1.0.3.0-5.4.91-MS-new-WSL2+/mlnx_iso.127_logs/OFED.326.logs

General log file: /tmp/MLNX_OFED_LINUX-5.4-1.0.3.0-5.4.91-MS-new WSL2+/mlnx_iso.127_logs/OFED.326.logs/general.log [32m

Below is the list of OFED packages that you have chosen

(some may have been added by the installer due to package dependencies): [0m ofed-scripts mlnx-tools mlnx-ofed-kernel-utils mlnx-ofed-kernel-modules iser-modules isert-modules srp-modules mlnx-nvme-modules kernel-mft-modules knem-modules

Checking SW Requirements...

[31mOne or more required packages for installing OFED-internal are missing.[0m

[31m/lib/modules/5.4.91-MS-new-WSL2+/build/scripts is required for the Installation.[0m

[31mAttempting to install the following missing packages: python3-distutils dh-python make dh-autoreconf chrpath linux-headers-5.4.91-MS-new-WSL2+ dpatch swig build-essential bzip2 debhelper graphviz quilt python3 pkg-config gcc[0m

[31mFailed command: apt-get install -y python3-distutils dh-python make dh-autoreconf chrpath linux-headers-5.4.91-MS-new-WSL2+ dpatch swig build-essential bzip2 debhelper graphviz quilt python3 pkg-config gcc[0m

Tillmann2018
  • 327
  • 5
  • 10
  • I guess with passthrough you can get Infiniband hardware to run in a Linux VM, but RDMA isn't going to work properly, is it? You would need some cooperation from the Windows IOMMU. – stark Jul 13 '21 at 14:17

1 Answers1

0

So the WSL2 is a monolithic kernel, which means no modules are generated as they aren't supported by WSL2 by default. However when compiling yourself, you can compile and install modules by using sudo make modules_install once the kernel has finished compiling. In this case, you'll need to add the MLNX_OFED module to the kernel if it's not part of the native kernel and enable within the kernel config. I also recommend bumping your kernel version to the 5.10.x branch of WSL2 that exists now. See https://wsl.dev/wsl2-kernel-zfs/ for example, which covers adding ZFS.

WSLUser
  • 601
  • 5
  • 10