Featured image of post 记录:安装 Intel® OneAPI-2024.0

记录:安装 Intel® OneAPI-2024.0

OneAPI 是一种开放且基于标准的规范,支持多种架构类型,包括但不限于 GPU、CPU 和 FPGA。该规范具有直接编程和基于 API 的编程范式,Intel® OneAPI 则是一个软件套件,包含了多种工具和库,用于支持 OneAPI 规范。本文记录了在 CentOS 7.6 上安装 Intel® OneAPI-2024.0 的过程。

# 记录:安装 Intel® OneAPI-2024.0

Intel one API 由两个部分组成,前者为基础 Base Toolkit ,后者必须依赖前者,Intel one API HPC Toolkit,也就是要前后依次安装。

# Base Toolkit

Base Toolkit 是 Intel 的一个 API 基础工具包包括以下库和其他库

Intel® oneAPI DPC++/C++ Compiler
Intel® DPC++ Compatibility Tool
Intel® oneAPI DPC++ Library
Intel® oneAPI Math Kernel Library
Intel® oneAPI Threading Building Blocks
Intel® oneAPI Collective Communications Library
Intel® oneAPI Data Analytics Library
Intel® oneAPI Deep Neural Networks Library
Intel® Integrated Performance Primitives
Intel® VTune™ Profiler
Intel® Advisor
Intel® Distribution for GDB*
Intel® Distribution for Python* (separate download required)
Intel® FPGA Add-on for oneAPI Base Toolkit (separate download required)

# Base Toolkit 安装

  1. 下载安装包
$ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/163da6e4-56eb-4948-aba3-debcec61c064/l_BaseKit_p_2024.0.1.46_offline.sh
  1. 安装
$ chmod +x l_BaseKit_p_2024.0.1.46_offline.sh
$ sudo ./l_BaseKit_p_2024.0.1.46_offline.sh
  • 如果自定义安装在用户目录,就不需要 root 权限
./l_BaseKit_p_2024.0.1.46_offline.sh

然后将启动一个图形安装界面,继续操作:

(1)选择 Accept & customize

OneAPI-Accepet-2024-03-09

(2)选择安装的组件

OneAPI-Select-2-2024-03-09

(3)选择安装的路径

OneAPI-Select-3-2024-03-09

(4)选择 Next

OneAPI-Select-4-2024-03-09

(5)选择 2 然后开始安装

OneAPI-Select-5-2024-03-09

接下来等待安装完成即可。

# HPC Toolkit

运行基于 Base Toolkit ,这个必须作为后者安装

Intel® Fortran Compiler
Intel® Fortran Compiler Classic
Intel® Inspector
Intel® MPI Library
Intel® Trace Analyzer and Collector

# HPC Toolkit 安装

  1. 下载安装包
$ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/67c08c98-f311-4068-8b85-15d79c4f277a/l_HPCKit_p_2024.0.1.38_offline.sh
  1. 安装
$ chmod +x l_HPCKit_p_2024.0.1.38_offline.sh
$ sudo ./l_HPCKit_p_2024.0.1.38_offline.sh
  • 如果自定义安装在用户目录,就不需要 root 权限
./l_HPCKit_p_2024.0.1.38_offline.sh

必须安装的库文件: Intel® MPI Library Intel® Fortran Compiler (Beta) & Intel® Fortran Compiler Classic Intel® oneAPI DPC++/C++ Compiler & Intel® C++ Compiler Classic

安装过程与 Base Toolkit 类似,不再赘述。

# 环境配置

安装完成后,需要配置环境变量,以便在终端中使用 Intel® oneAPI 工具。

在 HPC 环境中,使用 modulefile 来管理环境变量,可以使用 module 命令来加载环境变量。

以下是参考的 modulefile 文件,可以根据自己的安装路径进行修改。

#%Module1.0#####################################################################
##
## modules modulefile
##
proc ModulesHelp { } {
        global version prefix

        puts stderr "\tmodules - loads the modules software & application environment"
        puts stderr "\n\tThis adds $prefix/* to several of the"
        puts stderr "\tenvironment variables."
        puts stderr "\n\tVersion $version\n"
}

module-whatis	"loads intel/oneapi2024.0"

# for Tcl script use only
set	version		oneapi2024.0
set	prefix		/opt/software/intel/oneapi2024.0

