Skip to content
NAISS Logo Allocations Support Training Software naiss.se

Dftk

Arrhenius

How to install DFTK

Start an interactive session on a GPU node:

interactive -A naiss202t-u-xyz-gpu --partition gpu --gpus=1  -t 02:00:00

Load the Julia module:

ml GPU/Julia/1.12.2

In your project directory create a folder to store packages, otherwise they will be installed in your HOME which has a limited space:

mkdir -p /path-to-directory-in-project/Packages
export JULIA_DEPOT_PATH=/path-to-directory-in-project/Packages
cd /path-to-directory-in-project/

Start a Julia session and add the following packages:

using Pkg

Pkg.activate(".")
Pkg.add("CUDA")
Pkg.add(url="https://github.com/JuliaMolSim/DFTK.jl",rev="master")
Pkg.add(["AtomsBuilder","PseudoPotentialData"])

Pkg.precompile()

other packages can be added in a similar manner if needed.

How to use DFTK

Example job script for a GPU run on 1 GPU card:

#!/bin/bash
#SBATCH -A XXXX-XX-XX
#SBATCH -J job
#SBATCH -t 00:10:00
#SBATCH -p gpu
#SBATCH --gpus=1
# load required modules
ml GPU/Julia/1.12.2

# Set the path to Packages
export JULIA_DEPOT_PATH=/path-to-directory-in-project/Packages

# Run the simulation and first activate the project
cd /path-to-directory-in-project/
julia --project=. script_gpu.jl