Skip to content
forked from pyscf/gpu4pyscf

A plugin to use Nvidia GPU in PySCF package

License

Notifications You must be signed in to change notification settings

cjknight/gpu4pyscf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPU plugin for PySCF

Build and Install

  • Install dependencies Install cuda11.6, cudnn, Cupy and its denpendencies (Numpy, scipy, optuna, cuTENSOR v1.5, cuSPARSELt v0.2.0, cuDNN v8.3 / v8.4 / v8.5, NCCL v2.11 / v2.12 / v2.13 / v2.14)
apt install libnccl2=2.12.10-1+cuda11.6 libnccl-dev=2.12.10-1+cuda11.6  
python -m pip install -U setuptools pip  
pip install optuna scipy numpy cupy
nvcc --version

cd gpu4pyscf
python setup install
  • Set enviromental variables
vi ~/.bashrc
export PATH=$PATH:/usr/local/cuda-11.6/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.6/lib64
export PYTHONPATH="/root/gpu4pyscf":$PYTHONPATH
source ~/.bashrc
  • Troubles
ln -s ...../cint.h   ***/cint.h

Examples

import pyscf
# Load the gpu4pyscf to enable GPU mode
from gpu4pyscf import patch_pyscf

mol = pyscf.M(atom='''
O        0.000000    0.000000    0.117790
H        0.000000    0.755453   -0.471161
H        0.000000   -0.755453   -0.471161''',
basis='ccpvdz',
verbose=5)
mf = mol.RHF().run()

# Run SCF with CPU
mf.device = 'cpu'
mf.run()

About

A plugin to use Nvidia GPU in PySCF package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cuda 91.6%
  • Python 6.1%
  • C 1.7%
  • CMake 0.6%