计算化学公社

标题: 求助:ubuntu系统,7Feb2024lammps运行,gpu调用不起来,cpu调用拉满,已加载gpu包 [打印本页]

作者
Author:
xwjjie    时间: 2024-3-3 13:08
标题: 求助:ubuntu系统,7Feb2024lammps运行,gpu调用不起来,cpu调用拉满,已加载gpu包
本帖最后由 xwjjie 于 2024-3-3 20:34 编辑

本人使用的是有四张RTX3080显卡的服务器,CUDA版本是12.4,显卡驱动版本是Driver Version: 550.54.14 。
在使用lammps跑分子动力学时,使用命令代码是:
  1. mpirun -np 1 lmp_mpi -sf gpu -pk gpu 1 -in filename
复制代码

使用nvidia-smi查看时,lammps在运行,但gpu调度为0%。

使用top查看cpu利用率,发现lammps正在拉满运行。
我想使用gpu跑lammsp,这样速度会快很多。
请问各位老师,这种情况是怎么回事,是我lammps安装有问题吗,还是什么情况。



作者
Author:
乐平    时间: 2024-3-3 15:57
说个题外话,这个帖子编辑得真是…… 干嘛要加背景色……

如果要显示“命令代码”,点击编辑框里的 “代码图标”,把命令贴进文本框里点“确定”,如下图所示
(, 下载次数 Times of downloads: 46)

如果你想强调,加粗就足够了。

添加背景色不但毫无意义,反而不方便阅读。

作者
Author:
xwjjie    时间: 2024-3-3 20:34
本帖最后由 xwjjie 于 2024-3-3 20:42 编辑
乐平 发表于 2024-3-3 15:57
说个题外话,这个帖子编辑得真是…… 干嘛要加背景色……

如果要显示“命令代码”,点击编辑框里的 “代 ...

不好意思不好意思,因为我浏览器添加了暗黑插件,导致我自己显示的是正常的,十分抱歉。
十分感谢你的提醒,不然我都蒙在鼓里了

作者
Author:
Santz    时间: 2024-3-3 22:13
本帖最后由 Santz 于 2024-3-3 22:15 编辑

最近做的一个测试,GPU包和KOKKOS不一样,GPU包允许oversubscribing GPUs。你可以对比下用mpirun -np <CORES>超过GPU个数的效率。

(, 下载次数 Times of downloads: 41)

作者
Author:
xwjjie    时间: 2024-3-4 13:06
Santz 发表于 2024-3-3 22:13
最近做的一个测试,GPU包和KOKKOS不一样,GPU包允许oversubscribing GPUs。你可以对比下用mpirun -np 超过G ...

我使用了两核,对比肯定更快了。
  1. mpirun -np 2 lmp_mpi -sf gpu -pk gpu 1 -in in.file
复制代码

但我还是那个问题,两个核都是cpu拉满运行的,gpu毫无调用。
使用top命令后看到进程为:
PR  NI    VIRT    RES    SHR         %CPU  %MEM     TIME+      COMMAND
20   0  106.9g   2.3g    832832 S  4193         0.9      86:40.01   lmp_mpi
20   0   99.5g   2.2g     832832 S  3758         0.9      87:02.02   lmp_mpi
gpu利用率还是为0


作者
Author:
目前还不会计算    时间: 2024-5-1 21:23
Santz 发表于 2024-3-3 22:13
最近做的一个测试,GPU包和KOKKOS不一样,GPU包允许oversubscribing GPUs。你可以对比下用mpirun -np 超过G ...

大佬,我最近用GPU加速lammps计算,kokkos加速,然后发现计算发现,单卡的适合计算没问题,但是多卡并行计算的时候,发现只一个卡在计算,其他卡基本上出工不出力,功耗很低,,调用不起来,不知道你遇到过没有
作者
Author:
Entropy.S.I    时间: 2024-5-1 21:44
目前还不会计算 发表于 2024-5-1 21:23
大佬,我最近用GPU加速lammps计算,kokkos加速,然后发现计算发现,单卡的适合计算没问题,但是多卡并行 ...

mpirun -np [GPU count] lmp -k on g [GPU count] -sf kk -pk kokkos cuda/aware on neigh full comm device -in [input file]
作者
Author:
目前还不会计算    时间: 2024-5-2 11:25
Entropy.S.I 发表于 2024-5-1 21:44
mpirun -np [GPU count] lmp -k on g [GPU count] -sf kk -pk kokkos cuda/aware on neigh full comm dev ...

