richard-evans / vampire

Atomistic simulator for magnetic materials
GNU General Public License v2.0
122 stars 91 forks source link

Cuda issue when compiling #92

Closed jpsinnecker closed 1 year ago

jpsinnecker commented 1 year ago

Hi,

We have been using Vampire for a while now, for undergraduate projects mainly. We managed to compile the serial, parallel, and Cuda versions.

This week we had to reinstall Linux in our GPU unit, and after that, we got an odd error while installing the Cuda version. The serial and parallel versions were compiled without issues. However, when compiling the Cuda version, an error appeared:

nvcc -DCOMP='"NVCC 23_0"' src/cuda/monte_carlo.cu -dc -o obj/cuda/monte_carlo.o -O3 -I./hdr -DCUDA -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=compute_50 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61 -gencode arch=compute_70,code=compute_70 -gencode arch=compute_75,code=compute_75 --use_fast_math -ftz=true -std=c++14 -Wno-deprecated-gpu-targets -DCUDA_DP -DCUDA_MATRIX=CSR

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with '...':

435 | function(_Functor&& __f)

  |                                                                                                                                                 ^ 

/usr/include/c++/11/bits/std_function.h:435:145: note: '_ArgTypes'

/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with '...':

530 | operator=(_Functor&& __f)

  |                                                                                                                                                  ^ 

/usr/include/c++/11/bits/std_function.h:530:146: note: '_ArgTypes'

make: *** [src/cuda/makefile:58: obj/cuda/monte_carlo.o] Error 1

We have:

Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy

CUDA: Driver Version: 510.85.02
CUDA Version: 11.6

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Fri_Dec_17_18:16:03_PST_2021 Cuda compilation tools, release 11.6, V11.6.55 Build cuda_11.6.r11.6/compiler.30794723_0

GCC: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

Can anyone help us with this?

jpsinnecker commented 1 year ago

Hi,

We found out that the issue was related to the GCC version. We installed gcc-9 and managed to compile it. We don't know ow if there is a more elegant solution.

Thanks.

JianYugen commented 8 months ago

Hi, jpsinnecker. I'm a beginner in Vampire, and I had some issues when compiling it with CUDA. I understand that the makefile should be modified for a higher version of CUDA. However, I don't know how to modify the setting of header files in .../thrust (in ./hdr/cusplibrary-0.5.1/cusp/system/cuda/arch.h). A higher version of CUDA does not seem to have these header files.

Could you please tell me how you compile it?

We have a similar configuration to yours: CUDA Version: 11.6 gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

Thank you.