Rate This Document
Findability
Accuracy
Completeness
Readability

Compilation and Installation

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Go to the main program installation directory.
    cd /path/to/LAMMPS
  3. Decompress the installation package.
    tar -xvf lammps-10Feb2021.tar.gz
  4. Go to the directory generated after the decompression.
    cd lammps-10Feb21
  5. Modify the Makefile.linux configuration file of the GPU module.
    1. Open the Makefile.linux file.
      cd lib/gpu
      vi Makefile.linux
    2. 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.
    3. Press Esc, type :wq!, and press Enter to save the settings and exit.
  6. Compile the GPU module of LAMMPS.
    make -f Makefile.linux -j 16
  7. 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
  8. Go to the src directory.
    cd ../../src
  9. Modify the MAKE/OPTIONS/Makefile.g++_openmpi file.
    1. Open the MAKE/OPTIONS/Makefile.g++_openmpi file.
      vi MAKE/OPTIONS/Makefile.g++_openmpi
    2. 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

      After performing 9.a, press Esc, type :set nu, and press Enter to display the line number.

    3. Press Esc, type :wq!, and press Enter to save the settings and exit.
  10. Perform the compilation.
    make yes-std
    make no-lib
    make yes-gpu
    make -j 96 g++_openmpi