Installing GPAW with conda

In short, in a clean environment, everything should work with just five lines:


Initialize conda. If it is in the .bashch, source it. If not, source “PATHTOCONDA/miniconda3/etc/profile.d/”.

conda create --name gpaw22 python=3.10
conda activate gpaw22
conda install -c conda-forge gpaw=*=*openmpi* openmpi=4.1.2 gcc=12.1.0 ucx

For details, see the description below.

1. Install conda – software and environment management system.

Here is the official instruction:

On July 2022, run these:


If you wish to autostart conda, allow it to write to .bashrc.

P.S. Here are good intro to conda:

2. Create a conda virtual environment:

conda create --name gpaw22 python=3.10

If needed, remove the environment as:

conda remove --name gpaw22 --all

You can check the available environments as:

conda env list

3. Activate the virtual environment.

conda activate gpaw22

4. Install gpaw:

Ensure that no interfering modules and environments are loaded.

To purge modules, execute:

module purge

To check whether some code (like mpirun) has an alternative path, try:

which codename

There should be no mpirun, ase, libxc, numpy, scipy, etc. Otherwise, the installation with conda will most probably fail due to conflicting paths.

4.1. It is safer to install using gpaw22.yml file from vliv/conda directory on FEND:

conda env create -f gpaw22.yml

4.2. Pure installation is simple, but might not work:

conda install -c conda-forge gpaw=*=*openmpi*

Recently, there were problems with openmpi. Try downgrading it to version 4.1.2:

conda install -c conda-forge openmpi=4.1.2

To enable the Rose support, for example, on FEND v4 adn v5, install Ucx:

conda install -c conda-forge ucx

If you get an error about GLIBCXX, try upgrading gcc:

conda install -c conda-forge gcc=12.1.0

4.3. To make a quick check of the installation, run “gpaw -P 2 test” or “gpaw info”.

The installation might fail. In case you succeed, save the yml file as:

conda env export | grep -v "^prefix: " > gpaw22.yml

Now you can use it to install gpaw as:

conda env create -f gpaw22.yml

To properly test the installation install pytest and follow That might take hours.

conda install -c conda-forge pytest pytest-xdist 

5. If needed, install extra packages within your specific conda environment (gpaw22).

To apply D4 dispersion correction:

conda install -c conda-forge dftd4 dftd4-python

To analyze trajectories:

conda install -c conda-forge mdanalysis

To analyze electronic density (some might not work):

pip install git+
pip install git+
pip install git+
pip install pybader
pip install cpmd-cube-tools
conda install -c conda-forge chargemol

To use catlearn:

pip install catlearn

6. Run calculations by adding these lines to the submission script:

Note1: Check the path and change the USERNAME

Note2: Use ucx and export variables.

Note3: You may play with the number of openmp threads.

module purge
source "/groups/kemi/USERNAME/miniconda3/etc/profile.d/"
conda activate gpaw22
export OMPI_MCA_pml="^ucx"
export OMPI_MCA_osc="^ucx"
mpirun gpaw python

7. Use scalapack for speeding-up your calculations.

Add the “parallel” keyword to GPAW calculator:

parallel = {'augment_grids':True,'sl_auto':True}

For more options see For example, try ELPA  for LCAO mode. See

parallel = {'augment_grids':True,'sl_auto':True,'use_elpa':True}

8. If needed, add fixes.

To do Bayesian error estimation see

To use MLMin/NEB apply corrections from

9. Something worth trying:



gpaw benchmarking: