Compilation and Installation
Procedure
- Use PuTTY to log in to the server as the root user.
- Go to the main program installation directory.
cd /path/to/LAMMPS
- Decompress the installation package.
tar -xvf lammps-10Feb2021.tar.gz
- Go to the directory generated after the decompression.
cd lammps-10Feb21
- Modify the Makefile.linux configuration file of the GPU module.
- Open the Makefile.linux file.
cd lib/gpu vi Makefile.linux
- Press i to enter the insert mode and modify the file as follows:
CUDA_HOME = /usr/local/cuda-11.4 NVCC=nvcc CUDA_ARCH=-arch=sm_80 # Graphics card model. The current environment uses A100 (Ampere architecture). CUDA_PRECISION=-D_DOUBLE_DOUBLE # calculation precision.
- Press Esc, type :wq!, and press Enter to save the settings and exit.
- Open the Makefile.linux file.
- Compile the GPU module of LAMMPS.
make -f Makefile.linux -j 16
- View the GPU information.
./nvc_get_devices
If the following information is displayed, the compilation is successful:
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
- Go to the src directory.
cd ../../src
- Modify the MAKE/OPTIONS/Makefile.g++_openmpi file.
- Open the MAKE/OPTIONS/Makefile.g++_openmpi file.
vi MAKE/OPTIONS/Makefile.g++_openmpi
- Press i to enter the edit mode and modify the content in lines 54, 55, and 56.
FFT_INC = -DFFT_FFTW -I/path/to/FFTW/include FFT_PATH = -L/path/to/FFTW/lib FFT_LIB = -lfftw3
- Press Esc, type :wq!, and press Enter to save the settings and exit.
- Open the MAKE/OPTIONS/Makefile.g++_openmpi file.
- Perform the compilation.
make yes-std make no-lib make yes-gpu make -j 96 g++_openmpi
Parent topic: LAMMPS 10 Feb 2021 Porting Guide (CentOS 8.2)