大佬,我之前的提交命令是:mpirun -np 6  lmp_kokkos_cuda_mpi -k on g 6 -sf  kk -pk kokkos newton on -in  PA.fmp,可以运行。但是我换成这个mpirun -np 6 lmp -k on g 6 -sf kk -pk kokkos cuda/aware on neigh full comm device -in PA.fmp之后,就直接运行报错了,是不是我还有一些元素没有编译安装啊。
作者
Author:
lmch    时间: 2024-5-2 12:20
目前还不会计算 发表于 2024-5-2 11:25
大佬,我之前的提交命令是:mpirun -np 6  lmp_kokkos_cuda_mpi -k on g 6 -sf  kk -pk kokkos newton on ...

你的lammps 可执行程序叫  lmp_kokkos_cuda_mpi, 不叫  lmp,人家叫张三,你找张四,mpirun当然找不到
作者
Author:
目前还不会计算    时间: 2024-5-2 15:04
本帖最后由 目前还不会计算 于 2024-5-2 15:06 编辑

mpirun -np 6  lmp_kokkos_cuda_mpi -k on g 6 -sf  kk -pk kokkos newton on cuda/aware on neigh full comm device -in  PA.fmp    这种我也输入了,也是跑不起来呀,不知道为啥。

Authorization required, but no authorization protocol specified
LAMMPS (2 Aug 2023 - Update 3)
KOKKOS mode with Kokkos version 3.7.2 is enabled (../kokkos.cpp:108)
  will use up to 6 GPU(s) per node
WARNING: Turning off GPU-aware MPI since it is not detected, use '-pk kokkos gpu/aware on' to override (../kokkos.cpp:316)
Reading data file ...
  orthogonal box = (128.25976 67.308566 -100) to (246.74024 187.69143 500)
  1 by 1 by 6 MPI processor grid
  reading atoms ...
  62156 atoms
  reading velocities ...
  62156 velocities
  scanning bonds ...
  3 = max bonds/atom
  scanning angles ...
  9 = max angles/atom
  scanning dihedrals ...
  20 = max dihedrals/atom
  scanning impropers ...
  3 = max impropers/atom
  reading bonds ...
  47175 bonds
  reading angles ...
  50000 angles
  reading dihedrals ...
  57800 dihedrals
  reading impropers ...
  8450 impropers
Finding 1-2 1-3 1-4 neighbors ...
  special bond factors lj:    0        0        0.5
  special bond factors coul:  0        0        0.8333333333333334
     3 = max # of 1-2 neighbors
     6 = max # of 1-3 neighbors
    14 = max # of 1-4 neighbors
    16 = max # of special neighbors
  special bonds CPU = 0.022 seconds
  read_data CPU = 0.797 seconds
Created 250 atoms
  using lattice units in orthogonal box = (128.25976 67.308566 -100) to (246.74024 187.69143 500)
  create_atoms CPU = 0.032 seconds
Setting atom values ...
  0 settings made for charge
Setting atom values ...
  250 settings made for charge
Reading eam potential file Cu_u3.eam with DATE: 2007-06-11
WARNING: Converting eam potential in metal units to real units (../potential_file_reader.cpp:291)
2178 atoms in group thermostat
2178 atoms in group boundary
WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:242)
Neighbor list info ...
  update: every = 1 steps, delay = 0 steps, check = yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 15
  ghost atom cutoff = 15
  binsize = 15, bins = 8 9 40
  6 neighbor lists, perpetual/occasional/extra = 6 0 0
  (1) pair lj/charmm/coul/charmm, perpetual, skip from (4)
      attributes: full, newton off, kokkos_device
      pair build: skip/kk/device
      stencil: none
      bin: none
  (2) pair lj/cut, perpetual, skip from (5)
      attributes: full, newton off, kokkos_device, cut 14
      pair build: skip/kk/device
      stencil: none
      bin: none
  (3) pair eam, perpetual, skip from (6)
      attributes: full, newton off, kokkos_device, cut 9.949999999999989
      pair build: skip/kk/device
      stencil: none
      bin: none
  (4) neighbor class addition, perpetual
      attributes: full, newton off, kokkos_device
      pair build: full/bin/kk/device
      stencil: full/bin/3d
      bin: kk/device
  (5) neighbor class addition, perpetual, trim from (4)
      attributes: full, newton off, kokkos_device, cut 14
      pair build: trim/kk/device
      stencil: none
      bin: none
  (6) neighbor class addition, perpetual, trim from (5)
      attributes: full, newton off, kokkos_device, cut 9.949999999999989
      pair build: trim/kk/device
      stencil: none
      bin: none
