Recent site activity

Getting started‎ > ‎

Building and using with GPU acceleration

The GPU version on the NVIDIA CUDA platform is fully incorporated into the main trunk. Currently a subset of QMCPACK that is commonly used for solid-state and molecular systems using bspline single-particle orbitals is supported.


Supported features

Boundary conditions:

  • Periodic and open boundary conditions are supported, but not mixed boundary conditions
  • Complex wave functions (e.g. fixed phase) are not yet supported

Wavefunctions:

  • Single Slater determinants with 3D B-spline orbitals. Only real-valued wave functions is supported, but tiling complex orbitals to supercells is supported as long as each k-point is a multiple of half a G-vector of the supercell.
  • Mixed basis representation in which orbitals are represented as:
    • 1D splines times spherical harmonics in spherical regions (muffin tins) around atoms
    • 3D B-splines in the interstitial region
  • One-body and two-body Jastrows represented as 1D B-splines are supported.

Hamiltonians:

  • Nonlocal pseudopotentials (semilocal form)
  • Coulomb interaction
  • Model Periodic Coulomb (MPC) interaction

Drivers:

  • Variational Monte Carlo (VMC)
  • Wave function optimization. Only Jastrow can be optimized at present
  • Diffusion Monte Carlo (DMC)

Compiling the GPU code

  • First, compile and install the einspline library. When building, run
    ./configure --enable-cuda ...
  • To include GPU support in QMCPACK, one of these methods can be used. The nvcc compiler should be in your path.
    • Run cmake with the argument
      -DQMC_CUDA=1.
    • If using toolchains, set QMC_CUDA in the toolchain file as
      SET(QMC_CUDA 1)

Using the GPU code

  • When running QMCPACK with GPUs, you should run one MPI process per GPU on each node. Add the argument --gpu to the qmcapp command line, e.g.,
    mpirun -np 16 qmcapp --gpu myfile.xml
  • Inside myfile.xml, you need to add the attribute gpu="yes" in several places:
  • Inside the <determinantset> element,e.g.
    <determinantset type="einspline" href="cBN_128_V40.TN.h5"
    sort="1" tilematrix="4 0 0 0 4 0 0 0 4"
    twistnum="1" gpu="yes" source="i">
  • Inside each of the<qmc> elements, e.g.
    <qmc method="vmc" move="pbyp" gpu="yes">
  • Finally, the GPU code requires many walkers to work efficiently. Presently, 128-256 walkers gets good efficiency. You may be limited by the amount of memory on the GPU card.
GPU-related input elements are ignored by CPU-only builds and therefore an input file with gpu="yes" is safe to use with CPU builds.
Comments