abacus-develop
abacus-develop copied to clipboard
Is it possible to compile ABACUS with `icpx` (2024.x) using `-DUSE_CUDA=1`?
Details
I am attempting to build ABACUS with NVIDIA GPU support. However, I encountered an issue where the build can only be successfully compiled using gcc. When using icpx, the compilation fails with the following error, suggesting an unsupported clang version.
The cmake command I used is:
cmake -B build -DMPI_CXX_COMPILER=mpiicpx -DCMAKE_CXX_COMPILER=icpx -DUSE_CUDA=1
Output:
-- The CXX compiler identification is IntelLLVM 2024.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/2024.2/bin/icpx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.34.1")
-- Found git: attempting to get commit info...
-- Current commit hash: 6224f10b9
-- Last commit date: Thu Sep 19 22:28:15 2024 +0800
-- Found Cereal: /usr/include
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Found ELPA: /usr/local/lib/libelpa_openmp.so
-- Performing Test ELPA_VERSION_SATISFIES
-- Performing Test ELPA_VERSION_SATISFIES - Success
-- Found MPI_CXX: /opt/intel/oneapi/2024.2/lib/libmpicxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found OpenMP_CXX: -fiopenmp
-- Found OpenMP: TRUE
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - /usr/local/cuda-12.1/bin/nvcc
-- Found CUDAToolkit: /usr/local/cuda-12.1/include (found version "12.1.66")
CMake Error at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:726 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.
Compiler: /usr/local/cuda-12.1/bin/nvcc
Build flags:
Id flags:
--keep;--keep-dir;tmp;-ccbin=/opt/intel/oneapi/2024.2/bin/icpx;-gencode=arch=compute_60,code=sm_60;-gencode=arch=compute_70,code=sm_70;-gencode=arch=compute_75,code=sm_75;-gencode=arch=compute_80,code=sm_80;-gencode=arch=compute_86,code=sm_86;-gencode=arch=compute_89,code=sm_89;-gencode=arch=compute_90,code=sm_90
-v
The output was:
1
#$ _NVVM_BRANCH_=nvvm
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/usr/local/cuda-12.1/bin
#$ _THERE_=/usr/local/cuda-12.1/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_DIR_=targets/x86_64-linux
#$ TOP=/usr/local/cuda-12.1/bin/..
#$ NVVMIR_LIBRARY_DIR=/usr/local/cuda-12.1/bin/../nvvm/libdevice
#$
LD_LIBRARY_PATH=/usr/local/cuda-12.1/bin/../lib:/opt/intel/oneapi/2024.2/opt/mpi/libfabric/lib:/opt/intel/oneapi/2024.2/opt/compiler/lib:/opt/intel/oneapi/2024.2/lib:/home/itztony/Softwares/libtorch/lib:/usr/local/cuda-12.1/lib64:/usr/local/lib:
#$
PATH=/usr/local/cuda-12.1/bin/../nvvm/bin:/usr/local/cuda-12.1/bin:/opt/intel/oneapi/vtune/2024.2/bin64:/opt/intel/oneapi/advisor/2024.2/bin64:/opt/intel/oneapi/2024.2/bin:/usr/local/cuda-12.1/bin:/usr/local/bin:/home/itztony/.local/bin:/home/itztony/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/itztony/Softwares/VASP/vasp.6.2.1/bin
#$ INCLUDES="-I/usr/local/cuda-12.1/bin/../targets/x86_64-linux/include"
#$ LIBRARIES=
"-L/usr/local/cuda-12.1/bin/../targets/x86_64-linux/lib/stubs"
"-L/usr/local/cuda-12.1/bin/../targets/x86_64-linux/lib"
#$ CUDAFE_FLAGS=
#$ PTXAS_FLAGS=
#$ rm tmp/a_dlink.reg.c
#$ "/opt/intel/oneapi/2024.2/bin"/icpx
-D__CUDA_ARCH_LIST__=600,700,750,800,860,890,900 -E -x c++ -D__CUDACC__
-D__NVCC__ "-I/usr/local/cuda-12.1/bin/../targets/x86_64-linux/include"
-D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=1
-D__CUDACC_VER_BUILD__=66 -D__CUDA_API_VER_MAJOR__=12
-D__CUDA_API_VER_MINOR__=1 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -include
"cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" -o
"tmp/CMakeCUDACompilerId.cpp4.ii"
In file included from <built-in>:1:
In file included from
/usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/cuda_runtime.h:83:
/usr/local/cuda-12.1/bin/../targets/x86_64-linux/include/crt/host_config.h:140:2:
error: -- unsupported clang version! clang version must be less than 16 and
greater than 3.2 . The nvcc flag '-allow-unsupported-compiler' can be used
to override this version check; however, using an unsupported host compiler
may cause compilation failure or incorrect run time execution. Use at your
own risk.
140 | #error -- unsupported clang version! clang version must be less than 16 and greater than 3.2 . The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
| ^
1 error generated.
# --error 0x1 --
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
/usr/share/cmake-3.22/Modules/CMakeDetermineCUDACompiler.cmake:298 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:308 (enable_language)
-- Configuring incomplete, errors occurred!
See also "/home/itztony/Documents/Research/Coding/abacus-develop/build/CMakeFiles/CMakeOutput.log".
See also "/home/itztony/Documents/Research/Coding/abacus-develop/build/CMakeFiles/CMakeError.log".
Have you read FAQ on the online manual http://abacus.deepmodeling.com/en/latest/community/faq.html
- [X] Yes, I have read the FAQ part on online manual.
Task list for Issue attackers (only for developers)
- [ ] Understand the problem or question described by the user.
- [ ] Check if the issue is a known problem or has been addressed in the documentation.
- [ ] Test the issue or problem on a similar system or environment, if possible.
- [ ] Identify the root cause or provide clarification on the user's question.
- [ ] Provide a step-by-step guide, including any necessary resources, to resolve the issue or answer the question.
- [ ] If the issue is related to documentation, update the documentation to prevent future confusion (optional).
- [ ] If the issue is related to code, consider implementing a fix or improvement (optional).
- [ ] Review and incorporate any relevant feedback from users or developers.
- [ ] Ensure the user's issue is resolved or their question is answered and close the ticket.
@AsTonyshment Not possible See #2906 #4976
I see. I'll try to use the gcc-compiled version.
@AsTonyshment Please set env var CUDAFLAG="-allow-unsupported-compiler". Although these compilers are not supported officially, generally it's OK to do so as long as the program works.