How to run HPL/HPCG/IO500 in WSL
0. PC Info
| Name | Info |
|---|---|
| Edition | Windows 11 Pro Insider Preview 64-bit 22H2 (10.0, Build 1000.23451.1000.0) (23451.ni_prerelease.230428-1438) |
| Processor | 12th Gen Intel(R) Core(TM) i7-12700H (14 Cores 20 CPUs), ~2.3GHz |
| Memory | 16384MB RAM + 18925MB Page File |
1. HPL (High-Performance Linpack)
0. Info
| Name | Version |
|---|---|
| OS | Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) |
| GCC | gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1) |
| OpenMPI | 4.1.5 |
| OpenBLAS | 0.3.23 |
1. Install WSL
-
In Windows 11, you can get WSL from Microsoft Store.
-
Run Ubuntu from the start menu and set a username and password. When finished you will see output like following:
Installing, this may take a few minutes... Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username: hangyi New password: Retype new password: passwd: password updated successfully The operation completed successfully. Installation successful! To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage This message is shown once a day. To disable it please create the /home/hangyi/.hushlogin file. hangyi@DESKTOP-VHIQPUO:~$ -
You can use the following commands to view system information.
uname -a && lsb_release -aOutput like this, I use Ubuntu 22.04.2 LTS:
Linux DESKTOP-VHIQPUO 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy -
If you exit, you can run
wsl -d Ubuntu --cd ~to return Ubuntu.
2. Install OpenMPI and OpenBLAS
-
If you are not confident about your network situation, it is recommended to configure a mirror source.
sudo sed -i 's@//.*.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.listRunning the above command will change your source address to the USTC mirror source. You may need to enter the password you set during the WSL installation.
-
Install the compile tools.
sudo apt update && sudo apt install -y build-essential gfortran -
Installing using the package manager should be the easy way out, but the version may be older.
sudo apt install -y libopenmpi-dev libopenblas-dev -
Test if the installation was successful:
gcc --version && gfortran --version && mpirun --version && find /usr -name libmpi.so && find /usr -name libopenblas.aIf the outputs like the following, it's OK:
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. mpirun (Open MPI) 4.1.2 Report bugs to http://www.open-mpi.org/community/help/ /usr/lib/x86_64-linux-gnu/libmpi.so /usr/lib/x86_64-linux-gnu/libopenblas.a