Installation¶
This guide covers how to install MACE Inference on your system.
Requirements¶
- Python: 3.9, 3.10, or 3.11
- Operating System: Linux, macOS, or Windows
- Hardware: CPU or NVIDIA GPU (for acceleration)
Installation Methods¶
Method 1: pip (Recommended)¶
Method 2: From Source¶
# Clone the repository
git clone https://github.com/lichman0405/mace-inference.git
cd mace-inference
# Install in development mode
pip install -e ".[dev]"
Method 3: Conda Environment¶
We recommend using a dedicated conda environment:
Optional Dependencies¶
D3 Dispersion Correction¶
For DFT-D3 dispersion correction support:
Development Tools¶
For contributing to the project:
This includes:
pytest- Testing frameworkruff- Lintingmypy- Type checking
Verify Installation¶
After installation, verify everything works:
from mace_inference import MACEInference
# This will download the model on first run
calc = MACEInference(model="medium", device="cpu")
print("✓ MACE Inference installed successfully!")
Or use the CLI:
Troubleshooting¶
CUDA Not Detected¶
If GPU is not detected:
import torch
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"CUDA version: {torch.version.cuda}")
Make sure your PyTorch installation matches your CUDA version.
Model Download Issues¶
Models are cached in ~/.cache/mace/. If download fails:
- Check internet connection
- Try manual download from MACE Models
- Specify local model path:
Memory Issues¶
For large systems, try:
# Use lower precision
calc = MACEInference(model="medium", default_dtype="float32")
# Or reduce batch size in dynamics
result = calc.run_md(atoms, steps=1000, save_interval=100)
Next Steps¶
- Quick Start Guide - Learn the basics
- User Guide - Detailed tutorials
- API Reference - Complete documentation