Setting up cg/kk style minimization ...
  Unit style    : real
  Current step  : 0
WARNING: Fix with atom-based arrays not compatible with sending data in Kokkos communication, switching to classic exchange/border communication (../comm_kokkos.cpp:666)
WARNING: Fix with atom-based arrays not compatible with Kokkos sorting on device, switching to classic host sorting (../atom_kokkos.cpp:215)
WARNING: Inconsistent image flags (../domain.cpp:815)
[vasp1.nis.local:2777013] Read -1, expected 25168, errno = 14
[vasp1:2777014] *** Process received signal ***
[vasp1:2777014] Signal: Segmentation fault (11)
[vasp1:2777014] Signal code: Invalid permissions (2)
[vasp1:2777014] Failing at address: 0x79471fdf5880
[vasp1:2777014] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x794769c42520]
[vasp1:2777014] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x1a7c4d)[0x794769da7c4d]
[vasp1:2777014] [ 2] /public/soft/openmpi-4.1.4/lib/openmpi/mca_btl_vader.so(+0x39e4)[0x794768a0c9e4]
[vasp1:2777014] [ 3] /public/soft/openmpi-4.1.4/lib/openmpi/mca_pml_ob1.so(mca_pml_ob1_send_request_schedule_once+0x1c6)[0x794763bf32e6]
[vasp1:2777013] [15] lmp_kokkos_cuda_mpi(+0x269d9c)[0x584808628d9c]
[vasp1:2777013] [16] lmp_kokkos_cuda_mpi(+0x26a7a7)[0x5848086297a7]
[vasp1:2777013] [17] lmp_kokkos_cuda_mpi(+0x1ea981)[0x5848085a9981]
[vasp1:2777013] [18] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7e73c1029d90]
[vasp1:2777013] [19] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7e73c1029e40]
[vasp1:2777013] [20] lmp_kokkos_cuda_mpi(+0x244815)[0x584808603815]
[vasp1:2777013] *** End of error message ***
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun noticed that process rank 4 with PID 0 on node vasp1 exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------



作者
Author:
lmch    时间: 2024-5-2 15:20
你这大部分报错都跟lammps 没关系,

检查 Authorization required, but no authorization protocol specified 通信

[vasp1.nis.local:2777013] Read -1, expected 25168, errno = 14[vasp1:2777014] Signal: Segmentation fault (11) 内存

[vasp1:2777014] Signal code: Invalid permissions (2) 权限

尝试单卡 用mpirun -np 1  lmp_kokkos_cuda_mpi -k on g 1 -sf  kk -pk kokkos newton on neigh half -in XXXXXXXX 一个一个检查,

此外,你这满屏的VASP 什么情况
作者
Author:
Entropy.S.I    时间: 2024-5-2 17:00
目前还不会计算 发表于 2024-5-2 15:04
mpirun -np 6  lmp_kokkos_cuda_mpi -k on g 6 -sf  kk -pk kokkos newton on cuda/aware on neigh full co ...

MPI没有CUDA-aware,应当使用支持CUDA-aware的MPI。一般需要自己编译,不同集群上情况不一样。

集群管理员一般都不用具体软件做科研,做对实际应用基本没有了解,所以不会给你有针对性地编译和优化软件,都是随便编译几个功能残废的壳子,module avail列出来一大堆东西就可以向上级交差了。真要用,都得用户自己编译。
作者
Author:
目前还不会计算    时间: 2024-5-2 19:07
Entropy.S.I 发表于 2024-5-2 17:00
MPI没有CUDA-aware,应当使用支持CUDA-aware的MPI。一般需要自己编译,不同集群上情况不一样。

集群管 ...

原来如此,需要这个CUDA-aware的MPI。。等我再去试一下,感谢大佬的解答。
作者
Author:
糖炒DFT    时间: 2024-5-6 22:57
楼主,我的情况与你相同,硬件也是RTX3080,软件只是CUDA版本为12.2略有区别,GPU上只也只显示有进程,但是GPU占用率为0,请问你解决了嘛?
作者
Author:
糖炒DFT    时间: 2024-5-9 10:44
应该是用的势场GPU包不支持,不是安装问题,现在GPU包非KOKKOS,支持的就是eam,lj等势场的加速,MEAM等势场用不了。




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3