Page 1 of 1

Issue with installing vasp 6.4.2 with GPU

Posted: Tue Aug 26, 2025 9:10 am
by jun_yin2

My machine is equipped with an AMD EPYC 7763 and four 4090 GPUs.

Software versions used:
Intel MKL 2025.2
NVHPC SDK 25.3
CUDA 12.8

The content of makefile.include is as follows:

Code: Select all

# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxNV\" \
              -DMPI -DMPI_INPLACE -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Duse_bse_te \
              -Dtbdyn \
              -Dqd_emulate \
              -Dfock_dblbuf \
              -D_OPENACC \
              -DUSENCCL -DUSENCCLP2P

CPP         = nvfortran -Mpreprocess -Mfree -Mextend -E $(CPP_OPTIONS) $*$(FUFFIX)  > $*$(SUFFIX)

# N.B.: you might need to change the cuda-version here
#       to one that comes with your NVIDIA-HPC SDK
FC          = mpif90 -acc -gpu=cc89,cc90,cuda12.8 -mp
FCL         = mpif90 -acc -gpu=cc89,cc90,cuda11.0 -mp -c++libs

FREE        = -Mfree

FFLAGS      = -Mbackslash -Mlarge_arrays

OFLAG       = -fast

DEBUG       = -Mfree -O0 -traceback

OBJECTS     = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o

LLIBS       = -cudalib=cublas,cusolver,cufft,nccl -cuda

# Redefine the standard list of O1 and O2 objects
SOURCE_O1  := pade_fit.o minimax_dependence.o
SOURCE_O2  := pead.o

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = nvfortran
CC_LIB      = nvc -w
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1 -Mfixed
FREE_LIB    = $(FREE)

OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = nvc++ --no_warnings

##
## Customize as of this point! Of course you may change the preceding
## part of this file as well if you like, but it should rarely be
## necessary ...
##
# When compiling on the target machine itself , change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -tp znver3
FFLAGS     += $(VASP_TARGET_CPU)

# Specify your NV HPC-SDK installation (mandatory)
#... first try to set it automatically
NVROOT      =$(shell which nvfortran | awk -F /compilers/bin/nvfortran '{ print $$1 }')

# If the above fails, then NVROOT needs to be set manually
#NVHPC      ?= /opt/nvidia/hpc_sdk
#NVVERSION   = 21.11
#NVROOT      = $(NVHPC)/Linux_x86_64/$(NVVERSION)

## Improves performance when using NV HPC-SDK >=21.11 and CUDA >11.2
#OFLAG_IN   = -fast -Mwarperf
#SOURCE_IN  := nonlr.o

# Software emulation of quadruple precsion (mandatory)
QD         ?= $(NVROOT)/compilers/extras/qd
LLIBS      += -L$(QD)/lib -lqdmod -lqd
INCS       += -I$(QD)/include/qd

# Intel MKL for FFTW, BLAS, LAPACK, and scaLAPACK
MKLROOT    ?= /opt/intel/oneapi/mkl/latest
LLIBS_MKL   = -Mmkl -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64
INCS       += -I$(MKLROOT)/include/fftw

# Use a separate scaLAPACK installation (optional but recommended in combination with OpenMPI)
# Comment out the two lines below if you want to use scaLAPACK from MKL instead
#SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
#LLIBS_MKL   = -L$(SCALAPACK_ROOT)/lib -lscalapack -Mmkl

LLIBS      += $(LLIBS_MKL)

# HDF5-support (optional but strongly recommended)
#CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT  ?= /path/to/your/hdf5/installation
#LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
#INCS       += -I$(HDF5_ROOT)/include

# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS    += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS          += -L$(WANNIER90_ROOT)/lib -lwannier

# For the fftlib library (hardly any benefit for the OpenACC GPU port, especially in combination with MKL's FFTs)
#CPP_OPTIONS+= -Dsysv
#FCL        += fftlib.o
#CXX_FFTLIB  = nvc++ -mp --no_warnings -std=c++11 -DFFTLIB_USE_MKL -DFFTLIB_THREADSAFE
#INCS_FFTLIB = -I./include -I$(MKLROOT)/include/fftw
#LIBS       += fftlib
#LLIBS      += -ldl

During the installation process, the following error occurred.

Code: Select all

mpif90 -acc -gpu=cc89,cc90,cuda12.8 -mp -Mfree -Mbackslash -Mlarge_arrays -tp znver3 -fast -I/opt/nvidia/hpc_sdk/Linux_x86_64/25.3/compilers/extras/qd/include/qd -I/opt/intel/oneapi/mkl/latest/include/fftw  -c fock_glb.f90
NVFORTRAN-S-0087-Non-constant expression where constant expression required (fock_glb.F: 239)
  0 inform,   0 warnings,   1 severes, 0 fatal for fock_glb
make[2]: *** [makefile:167: fock_glb.o] Error 2
make[2]: Leaving directory '/home/polyucmp/code/vasp.6.4.2/build/std'
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:129: all] Error 1
make[1]: Leaving directory '/home/polyucmp/code/vasp.6.4.2/build/std'
make: *** [makefile:17: std] Error 2

How can I resolve it? Thank you!


Re: Issue with installing vasp 6.4.2 with GPU

Posted: Wed Aug 27, 2025 1:46 am
by Zhiyuan Yin

Hi,
Can you check the compute capability and CUDA version in your make.Include the file and ensure it matches your RTX 4090 and the NVHPC toolkit?

Regards,
Zhiyuan


Re: Issue with installing vasp 6.4.2 with GPU

Posted: Wed Aug 27, 2025 1:30 pm
by andreas.singraber

Hello!

I think the compute capability is covered for the RTX 4090 with -gpu=cc89 in the given makefile.include. However, I noticed that your file is missing the -D_OPENMP option in the CPP_OPTIONS if compared to the arch/makefile.include.nvhpc_ompi_mkl_omp_acc template file supplied with VASP. If the intention was to build without OpenMP-support then I think you also should remove the -mp flag in the compiler definitions FC and FCL!

Can you try with either keeping or removing both, -D_OPENMP and -mp, at the same time? Please always do a complete make veryclean after any changes to the makefile.include.

Thank you!

All the best,
Andreas Singraber