1. 程式人生 > 實用技巧 >基於GPU的HPL基準測試

基於GPU的HPL基準測試

1、配置GCC編譯器

# yum install gcc gcc-c++ gcc-gfortran glibc glibc-devel make -y

2、安裝Intel MKL

# wget http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15816/l_mkl_2019.5.281.tgz
# tar zxvf l_mkl_2019.5.281.tgz
# cd l_mkl_2019.5.281
# sh install.sh

配置MKL環境變數

# source /opt/intel/compilers_and_libraries_2019.5.281
/linux/mkl/bin/mklvars.sh intel64

3、安裝MPICH

# yum install -y mpich-3.2 mpich-3.2-devel
# export PATH=/usr/lib64/mpich-3.2/bin:$PATH

4、安裝CUDA

安裝kernel-devel包

# yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

禁用Nouveau驅動

# lsmod |grep nouveau
# modprobe -r nouveau
# cat > /etc/modprobe.d/blacklist.conf << EOF
blacklist nouveau
options nouveau modeset
=0 EOF

安裝CUDA

# yum install -y cuda-10-2

檢視GPU狀態

# nvidia-smi

5、安裝HPL

# https://files.cnblogs.com/files/liu-shaobo/hpl-2.0_FERMI_v15.tar.gz
# tar zxvf hpl-2.0_FERMI_v15.tgz 
# mv hpl-2.0_FERMI_v15 hpl_gpu && cd hpl_gpu
# cp Make.CUDA Make.CUDA.bak
# sed -i 's#^TOPdir.*#TOPdir = /root/hpl_gpu#' Make.CUDA
# sed 
-i 's#^LAdir.*#LAdir = /opt/intel/mkl/lib/intel64#' Make.CUDA # sed -i 's#^LAMP5dir.*#LAMP5dir = /opt/intel/compilers_and_libraries/linux/lib/intel64#' Make.CUDA # sed -i 's#^LAinc.*#LAinc = -I/opt/intel/mkl/include#' Make.CUDA

編譯HPL

# make arch=CUDA

6、測試

# cd bin/CUDA
# sed -i 's#^HPL_DIR.*#HPL_DIR=/root/hpl_gpu' run_linpack
# mpirun -np 1 ./run_linpack > HPL-Benchmark.txt

因為只有單卡GPU,將HPL.dat的PxQ都改成1測試