Skip to content

Navigation Menu

Sign in
Sign up

Plugin mode installtion #5487

Unanswered
mayankaditya asked this question in Q&A
Jun 2, 2026 · 3 comments · 5 replies
Discussion options

Question

Hi, I want to install LAMMPS with the deepmd-plugin on a GPU server in offline mode. As the website says, the precompiled library libdeepmd_c.tar.gz can be used to build the LAMMPS plugin without building TensorFlow and DeePMD-kit on one’s own. Does it mean it does not require tensorflow_root? On my server, I cannot use TensorFlow’s C++ interface due to the internet connection. Is there any alternative? Can I use the TensorFlow build using deepmd-kit-x.y.z-cuda-Linux-x86_64.sh?
Please advise. I have a V100 GPU server with CUDA-10.2.

DeePMD-kit Version

No response

Backend and its version

No response

Python Version, CUDA Version, GCC Version, LAMMPS Version, etc

No response

Details

No response

Reproducible Example, Input Files, and Commands

No response

Further Information, Files, and Links

No response

You must be logged in to vote

Replies: 3 comments 5 replies

Comment options

Hi @mayankaditya! I'm Dosu and I'm helping the DeepModeling team.

Yes, using the plugin mode with the precompiled libdeepmd_c.tar.gz means you do not need to build TensorFlow or DeePMD-kit from source yourself. The precompiled library bundles everything needed for the LAMMPS plugin [1]. You don't need to provide tensorflow_root as a CMake variable when building LAMMPS in plugin mode — you just point DEEPMD_C_ROOT to the extracted libdeepmd_c directory [1].

However, there are a couple of important caveats for your setup:

CUDA 10.2 is not compatible with recent precompiled binaries. The current libdeepmd_c.tar.gz releases are built against CUDA 12.2 [1], and CUDA 10.2 was only supported with the older DeePMD-kit V2 [2]. The precompiled package also does not include CUDA Toolkit or cuDNN — you'd need those installed separately on your server [1].

Your options given CUDA 10.2:

  1. Upgrade CUDA (recommended): If you can upgrade your CUDA toolkit and NVIDIA driver, you can use the precompiled libdeepmd_c.tar.gz directly for a straightforward offline plugin build.

  2. Build from source with CUDA 10.2: DeePMD-kit supports building from source with CUDA versions as old as 9.0 [3]. This would require building TensorFlow/PyTorch C++ interface yourself, which is more involved but feasible offline if you pre-download the dependencies.

  3. Use the conda installer's pre-built LAMMPS: The deepmd-kit-x.y.z-cuda-Linux-x86_64.sh installer includes a pre-compiled LAMMPS binary that already has DeePMD-kit support built in [4]. However, this won't provide standalone TensorFlow C++ development libraries for you to build your own LAMMPS from source [5], and the recent installers target newer CUDA versions.

For the plugin mode build itself (assuming compatible CUDA), the steps are [6]:

  1. Extract libdeepmd_c.tar.gz
  2. Download LAMMPS source (version 8Apr2021 or later)
  3. Build LAMMPS with PLUGIN enabled and BUILD_SHARED_LIBS=yes
  4. Set DEEPMD_C_ROOT to point to the extracted library path

Given your V100 with CUDA 10.2, upgrading CUDA (V100 supports up to CUDA 12.x with appropriate drivers) would be the smoothest path to using the precompiled offline approach.

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about deepmd-kit Share Dosu with your team

You must be logged in to vote
2 replies
Comment options

Dear Dosu, Thank you for your prompt response. To test this, I have compiled using a precompiled C library on my desktop, and it installed successfully. However, while executing the lmp command, it shows:

LAMMPS (22 Jul 2025 - Update 4)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread.
using 1 OpenMP thread(s) per MPI task
Open of file libdeepmd_lmp.so failed: /mnt/Data/DP_PLUGUIN/libdeepmd_c/lib/libdeepmd_cc.so: undefined symbol: _ZN6google8protobuf5Arena8AllocateEm
Reading data file ...
triclinic box = (0 0 0) to (27.54365 27.54365 27.54365) with tilt (0 0 0)
1 by 1 by 1 MPI processor grid
reading atoms ...
918 atoms
read_data CPU = 0.005 seconds
ERROR: Unrecognized pair style 'deepmd' (src/force.cpp:275)
Last input line: pair_style deepmd convert_out.pb

This is the first few lines of LAMMPS input:

plugin load libdeepmd_lmp.so #this is copied in the home directory.
units metal
boundary p p p
atom_style atomic
neigh_modify every 1 delay 0 check no
read_data POSCAR.lmp
pair_style deepmd convert_out.pb
pair_coeff * *
variable t equal 100 #Define the temperature
neighbor 2 bin
neigh_modify delay 0 every 1
timestep 0.001 #Define time step
velocity all create $t 3627941 dist gaussian mom yes
velocity all scale $t
fix 1 all nvt temp $t $t 0.1 #iso 0.0 0.0 1.0
thermo 1000
run 20000

Please advise.
Thanks,
Mayank

Comment options

Hi @mayankaditya,

The error undefined symbol: _ZN6google8protobuf5Arena8AllocateEm means the protobuf library that the precompiled libdeepmd_cc.so was built against cannot be found at runtime. Because loading the plugin fails, LAMMPS doesn't register the deepmd pair style, which causes the subsequent "Unrecognized pair style" error.

The fix is to ensure the dynamic linker can find all shared libraries bundled with the precompiled libdeepmd_c package. Try setting LD_LIBRARY_PATH to include the library directory before running LAMMPS [1]:

export LD_LIBRARY_PATH=/mnt/Data/DP_PLUGUIN/libdeepmd_c/lib:$LD_LIBRARY_PATH
lmp -in your_input.lammps

If that resolves the plugin loading, you can make it permanent by patching the RUNPATH of liblammps.so with patchelf (version ≥ 0.13) [2]:

patchelf --set-rpath '$ORIGIN:/mnt/Data/DP_PLUGUIN/libdeepmd_c/lib' /path/to/liblammps.so

Alternatively, you can set the LAMMPS_PLUGIN_PATH environment variable instead of using the plugin load command in the input file [1]:

export LAMMPS_PLUGIN_PATH=/mnt/Data/DP_PLUGUIN/libdeepmd_c/lib/deepmd_lmp

You can verify which libraries are missing by running:

ldd /mnt/Data/DP_PLUGUIN/libdeepmd_c/lib/libdeepmd_cc.so | grep "not found"

This will show you exactly which shared libraries the linker cannot locate. All of them should be present within the libdeepmd_c/lib directory if the package is complete.

To reply, just mention @dosu.


Share context across your team and agents. Try Dosu.

Leave Feedback Learn about deepmd-kit with Dosu Add Dosu to your team

Comment options

Great! export LD_LIBRARY_PATH=/mnt/Data/DP_PLUGUIN/libdeepmd_c/lib:$LD_LIBRARY_PATH worked.

Thank you so much.

Mayank

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
1 participant

AltStyle によって変換されたページ (->オリジナル) /