-
Notifications
You must be signed in to change notification settings - Fork 648
Plugin mode installtion #5487
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
All reactions
Replies: 3 comments 5 replies
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:
-
Upgrade CUDA (recommended): If you can upgrade your CUDA toolkit and NVIDIA driver, you can use the precompiled
libdeepmd_c.tar.gzdirectly for a straightforward offline plugin build. -
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.
-
Use the conda installer's pre-built LAMMPS: The
deepmd-kit-x.y.z-cuda-Linux-x86_64.shinstaller 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]:
- Extract
libdeepmd_c.tar.gz - Download LAMMPS source (version
8Apr2021or later) - Build LAMMPS with
PLUGINenabled andBUILD_SHARED_LIBS=yes - Set
DEEPMD_C_ROOTto 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
All reactions
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
All reactions
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.soAlternatively, 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_lmpYou 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
All reactions
Great! export LD_LIBRARY_PATH=/mnt/Data/DP_PLUGUIN/libdeepmd_c/lib:$LD_LIBRARY_PATH worked.
Thank you so much.
Mayank