lammps运行报错以及GPU的效率测试

报错内容:LAMMPS (23 Jun 2022 - Update 4)
Reading restart file ...
  restart file = 12 Dec 2018, LAMMPS = 23 Jun 2022
WARNING: Old restart file format revision. Switching to compatibility mode. (../read_restart.cpp:613)
WARNING: Restart file used different # of processors: 64 vs. 4 (../read_restart.cpp:658)
WARNING: Restart file used different newton pair setting, using input script value (../read_restart.cpp:685)
  restoring atom style full from restart
  orthogonal box = (19.934261 19.927718 19.876779) to (80.082311 80.075768 80.024829)
  1 by 2 by 2 MPI processor grid
  restoring pair style hybrid from restart
ERROR: Unrecognized pair style '' (../force.cpp:279)
Last command: read_restart    restart.equil

解决方法:lammps的版本不兼容restart文件

报错2:ERROR on proc 0: Potential file does not match AIREBO/REBO style variant: # AIREBO : # Cite as S. J. Stuart, A. B. Tutein, J. A. Harrison,
 (../pair_airebo.cpp:3386)
Last command: pair_coeff      * * airebo CH.airebo NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL C

解决方法:用了新的lammps跑旧的代码,去githup下载一个新的就可以

报错三:mpirun -np 4 lmp_mpi -in **_**_ev.in1 >out.log CPU可以运行

但是

mpirun -np 4 lmp_mpi -sf gpu -pk gpu 1 -in litfsi_pdadma_ev.in1 >out.log

不可以运行

报错:Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 99.

ERROR: Must not use GPU neighbor lists with hybrid pair style (../fix_gpu.cpp:283)

解决方法:提交命令加入neigh no

mpirun -np 4 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out.log

成功运行

运行成功后测试一下运行速度:跑10000步,16120 atoms

mpirun -np 1 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out.log

CPU:1核;GPU:1个(40%利用率)运行时间:0:05:48

nohup mpirun -np 2 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out1.log &

CPU:2核;GPU:1个(39%利用率)运行时间: 0:03:23

nohup mpirun -np 4 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out1.log &

CPU:4核;GPU:1个(37%利用率)运行时间: 0:02:09

nohup mpirun -np 6 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out1.log &

CPU:6核;GPU:1个(87%利用率)运行时间:  0:01:41

nohup mpirun -np 8 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out1.log &

CPU:8核;GPU:1个(80%利用率)运行时间:  0:01:47

nohup mpirun -np 12 lmp_mpi -sf gpu -pk gpu 1 neigh no -in litfsi_pdadma_ev.in1 >out1.log &

 CPU:12核;GPU:1个(80%利用率)运行时间:  0:01:49

综上所测试结果:6个CPU结合1GPU的搭配使得lammps运行速度达到最大

  • 48
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
To run LAMMPS with GPU acceleration on Ubuntu using NVIDIA GPUs, you need to follow these steps: 1. Install NVIDIA driver: Ensure that you have the latest NVIDIA driver installed on your system. You can use the instructions provided earlier to install or update the NVIDIA driver on Ubuntu. 2. Install CUDA Toolkit: LAMMPS requires CUDA to run on GPUs. Install the CUDA Toolkit, which includes the necessary libraries and tools for GPU computing. You can download the CUDA Toolkit from the NVIDIA website and follow their installation instructions. 3. Download and compile LAMMPS: Obtain the LAMMPS source code from the official LAMMPS website or GitHub repository. Extract the source code to a directory of your choice. 4. Set up Makefile: Navigate to the LAMMPS source code directory and locate the Makefile. Open the Makefile and modify it to include GPU support. Uncomment or add the appropriate lines for GPU acceleration using CUDA. For example, you may need to set `GPU` to `yes`, specify the CUDA path, and select the appropriate CUDA architecture. 5. Compile LAMMPS: In the terminal, navigate to the LAMMPS source code directory and run `make mpi` or `make serial` depending on your desired configuration. This will compile LAMMPS with GPU support enabled. 6. Run LAMMPS with GPU acceleration: Once the compilation is complete, you can run LAMMPS with GPU acceleration by using the `lmp_mpi` or `lmp_serial` executable generated during the compilation process. Be sure to specify the appropriate input script and any necessary command-line options. For example, to run a LAMMPS input file named "input.lammps" using multiple GPUs, you can use the following command: ``` mpirun -np <number of MPI processes> lmp_mpi -sf gpu -pk gpu <number of GPUs> -in input.lammps ``` Replace `<number of MPI processes>` with the desired number of MPI processes, and `<number of GPUs>` with the number of GPUs you want to use. Please note that the specific steps and commands may vary depending on your LAMMPS version, GPU configuration, and system setup. Refer to the LAMMPS documentation and CUDA Toolkit documentation for more detailed instructions and troubleshooting information.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值