Intel OneAPI
Intel OneAPI
The Intel oneAPI HPC Toolkit is a comprehensive suite of development tools that make it fast and easy to build modern code that gets maximum performance out of the newest Intel® processors. This toolkit enables high performance computing on clusters or individual nodes with flexible options including optimal performance on a CPU or GPU.
Intel oneAPI 是一種統一的跨架構的程式設計模型,提供了CPU、GPU、FPGA、專用加速器的產品。
2020年12月,英特爾發布了oneAPI軟體開發套裝,免費、並且取代了之前需要許可(購買)的Intel Parallel Studio。
Intel oneAPI toolkits包含了六大工具包:
- Intel® oneAPI Base Toolkit(包含了Intel Parallel Studio中常用的軟體以及 icc、MPI、DPCPP、MKL等)
- Intel® oneAPI HPC Toolkit(提供可擴充的快速C ++、Fortran、OpenMP和MPI應用程式)
- Intel® oneAPI IoT Toolkit
- Intel® oneAPI Rendering Toolkit
- Intel® AI Analytics Toolkit
- Intel® Distribution of OpenVINO™ Toolkit
對我們來說 Intel® oneAPI Base Toolkit + Intel® oneAPI HPC Toolkit 基本上就包含Intel Parallel Studio XE的功能了,關鍵還免費。
Intel OneAPI Toolkit 使用一流的編譯器, 效能庫, 框架以及分析和偵錯工具在CPU 和XPU 上分析和優化高效能, 跨架構應用程式. 我們的伺服器上安裝了Base Toolkit 和HPC Toolkit, 包含icc compiler, debugger, mkl 數學庫, intel MPI, vtune 等軟體, 請參閱官網查看完整軟體清單及使用方法。
Intel® oneAPI Base Toolkit: 「Intel® oneAPI基本工具包」(Base Kit)是一套核心工具和函式庫,用於跨各種體系結構(CPU、GPU和FPGA)開發高效能、以資料為中心的應用程式. 它採用了業界領先的C++編譯器,實作了SYCL*,這是C++在異質運算上的發展。可以使用其他工具包來補充基本工具包,比如Intel® HPC Toolkit(包括Intel® Fortran編譯器, OpenMP* GPU offload和Intel® MPI庫),Intel® Rendering Toolkit(渲染和光線跟踪,用於高保真可視化應用程式)
Intel® HPC Toolkit:Build, analyze, and scale applications across shared- and distributed-memory computing systems. 高效能運算(HPC)是人工智慧、機器學習和深度學習應用程式的核心。 「Intel® HPC Toolkit」(HPC工具包)利用向量化、多執行緒、多節點並行化和記憶體最佳化的最新技術, 為開發人員提供建置、分析、最佳化和擴展HPC應用程式所需的功能。 此工具包是「Intel® oneAPI Base Toolkit」的附加元件,是實現完整功能所必需的。它包括功能強大的以數據為中心的庫、高級分析工具和Intel® Python*發行版,以實現核心Python數值、科學和機器學習套件的近乎本地程式碼效能。
原來用來編譯intel程式的「Intel全家桶」指的是Intel Parallel Studio XE,裡面整合了C/C++/Fortran語言的編譯器(分別是icc、icpc、ifort)、MKL數學函式庫及各種高效調試工具,甚至還有Intel MPI, 可以說是編譯量化軟體最常用的一套「裝備」。然而從2021年開始Intel不再提供舊版Parallel Studio XE下載頁面,而是改成了(或稱升級成了)oneAPI, oneapi包括上述6個套件。
但Base Toolkit套件裡含icc、icpc編譯器和MKL函式庫,卻不含ifort。而HPC Toolkit包裡含icc、icpc、ifort,卻不含MKL庫。顯然下載任一個包都無法完全取代以前的「全家桶」。 因此平台採用安裝Intel Base Toolkit和HPC Toolkit方法,來取代先前的Parallel Studio XE。
Intel® VTune™ Profiler:發現並最佳化CPU、GPU和FPGA系統的效能瓶頸。
Command Line Download
Command Line Installation Parameters
Get latest version https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html?operatingsystem=linux&distributions=offline
1 |
|
For BaseKit, there is no dependence needs if doesn't install Intel Advisor and Intel VTune,
- Dependencies (10)
- Intel Advisor,它可以幫助開發者對程式進行並行處理的優化,提高程式的性能 link
- Intel VTune 是intel公司開發的一款強大的效能瓶頸分析軟體,能幫助開發者找出效能影響因素
or,
download list: https://get.hpc.dev/vault/intel/
or,
Direct download,
- intel-oneapi-base-toolkit-2025.0.0.885_offline.sh (2.4GB)
- intel-oneapi-hpc-toolkit-2025.0.0.825_offline.sh (2.4GB)
Installation Instructions
The initial download is for the installer application files only. The installer will acquire all the tools during the installation process.
- Step 1: From the console, locate the downloaded install file.
- Step 2:
- Use $ sudo sh ./
.sh to launch the GUI Installer as root. - Optionally, use $ sh ./
.sh to launch the GUI Installer as current user.
- Use $ sudo sh ./
- Step 3: Follow the instructions in the installer.
- Step 4: Explore the Get Started Guide.
(Option) Get Started with the Intel oneAPI HPC Toolkit for Linux
Although the CMake
and pkg-config
build tools are not required by the oneAPI tools and toolkits, many oneAPI samples are provided as CMake
projects and require CMake
to build them. In some cases pkg-config
is necessary to locate libraries needed to complete a build of the application.
The Intel compilers utilize the existing GNU build toolchains to provide a complete C/C++ development environment. If your distribution of Linux does not include the complete suite of GNU development tools, you need to install these tools.
To install CMake
, pkg-config
, and the GNU development tools on your Linux system, open a terminal session and enter the following commands:
1 |
|
Verify the installation by displaying the installation location with this command:
1 |
|
Install on cluster (no sudo)
Online/Offline Installer:
- Online/Offline Installer
- If you do not have root (administrative or sudo) permissions, you can install the toolkit only in your home directory or a user-specific location. Refer to user installation commands in this document.
--silent
(Run the installer in non-interactive (silent) mode.)--install-dir
(Silent, default installation directory, Supported in silent mode. Customize the installation directory.)
- Command Line Options
/home/wpsze/intel/oneapi/
1 |
|
1 |
|
Compiler 對照表
GNU | Intel | MVAPICH2 | OpenMPI | IntelMPI | |
---|---|---|---|---|---|
C | gcc | icc/icx | mpicc | mpicc | mpiicc |
C++ | g++ | icpc/icpx | mpic++/ mpicxx | mpiCC/mpic++/mpicxx | mpiicpc |
Fortran | g77/gfortran | ifort/ifx | mpif77/mpif90/mpifort | mpifort/mpif77/mpif90 | mpiifort |
Check
In my caes, it is installed in /home/wpsze/intel/oneapi/
remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
Intel oneAPI's icc
and icpc
have been replaced by icx
. We do not have icc
and icpc
installed on our servers, so please use icx
for C and C++ compilation. The usage is similar to the original compiler, for example: icx
your_code.cpp -o output.
ICC (Linux), ICL (Windows) are classic Intel C/C++ Compilers. Whereas, ICX is Intel nextgen compiler based on Clang /LLVM technology plus Intel proprietary optimizations and code generation.
- You may use ICC for performance on CPU targets.
- ICX enables OpenMP TARGET offload to Intel GPU targets.
The following are the guiding principles for ICX:
- ICX and ICC Classic use different compiler drivers. The Intel® C++ Compiler Classic compiler drivers are icc, icpc, and icl. The Intel® oneAPI DPC++/C++ Compiler drivers are icx and icpx. Use icx to compile and link C programs, and icpx for C++ programs.
- Unlike the icc driver, icx does not use the file extension to determine whether to compile as C or C+. Users must invoke icpx to compile C+ files. . In addition to providing a core C++ Compiler, ICX/ICPX is also used to compile SYCL/DPC++ codes for the Intel® oneAPI Data Parallel C++ Compiler when we pass an additional flag “-fsycl”.
1 |
|
Remark
- The icc and icpc commands resemble the GNU equivalents gcc and g++. This is a highly optimizing C (icc) and C++ (icpc) compiler.
Set Environment Variables for CLI Development
Option 1: Source setvars.sh once per session
Source setvars.sh every time you open a new terminal window:
You can find the setvars.sh script in the root folder of your oneAPI installation, which is typically /opt/intel/oneapi/ for system wide installation and ~/intel/oneapi/ when installed as a private installation. Note that system wide installation requires root or sudo privileges.
For system wide installations:
1 |
|
For private installations:
1 |
|
Build and Run a Sample Project Using the Command Line
To compile and run a sample:
- Download the sample using the oneAPI CLI Samples Browser. (Command line interface (CLI))
1 |
|
- Compile and run the sample with Make*
1 |
|
Output: > start: 23/05/04 10:59:07.161 > > ./matrix_mul_dpc > Device: Intel(R) xxxx(xx) ix-xxxxS CPU @ x.xxGHz > Problem size: c(150,600) = a(150,300) * b(300,600) > Result of matrix multiplication using SYCL: Success - The results are correct! > > end: 23/05/04 10:59:14.409
Compile WRFv440 with Intel OneAPI
Ref: [WRF installation on a Linux-based machine]
1 |
|
If it is sucessful, the following exe will be gnerated,
1 |
|
References
- How to install Intel OneAPI Base and HPC Toolkits
- Ubuntu20.04 安装 INTEL 编译器和 Gcc 编译器
- 先安装Base Toolkit,再安装 HPC Toolkit
- 安装gcc5.4编译器
- 安装module
- 编写 modulefile
- Intel oneAPI toolkits 介绍和安装
- 对于气象中的应用,主流数值模式基本都是以Fortran编写的,为了追求更高的计算速度,我们尽量使用的intel编译器
- ifort编译的程序运行速度比gfortran要高一些。尽管高的不是非常多,但对于模式长时间的积分,节省的时间还是非常可观的
- 对于我们的使用需求,只需安装Intel® oneAPI Base Toolkit 和 Intel® oneAPI HPC Toolkit 就满足了
- Install Intel oneAPI | lenovo
- oneAPI资源和安装
- Intel学生许可过期后,安装 Intel® oneAPI Base Toolkit 和 Intel® oneAPI HPC来替代
- 之前的Intel Parallel Studio XE用邮箱申请了学生许可,已经过期,发现不能再续期,官网竟然出了免费版本!
- A Historic Moment for The Intel® Fortran Compiler Classic (ifort)
oneAPI Package Version | ifx version | ifort version |
---|---|---|
2024.0.x | 2024.0.x | 2021.11.x |
2024.1.0 | 2024.1.0 | 2021.12.0 |
2024.2.0 | 2024.2.0 | 2021.13.0 |
2025.0.0 (future) | 2025.0.0 | not included |