Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmp in 2.1.3 make unrecognized pair error #1809

Closed
pee8379 opened this issue Jul 2, 2022 · 12 comments · Fixed by #1808
Closed

lmp in 2.1.3 make unrecognized pair error #1809

pee8379 opened this issue Jul 2, 2022 · 12 comments · Fixed by #1808
Labels

Comments

@pee8379
Copy link

pee8379 commented Jul 2, 2022

Bug summary

I try to continue training model (from deepmd-kit 2.1.1, dpgen 0.10.5), using newly released 2.1.3. (offline package deepmd-kit-2.1.3-cuda10.2_gpu-Linux-x86_64.sh )

dpgen process failed to run, (task 4) with [unrecognized pair style] error in lmp log file.

DeePMD-kit Version

2.1.3

TensorFlow Version

How did you download the software?

Offline packages

Input Files, Running Commands, Error Log, etc.

dpgen 0.10.5
call lmp by
"model_devi":[ "command": "/DeepMD-kit-location/deepmd-kit-2.1.1-cu10.2/bin/lmp"
in machine json file.

Steps to Reproduce

Further Information, Files, and Links

No response

@pee8379 pee8379 added the bug label Jul 2, 2022
@njzjz
Copy link
Member

njzjz commented Jul 2, 2022

Please activate the environment first:

conda activate /path/to/deepmd-kit

source activate /path/to/deepmd-kit or source /path/to/deepmd-kit/bin/activate /path/to/deepmd-kit may also work)

By activating the conda environment, several environment variables can be set correctly.

@r-hou
Copy link

r-hou commented Oct 20, 2023

it helps nothing, I did activate the environment, otherwise how could I use "lmp -h", it doesn't show deepmd pair_style

@njzjz
Copy link
Member

njzjz commented Oct 20, 2023

it helps nothing, I did activate the environment, otherwise how could I use "lmp -h", it doesn't show deepmd pair_style

Currently, lmp -h only lists built-in styles, but no plugged styles. This part of the codes is maintained by LAMMPS.

@njzjz njzjz added Docs and removed document labels Nov 4, 2023
@hyuqing11
Copy link

I have activated the environment but I still get the error message: "ERROR: Unrecognized pair style 'deepmd' (src/force.cpp:271)" Do you have any suggestions?

@njzjz
Copy link
Member

njzjz commented Nov 29, 2023

I have activated the environment but I still get the error message: "ERROR: Unrecognized pair style 'deepmd' (src/force.cpp:271)" Do you have any suggestions?

@hyuqing11 If it was installed from conda-forge or the offline package released recently, the problem has been resolved in conda-forge/deepmd-kit-feedstock#63.


During the activation process, the environment variable LAMMPS_PLUGIN_PATH will be set, so it can also be manually set instead:

export LAMMPS_PLUGIN_PATH=$CONDA_PREFIX/lib/deepmd_lmp

@hyuqing11
Copy link

Thank you for your help. However, I encountered an issue after setting the LAMMPS_PLUGIN_PATH. The error message I received is as follows: "Open of file /test_env4/lib/deepmd_lmp/dpplugin.so failed: libabsl_status.so.2301.0.0: cannot open shared object file: No such file or directory." Do you have any suggestions?

@chazeon
Copy link
Contributor

chazeon commented Dec 2, 2023

@njzjz @hyuqing11

I have encounter the same kind of problem today.
The deepmd_lmp/dpplugin.so from the current conda-forge version of deepmd-kit does not has proper rpath and needed shared library information.

After installation, a temporary patch can be done with patchelf by

cd $CONDA_PREFIX/lib
patchelf --add-rpath '$ORIGIN/..' deepmd_lmp/dpplugin.so
patchelf --add-needed liblammps.so deepmd_lmp/dpplugin.so

My deepmd-kit version and build is

deepmd-kit                2.2.7           cuda118py310h49a02c8_3    conda-forge

@njzjz
Copy link
Member

njzjz commented Dec 2, 2023

The deepmd_lmp/dpplugin.so from the current conda-forge version of deepmd-kit does not has proper rpath and needed shared library information.

I know @Yi-FanLi had this issue before, but he compiled LAMMPS himself. @chazeon Did you use conda-forge's LAMMPS or others?

@chazeon
Copy link
Contributor

chazeon commented Dec 2, 2023

I know @Yi-FanLi had this issue before, but he compiled LAMMPS himself. @chazeon Did you use conda-forge's LAMMPS or others?

Yes, I used conda-forge’s LAMMPS.

@njzjz
Copy link
Member

njzjz commented Dec 4, 2023

Yes, I used conda-forge’s LAMMPS.

Do you use lmp_mpi or lmp_serial? lmp_serial in conda-forge does not provide a shared library (liblammps.so is built for MPI), which might be a problem and should not be used.

@Yi-FanLi
Copy link
Collaborator

Yi-FanLi commented Dec 4, 2023

Hi @chazeon, I used the following command to set up an environment:

conda create -n dp2.2.7-gpu -c conda-forge deepmd-kit=*=cuda* lammps python=3.9 pip

and used this command to run the task:

module purge
module load anaconda3/2020.11
conda activate dp2.2.7-gpu
lmp_mpi -in in.lammps

It worked fine.
Can you tell us how we can reproduce the issue?

@chazeon
Copy link
Contributor

chazeon commented Dec 5, 2023

@njzjz @Yi-FanLi
I see. Currently, lmp_mpi indeed loads liblammps.so automatically and then loads the plugin correctly. I was fixing it because ldd or readelf does not list liblammps.so as a dependency.

It's my fault. I spotted the missing .so because an earlier incompatible version of LAMMPS was installed by conda because of other dependencies pinned down the LAMMPS version. I tried to debug the .so file to look into its symbols. I wasn't aware that upgrading LAMMPS version has already fixed these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants