- Install Intel oneAPI on Ubuntu 20.04 LTS
- Install the required drivers
- Install Intel oneAPI
- Configuration for Intel compilers
- References
- Install and manage Intel oneAPI compiler and component tools using environment modules
- Pre-requisites
- Intel Repository Public Key
- Configure apt client to use Intel repository
- Install all the packages or selected packages.
- All basic compilers (Fortran, C, C++, and Python)
- HPC toolkits
- IoT (internet of things) toolkits
- AI (Artificial Intelligence) analytics toolkits
- Rendering toolkit
- After Installation
- Option 1: Activate all the components at once for all users (root access)
- Option 2: Activate individual components using the environment modules
- Overview
- environment
- Installation method
- Confirmation of installation method
- Installation using APT
- Pre-work
- Installation action
- Summary
Install Intel oneAPI on Ubuntu 20.04 LTS
In order to use Intel C compiler and Intel Fortran compiler for numerical computation, Intel oneAPI Base Toolkit and HPC Toolkit (Intel Fortran) on Ubuntu 20.04 LTS of WSL2 of Windows 10 Pro were installed. This site (in Japanese) was referred.
The Intel compilers are now available free of charge, and can be installed using apt, which is very convenient.
Install the required drivers
Install the required drivers by referring to here.
# Add package repository sudo apt-get install -y gpg-agent wget wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | sudo apt-key add - sudo apt-add-repository 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' # Install run-time packages sudo apt-get update sudo apt-get install intel-opencl-icd intel-level-zero-gpu level-zero intel-media-va-driver-non-free libmfx1 # OPTIONAL: Install developer packages sudo apt-get install libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev
After this, the following GPU-related settings were written; but I ignored them because I don’t have a GPU.
stat -c "%G" /dev/dri/render* . # for GPU
Install Intel oneAPI
Work in the directory /tmp , which is accessible to both user and root.
cd /tmp wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt update
Specify the packages to install. Here Base Toolkit and HPC Toolkit were installed. Installation of Base Toolkit took a long time.
sudo apt install intel-basekit sudo apt install intel-hpckit
The installation directory is /opt/intel/oneapi .
Configuration for Intel compilers
To use the Intel compilers, execute the following. Appending this to ~/.bashrc will save you the trouble of running it every time.
source /opt/intel/oneapi/setvars.sh
Check the version of the compiler.
ifort --version icc --version icpc --version
References
Install and manage Intel oneAPI compiler and component tools using environment modules
Just like HPC clusters, manage intel components using module load commands.
Intel has recently changed their business model. Their suite of compilers, debuggers, toolkits, and libraries are given free of cost for personal or academic use. In an earlier post, I explained how to install them on Ubuntu linux and activate all the softwares using a single source command.
In this post, I will show you how to manage these compilers, libraries, and debuggers using the environment modules. So just using “ module load icc ” you could activate a single “ icc ” compoment. All the dependent modules will also be loaded automatically, if you follow the these steps.
Pre-requisites
Make sure that you have the following packages already installed on your ubuntu machine.
- environment modules (i.e. the module command)
- Intel oneapi basekit and/or hpckit (I am repeating the steps below)
Intel Repository Public Key
Get the Intel Repository public key and add it to your apt sources keyring so the packages will be trusted by ubuntu.
# use wget to fetch the Intel repository public key wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB # add to your apt sources keyring so that archives signed with this key will be trusted. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB # remove the public key rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Configure apt client to use Intel repository
echo «deb https://apt.repos.intel.com/oneapi all main» | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo add-apt-repository «deb https://apt.repos.intel.com/oneapi all main»
Install all the packages or selected packages.
All basic compilers (Fortran, C, C++, and Python)
sudo apt install intel-basekit
HPC toolkits
sudo apt install intel-hpckit
IoT (internet of things) toolkits
sudo apt install intel-iotkit
AI (Artificial Intelligence) analytics toolkits
sudo apt install intel-aikit
Rendering toolkit
sudo apt install intel-renderkit
After Installation
After you have installed the oneAPI kits, they can be activated using the following command written in the ~/.bashrc file.
Option 1: Activate all the components at once for all users (root access)
Option 2: Activate individual components using the environment modules
- cd /opt/intel/oneapi/
- You will see a modulefiles-setup.sh file. If we execute this file using bash it will create a folder named modulefiles in the same /opt/intel/oneapi/ folder.
- Put the following line into your $HOME/.bashrc file
- export MODULEPATH=$:/opt/intel/oneapi/modulefiles
- . $HOME/.bashrc or close and reopen the terminal
#%Module1.0################################################################### set min_tcl_ver 8.4 if < $tcl_version < $min_tcl_ver > < puts stderr " " puts stderr "ERROR: This modulefile requires tcl $min_tcl_ver or greater." puts stderr "Your system reports that tclsh version $tcl_version is installed." exit 1 >proc ModulesHelp < > < puts stderr "\tAdds Intel Python 3 to your PATH environment variable\n" >module-whatis "adds Intel Python 3 to your PATH environment variable" prepend-path PATH /opt/intel/oneapi/intelpython/latest/bin
Check the installed packages using module avail , check the loaded packages using module list , unload packages using module unload packagename
Search content by categories
Ravindra Shinde
Research Scientist
I am a theoretical and computational condensed matter physicist and quantum chemist. I am currently working as a researcher at the University of Twente, the Netherlands. I am also the founder of The Science Dev.
Overview
Following the previous article, we have summarized the procedure for installing the Linux version of Intel Fortran (to be exact, Intel oneAPI Base Toolkit + HPC Toolkit). I used apt for installation.
environment
Installation method
You need to install two of them.
The Linux version of Base Kit and HPC Kit has four installation methods. There are 5 ways including Docker Hub.
- Download and install the installer
- Installation using APT Package Manager
- Installation using YUM Package Manager
- Installation using Zypper Package Manager
- Using Docker Hub
In this article, I will explain how to use No. 2 apt. Others are just a brief touch.
Confirmation of installation method
Access the official Intel page Free Intel® Software Development Tools and click [Get the Base Kit] to go to the Base Kit download page.
Select Linux as the OS.
Five items will appear in Distribution.
If you select one of these, the installation method will be explained.
Web & Local If you select Web & Local for Distribution, an item for selecting the Installer Type will appear, so select either Local installation or Online installation.
When all the items are selected, the explanation of the installer, the contents of the software included in the installer, and the file size are displayed as shown in the figure below, and the [Download] button appears.
The extension of the installer is .sh , so download the installer and start the installer with the bash command.
sudo bash l_BaseKit_p_2021.1.0.2659_offline.sh
In the Linux version, you can also download with wget, so the download + install command is written at the bottom of the page.
The same applies to the HPC Kit. The command in that case is
sudo bash l_HPCKit_p_2021.1.0.2684_offline.sh
This method only needs to be installed once, but I received a comment that the update seems to be difficult.
Linux version can be installed in multiple ways, but installing with apt or package management seems to be easier to update. Feeling. It was in beta, but when I put it in a script, I uninstalled everything with another script in the back of the directory and reinstalled the new version.
& mdash; Cure-Rice (@ Fortran2008) January 16, 2021
Docker Hub If you select Docker Hub for Distribution, the Docker Pull command will be displayed.
docker pull intel/oneapi-basekit
The commands for the HPC Kit are as follows.
docker pull intel/oneapi-hpckit
Package Manager If you select APT, YUM, or Zypper Package Manager for Distribution, a link to the page that describes the installation method will appear.
The links to the pages that describe the installation method are as follows (common to Base Kit and HPC Kit).
Of these, only the method of installing using APT will be mentioned, but the preliminary work is common.
Installation using APT
Pre-work
—Check if the computer and OS meet the system requirements of oneAPI. —If you have the beta version of oneAPI installed, uninstall them.
apt autoremove 'intel-*kit' 'intel-oneapi*'
—When using GPGPU with Intel GPU, Install Driver
The author’s environment meets the system requirements, I haven’t installed the beta version, and I have no plans to do GPGPU, so I didn’t have to do any prior work.
Installation action
Obtain the public key of the Intel repository and add it to the APT keyring so that the archive signed with that key is trusted.
$ wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB $ sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Next, set APT to check the Intel repository.
$ echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
After that, execute sudo apt update to update the package list.
After apt update is finished, install Base Kit and HPC Kit. The package names are summarized in List of Intel one API Packages.
$ sudo apt install intel-basekit $ sudo apt install intel-hpckit
oneAPI is installed in / opt/intel/oneapi .
To use the installed packages, including Intel Fortran, you need to run setvars.sh located in the installation directory.
source /opt/intel/oneapi/setvars.sh
$ ifort --version Command 'ifort' not found, did you mean: command 'isort' from deb isort Try: sudo apt install $ source /opt/intel/oneapi/setvars.sh :: initializing oneAPI environment . BASH version = 4.4.20(1)-release :: advisor -- latest :: ccl -- latest :: clck -- latest :: compiler -- latest :: dal -- latest :: debugger -- latest :: dev-utilities -- latest :: dnnl -- latest :: dpcpp-ct -- latest :: dpl -- latest :: inspector -- latest :: intelpython -- latest :: ipp -- latest :: ippcp -- latest :: itac -- latest :: mkl -- latest :: mpi -- latest :: tbb -- latest :: vpl -- latest :: vtune -- latest :: oneAPI environment initialized :: $ ifort --version ifort (IFORT) 2021.1.2 20201208 Copyright (C) 1985-2020 Intel Corporation. All rights reserved.
You can see that Intel Fortran 2021.1 is running successfully.
If you don’t want to type it every time, you can solve it by adding the above command to the shell startup script.
There is also a Page equivalent to the Get Started Guide for Windows.
Summary
I introduced the installation procedure of Intel Fortran Linux version integrated as Intel one API.
By using a package manager such as APT, you can easily install with just a command.