conflict	intel

prepend-path	TBBROOT			${prefix}/tbb/2021.11/env/..
prepend-path	DAALROOT		${prefix}/cdal/2024.0
prepend-path	DPCT_BUNDLE_ROOT	${prefix}/dpcpp-ct/2024.0
prepend-path	INSPECTOR_2023_DIR	${prefix}/inspector/2024.0
prepend-path	ONEAPI_ROOT		${prefix}
prepend-path	PKG_CONFIG_PATH		${prefix}/vtune/2024.0/include/pkgconfig/lib64:${prefix}/tbb/2021.11/env/../lib/pkgconfig:${prefix}/mpi/2021.11/lib/pkgconfig:${prefix}/mkl/2024.0/lib/pkgconfig:${prefix}/ippcp/2021.9/lib/pkgconfig:${prefix}/inspector/2024.0/include/pkgconfig/lib64:${prefix}/dpl/2022.3/lib/pkgconfig:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/../lib/pkgconfig:${prefix}/cdal/2024.0/lib/pkgconfig:${prefix}/compiler/2024.0/lib/pkgconfig:${prefix}/ccl/2021.11/lib/pkgconfig:${prefix}/advisor/2024.0/include/pkgconfig/lib64:
#prepend-path	PKG_CONFIG_PATH		${prefix}/vtune/2024.0/include/pkgconfig/lib64:${prefix}/tbb/2021.11/env/../lib/pkgconfig:${prefix}/mkl/2024.0/lib/pkgconfig:${prefix}/ippcp/2021.9/lib/pkgconfig:${prefix}/inspector/2024.0/include/pkgconfig/lib64:${prefix}/dpl/2022.3/lib/pkgconfig:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/../lib/pkgconfig:${prefix}/cdal/2024.0/lib/pkgconfig:${prefix}/compiler/2024.0/lib/pkgconfig:${prefix}/ccl/2021.11/lib/pkgconfig:${prefix}/advisor/2024.0/include/pkgconfig/lib64:
prepend-path	VT_MPI			impi4
prepend-path	ACL_BOARD_VENDOR_PATH	/opt/Intel/OpenCLFPGA/oneAPI/Boards
prepend-path	FPGA_VARS_DIR		${prefix}/compiler/2024.0/lib/oclfpga
prepend-path	CCL_ROOT		${prefix}/ccl/2021.11
prepend-path	VT_ADD_LIBS		"-ldwarf -lelf -lvtunwind -lm -lpthread"
prepend-path	I_MPI_ROOT		${prefix}/mpi/2021.11
prepend-path	FI_PROVIDER_PATH	${prefix}/mpi/2021.11//libfabric/lib/prov:/usr/lib/x86_64-linux-gnu/libfabric
prepend-path	DNNLROOT		${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp
prepend-path	DIAGUTIL_PATH		${prefix}/vtune/2024.0/sys_check/vtune_sys_check.py:${prefix}/dpcpp-ct/2024.0/sys_check/sys_check.sh:${prefix}/debugger/2024.0/sys_check/debugger_sys_check.py:${prefix}/compiler/2024.0/sys_check/sys_check.sh:${prefix}/advisor/2024.0/sys_check/advisor_sys_check.py:
prepend-path	CCL_CONFIGURATION	cpu_gpu_dpcpp
prepend-path	DPL_ROOT		${prefix}/dpl/2022.3
prepend-path	MANPATH			${prefix}/mpi/2021.11/man:${prefix}/itac/2022.0/man:${prefix}/debugger/2024.0/documentation/man:${prefix}/compiler/2024.0/documentation/en/man/common:::
#prepend-path	MANPATH			${prefix}/itac/2022.0/man:${prefix}/debugger/2024.0/documentation/man:${prefix}/compiler/2024.0/documentation/en/man/common:::
prepend-path	GDB_INFO		${prefix}/debugger/2024.0/documentation/info/
prepend-path	SETVARS_COMPLETED	1
prepend-path	APM			${prefix}/advisor/2024.0/perfmodels
prepend-path	CMAKE_PREFIX_PATH	${prefix}/tbb/2021.11/env/..:${prefix}/ipp/2021.10/lib/cmake/ipp:${prefix}/ipp/2021.10/lib/cmake/ipp:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/../lib/cmake:${prefix}/cdal/2024.0:${prefix}/compiler/2024.0/IntelDPCPP:${prefix}/ccl/2021.11/lib/cmake/oneCCL
prepend-path	VTUNE_PROFILER_2023_DIR	${prefix}/vtune/2024.0
prepend-path	CMPLR_ROOT		${prefix}/compiler/2024.0
prepend-path	ADVISOR_2023_DIR	${prefix}/advisor/2024.0
prepend-path	FPGA_VARS_ARGS		""
prepend-path	INFOPATH		${prefix}/debugger/2024.0/gdb/intel64/lib
prepend-path	IPPROOT			${prefix}/ipp/2021.10
prepend-path	IPP_TARGET_ARCH		intel64
prepend-path	PYTHONPATH		${prefix}/advisor/2024.0/pythonapi
prepend-path	VT_ROOT			${prefix}/itac/2022.0
prepend-path	DALROOT			${prefix}/cdal/2024.0
prepend-path	LIBRARY_PATH		${prefix}/tbb/2021.11/env/../lib/intel64/gcc4.8:${prefix}/mpi/2021.11//libfabric/lib:${prefix}/mpi/2021.11//lib/release:${prefix}/mpi/2021.11//lib:${prefix}/mkl/2024.0/lib/intel64:${prefix}/ipp/2021.10/lib/intel64:${prefix}/ippcp/2021.9/lib/intel64:${prefix}/ipp/2021.10/lib/intel64:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/lib:${prefix}/cdal/2024.0/lib/intel64:${prefix}/compiler/2024.0/compiler/lib/intel64_lin:${prefix}/compiler/2024.0/lib:${prefix}/ccl/2021.11/lib/cpu_gpu_dpcpp
#prepend-path	LIBRARY_PATH		${prefix}/tbb/2021.11/env/../lib/intel64/gcc4.8:${prefix}/mkl/2024.0/lib/intel64:${prefix}/ipp/2021.10/lib/intel64:${prefix}/ippcp/2021.9/lib/intel64:${prefix}/ipp/2021.10/lib/intel64:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/lib:${prefix}/cdal/2024.0/lib/intel64:${prefix}/compiler/2024.0/compiler/lib/intel64_lin:${prefix}/compiler/2024.0/lib:${prefix}/ccl/2021.11/lib/cpu_gpu_dpcpp
prepend-path	DAL_MAJOR_BINARY	1
prepend-path	IPPCRYPTOROOT		${prefix}/ippcp/2021.9
prepend-path	IPPCP_TARGET_ARCH	intel64
prepend-path	OCL_ICD_FILENAMES	libintelocl_emu.so:libalteracl.so:${prefix}/compiler/2024.0/lib/x64/libintelocl.so
prepend-path	CLASSPATH		${prefix}/mpi/2021.11//lib/mpi.jar:${prefix}/cdal/2024.0/lib/onedal.jar
#prepend-path	CLASSPATH		${prefix}/cdal/2024.0/lib/onedal.jar
prepend-path	INTELFPGAOCLSDKROOT	${prefix}/compiler/2024.0/lib/oclfpga
prepend-path	LD_LIBRARY_PATH		${prefix}/tbb/2021.11/env/../lib/intel64/gcc4.8:${prefix}/mpi/2021.11//libfabric/lib:${prefix}/mpi/2021.11//lib/release:${prefix}/mpi/2021.11//lib:${prefix}/mkl/2024.0/lib/intel64:${prefix}/itac/2022.0/slib:${prefix}/ipp/2021.10/lib/intel64:${prefix}/ippcp/2021.9/lib/intel64:${prefix}/ipp/2021.10/lib/intel64:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/lib:${prefix}/debugger/2024.0/gdb/intel64/lib:${prefix}/debugger/2024.0/libipt/intel64/lib:${prefix}/debugger/2024.0/dep/lib:${prefix}/cdal/2024.0/lib/intel64:${prefix}/compiler/2024.0/lib:${prefix}/compiler/2024.0/lib/x64:${prefix}/compiler/2024.0/lib/oclfpga/host/linux64/lib:${prefix}/compiler/2024.0/compiler/lib/intel64_lin:${prefix}/ccl/2021.11/lib/cpu_gpu_dpcpp:${prefix}/compiler/2024.0/compiler/lib/intel64_lin:${prefix}/ccl/2021.11/lib/cpu_gpu_dpcpp
#prepend-path	LD_LIBRARY_PATH		${prefix}/tbb/2021.11/env/../lib/intel64/gcc4.8:${prefix}/mkl/2024.0/lib/intel64:${prefix}/itac/2022.0/slib:${prefix}/ipp/2021.10/lib/intel64:${prefix}/ippcp/2021.9/lib/intel64:${prefix}/ipp/2021.10/lib/intel64:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/lib:${prefix}/debugger/2024.0/gdb/intel64/lib:${prefix}/debugger/2024.0/libipt/intel64/lib:${prefix}/debugger/2024.0/dep/lib:${prefix}/cdal/2024.0/lib/intel64:${prefix}/compiler/2024.0/lib:${prefix}/compiler/2024.0/lib/x64:${prefix}/compiler/2024.0/lib/oclfpga/host/linux64/lib:${prefix}/compiler/2024.0/compiler/lib/intel64_lin:${prefix}/ccl/2021.11/lib/cpu_gpu_dpcpp:${prefix}/compiler/2024.0/compiler/lib/intel64_lin:${prefix}/ccl/2021.11/lib/cpu_gpu_dpcpp
prepend-path	VT_LIB_DIR		${prefix}/itac/2022.0/lib
prepend-path	VTUNE_PROFILER_DIR	${prefix}/vtune/2024.0
prepend-path	VT_SLIB_DIR		${prefix}/itac/2022.0/slib
prepend-path	MKLROOT			${prefix}/mkl/2024.0
prepend-path	DAL_MINOR_BINARY	1
prepend-path	NLSPATH			${prefix}/mkl/2024.0/lib/intel64/locale/%l_%t/%N:${prefix}/compiler/2024.0/compiler/lib/intel64_lin/locale/%l_%t/%N
prepend-path	PATH			${prefix}/vtune/2024.0/bin64:${prefix}/mpi/2021.11//libfabric/bin:${prefix}/mpi/2021.11//bin:${prefix}/mkl/2024.0/bin/intel64:${prefix}/itac/2022.0/bin:${prefix}/inspector/2024.0/bin64:${prefix}/dpcpp-ct/2024.0/bin:${prefix}/dev-utilities/2024.0/bin:${prefix}/debugger/2024.0/gdb/intel64/bin:${prefix}/compiler/2024.0/lib/oclfpga/bin:${prefix}/compiler/2024.0/bin/intel64:${prefix}/compiler/2024.0/bin:${prefix}/advisor/2024.0/bin64
#prepend-path	PATH			${prefix}/vtune/2024.0/bin64:${prefix}/mkl/2024.0/bin/intel64:${prefix}/itac/2022.0/bin:${prefix}/inspector/2024.0/bin64:${prefix}/dpcpp-ct/2024.0/bin:${prefix}/dev-utilities/2024.0/bin:${prefix}/debugger/2024.0/gdb/intel64/bin:${prefix}/compiler/2024.0/lib/oclfpga/bin:${prefix}/compiler/2024.0/bin/intel64:${prefix}/compiler/2024.0/bin:${prefix}/advisor/2024.0/bin64
prepend-path	INTEL_PYTHONHOME	${prefix}/debugger/2024.0/dep
prepend-path	INTEL_LICENSE_FILE	/opt/intel/licenses:/root/intel/licenses
prepend-path	CPATH			${prefix}/tbb/2021.11/env/../include:${prefix}/mpi/2021.11//include:${prefix}/mkl/2024.0/include:${prefix}/ipp/2021.10/include:${prefix}/ippcp/2021.9/include:${prefix}/ipp/2021.10/include:${prefix}/dpl/2022.3/linux/include:${prefix}/dpcpp-ct/2024.0/include:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/include:${prefix}/dev-utilities/2024.0/include:${prefix}/cdal/2024.0/include:${prefix}/compiler/2024.0/lib/oclfpga/include:${prefix}/ccl/2021.11/include/cpu_gpu_dpcpp
#prepend-path	CPATH			${prefix}/tbb/2021.11/env/../include:${prefix}/mkl/2024.0/include:${prefix}/ipp/2021.10/include:${prefix}/ippcp/2021.9/include:${prefix}/ipp/2021.10/include:${prefix}/dpl/2022.3/linux/include:${prefix}/dpcpp-ct/2024.0/include:${prefix}/dnnl/2024.0/cpu_dpcpp_gpu_dpcpp/include:${prefix}/dev-utilities/2024.0/include:${prefix}/cdal/2024.0/include:${prefix}/compiler/2024.0/lib/oclfpga/include:${prefix}/ccl/2021.11/include/cpu_gpu_dpcpp

# 运行测试

通过 module load 命令加载环境变量

$ module load intel/oneapi2024.0

测试是否安装成功

$ icx -v

如果输出版本信息,则安装成功。

Intel(R) oneAPI DPC++/C++ Compiler 2024.0.2 (2024.0.2.20231213)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/software/intel/oneapi2024.0/compiler/2024.0/bin/compiler
Configuration file: /opt/software/intel/oneapi2024.0/compiler/2024.0/bin/compiler/../icx.cfg
Found candidate GCC installation: /opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11
Selected GCC installation: /opt/rh/devtoolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

继续测试 MPI

$ mpirun --version

如果输出版本信息,则安装成功。

Intel(R) MPI Library for Linux* OS, Version 2021.11 Build 20231005 (id: 74c4a23)
Copyright 2003-2023, Intel Corporation.

# icx 说明

Intel® oneAPI DPC++/C++ Compiler (icx) is Intel nextgen compiler based on Clang /LLVM technology plus Intel proprietary optimizations and code generation.

Intel®, Intel® C/C++ Compilers Complete Adoption of LLVM

icx 是基于 Clang /LLVM 技术的 Intel 下一代编译器,加上 Intel 专有的优化和代码生成。

LLVM 帮助实现了为英特尔架构提供更加优秀的 C/C++编译器这一目标。最新的英特尔 C/C++编译器使用 LLVM 架构,可提供更快的编译时间、更好的优化、增强的标准支持以及对 GPU 和 FPGA 负载转移(offloading)的支持。

# 采用 LLVM 的好处

LLVM 开源项目是模块化和可重用的编译器和一系列工具链技术的集合,整个项目支持多种处理器架构和编程语言。Clang 开源项目提供了一个 C/C++前端,为 LLVM 项目支持了最新的语言标准。包括 Clang 在内,LLVM 是由一个庞大且非常活跃的开发社区维护的。

v2-7ac93f64b283ba0b5c5371b7cd524210_1440w-2024-03-09

采用 LLVM 的好处有很多,第一条要说的是更快的构建时间。众所周知,Clang 是很快的!我们使用英特尔 oneAPI 2021.3 工具包中的英特尔 C/C++编译器时,测得构建时间减少了 14%。除了减少构建时间外,采用 Clang 使我们可以从社区支持最新 C++语言标准的一系列成果中受益,并贡献成果来反哺社区。

英特尔为开源项目提供贡献和支持的历史颇为悠久,其中向 LLVM 做出贡献就有十年时间了。我们今天的主动合作行为包括了优化报告补充、扩大的浮点模型支持,以及向量增强。英特尔直接对 LLVM 项目做出贡献,也有一个临时区域(英特尔 LLVM 技术项目),针对 SYCL 支持。

在英特尔架构上,英特尔 C/C++编译器预期能提供比基础 Clang+LLVM 编译器更高的性能。接下来英特尔 C/C++编译器都会是采用了 LLVM 开源基础架构的版本(icx)。我们会继续之前的长期努力,持续为 Clang 和 LLVM 项目做出贡献,包括为它们提供优化。并非所有的优化技术都会被上游采纳,有时是因为它们太新了,有时因为它们过于针对英特尔架构。这是可以预料的,并且与其他已经采用 LLVM 的编译器是同样的情况。

v2-1a1672571e4a8a60c335e5abe38ee86b_1440w-2024-03-09

英特尔 C/C++编译器一直都在提供最优秀的性能。经典版本的英特尔 C/C++编译器取得了对 GCC 18%的优势,而基于 LLVM 的英特尔 C/C++编译器取得了 41%的优势。

Licensed under CC BY-NC-SA 4.0
本博客已稳定运行
总访客数: Loading
总访问量: Loading
发表了 73 篇文章 · 总计 323.73k

使用 Hugo 构建
主题 StackJimmy 设计
基于 v3.27.0 分支版本修改