Lammps installation with matgl/m3gnet

Dear All,

I am trying to install LAMMPS with M3GNET potential using following commands:

unzip lammps-based-on-lammps_2Aug2023.zip
cd lammps-based-on-lammps_2Aug2023
mkdir build
cd build
cmake -C …/cmake/presets/basic.cmake -DPython_EXECUTABLE:FILEPATH=$PYTHONPATH -DPython3_EXECUTABLE:FILEPATH=$PYTHONPATH -D CMAKE_INSTALL_PREFIX=/local/myenv/ -D BUILD_SHARED_LIBS=on -D LAMMPS_EXCEPTIONS=on -D PKG_PYTHON=on -D PKG_ML-M3GNET=on -D PKG_EXTRA-COMPUTE=on -D PKG_EXTRA-FIX=on -D PKG_MANYBODY=on -D PKG_EXTRA-DUMP=on -D PKG_MOLECULE=on …/cmake
cmake --build .
make install

With this lammps I am able to run jobs where “pair_style lj/cut 2.5”. However, it is giving error for “pair_style m3gnet ./matgl_driver.py” as follows:
LAMMPS (2 Aug 2023)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
Reading data file …
orthogonal box = (0 0 0) to (5.1499664 5.1499664 5.1499664)
1 by 1 by 1 MPI processor grid
reading atoms …
12 atoms
read_data CPU = 0.079 seconds
DGL backend not selected or invalid. Assuming PyTorch for now.
Setting the default backend to “pytorch”. You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable. Valid options are: pytorch, mxnet, tensorflow (all lowercase)
Traceback (most recent call last):
File “/Volumes/mltrnvol/mlvolume/materials-rnd/workspace/sindrila/lammps_test/2_m3gnet_test/./matgl_driver.py”, line 37, in m3gnet_initialize
myPotential = matgl.load_model(model_name)
File “/root/env_lammps/lib/python3.10/site-packages/matgl/utils/io.py”, line 202, in load_model
fpaths = _get_file_paths(path, **kwargs)
File “/root/env_lammps/lib/python3.10/site-packages/matgl/utils/io.py”, line 244, in _get_file_paths
raise ValueError(f"No valid model found in pre-trained_models at {PRETRAINED_MODELS_BASE_URL}.") from None
ValueError: No valid model found in pre-trained_models at matgl/pretrained_models at main · materialsvirtuallab/matgl · GitHub.
ERROR: Cannot initialize python for pair_coeff of M3GNet. (src/ML-M3GNET/pair_m3gnet.cpp:524)

Please suggest me how to solve this issue.
Looking forward for your reply

Best
Sindrila

This is clearly an issue with configuring the mg3net add-on. Since this is not part of the LAMMPS distribution, the LAMMPS developers know nothing about it. You have more carefully study the mg2net documentation and/or contact the mg3net developers about this.