cd /path/to/LAMMPS
tar -xvf lammps-10Feb2021.tar.gz
cd lammps-10Feb21
cd lib/gpu vi Makefile.linux
CUDA_HOME = /usr/local/cuda-11.4 NVCC=nvcc CUDA_ARCH=-arch=sm_80 #显卡对应的型号,当前环境使用A100(Ampere架构) CUDA_PRECISION=-D_DOUBLE_DOUBLE #计算精度
make -f Makefile.linux -j 16
./nvc_get_devices
回显显示如下内容,表示编译成功。
Found 1 platform(s). Using platform: NVIDIA Corporation NVIDIA CUDA Driver CUDA Driver Version: 11.40 Device 0: "NVIDIA A100-PCIE-40GB" Type of device: GPU Compute capability: 8 Double precision support: Yes Total amount of global memory: 39.5861 GB Number of compute units/multiprocessors: 108 Number of cores: 20736 Total amount of constant memory: 65536 bytes Total amount of local/shared memory per block: 49152 bytes Total number of registers available per block: 65536 Warp size: 32 Maximum number of threads per block: 1024 Maximum group size (# of threads per block) 1024 x 1024 x 64 Maximum item sizes (# threads for each dim) 2147483647 x 65535 x 65535 Maximum memory pitch: 2147483647 bytes Texture alignment: 512 bytes Clock rate: 1.41 GHz Run time limit on kernels: No Integrated: No Support host page-locked memory mapping: Yes Compute mode: Default Concurrent kernel execution: Yes Device has ECC support enabled: Yes
cd ../../src
make yes-std make no-lib make yes-gpu make -j 96 g++_openmpi