Closed tbhaxor closed 1 year ago
__CUDACC__
is defined by the CUDA compiler. This most likely means there is an issue with finding the CUDA compiler. Can you post the output of the CMake configuration?
The command I used to configure build
$ cmake -DKokkos_ARCH_TURING75=ON -DKokkos_ENABLE_CUDA=ON -DCUDA_ROOT=/opt/cuda \
-DCMAKE_CXX_COMPILER=external/Kokkos/bin/nvcc_wrapper \
-DCMAKE_CXX_FLAGS:STRING="-I/opt/cuda/targets/x86_64-linux/include/ -L/opt/cuda/targets/x86_64-linux/lib/" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DCMAKE_BUILD_TYPE=Release -Bbuild -G Ninja
This is the output
CMake Warning at external/parthenon/cmake/MachineCfg.cmake:61 (message):
Not using any machine configuration. Consider creating a configuration
file following the examples in /cmake/machine_cfgs/ and then point the
MACHINE_CFG cmake or environment variable to your custom file.Note, that
the machine file can be placed in any directory (also outside the repo).
Call Stack (most recent call first):
CMakeLists.txt:9 (include)
-- The CXX compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /mnt/Projects/athenapk/external/Kokkos/bin/nvcc_wrapper - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- clang-format --version: 15.0.7
-- black --version: black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.9
-- Found MPI_CXX: /usr/lib/libmpi_cxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1") found components: CXX
CMake Warning at external/parthenon/cmake/MachineCfg.cmake:61 (message):
Not using any machine configuration. Consider creating a configuration
file following the examples in /mnt/Projects/athenapk/cmake/machine_cfgs/
and then point the MACHINE_CFG cmake or environment variable to your custom
file.Note, that the machine file can be placed in any directory (also
outside the repo).
Call Stack (most recent call first):
external/parthenon/CMakeLists.txt:21 (include)
-- The C compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- black --version: black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.9
-- Found HDF5: /usr/lib/libhdf5.so;/usr/lib/libsz.so;/usr/lib/libz.so;/usr/lib/libdl.a;/usr/lib/libm.so (found version "1.12.2") found components: C
-- Setting default Kokkos CXX standard to 17
-- The project name is: Kokkos
-- Compiler Version: 11.8.89
-- SERIAL backend is being turned on to ensure there is at least one Host space. To change this, you must enable another host execution space and configure with -DKokkos_ENABLE_SERIAL=OFF or change CMakeCache.txt
-- Using -std=c++17 for C++17 standard as feature
-- Built-in Execution Spaces:
-- Device Parallel: Kokkos::Cuda
-- Host Parallel: NoTypeDefined
-- Host Serial: SERIAL
--
-- Architectures:
-- TURING75
-- Found CUDAToolkit: /opt/cuda/include (found version "11.8.89")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found TPLCUDA: TRUE
-- Found TPLLIBDL: /usr/include
-- Using internal desul_atomics copy
-- Kokkos Devices: CUDA;SERIAL, Kokkos Backends: CUDA;SERIAL
-- Using Kokkos source from Kokkos_ROOT=/mnt/Projects/athenapk/external/Kokkos
-- PAR_LOOP_LAYOUT='MANUAL1D_LOOP' (default par_for wrapper layout)
-- PAR_LOOP_INNER_LAYOUT='TVR_INNER_LOOP' (default par_for_inner wrapper layout)
-- Found Python3: /usr/bin/python3.10 (found version "3.10.9") found components: Interpreter
-- Found Git: /usr/bin/git (found version "2.39.2")
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Checking for Python modules (numpy;unyt;matplotlib;h5py;scipy) required for regression tests.
Check can be disabled by setting PARTHENON_ENABLE_PYTHON_MODULE_CHECK=OFF but then
tests are not guaranteed to work anymore.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
EDIT with /usr/bin/g++-11
as compiler
CMake Warning at external/parthenon/cmake/MachineCfg.cmake:61 (message):
Not using any machine configuration. Consider creating a configuration
file following the examples in /cmake/machine_cfgs/ and then point the
MACHINE_CFG cmake or environment variable to your custom file.Note, that
the machine file can be placed in any directory (also outside the repo).
Call Stack (most recent call first):
CMakeLists.txt:9 (include)
-- The CXX compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- clang-format --version: 15.0.7
-- black --version: black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.9
-- Found MPI_CXX: /usr/lib/libmpi_cxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1") found components: CXX
CMake Warning at external/parthenon/cmake/MachineCfg.cmake:61 (message):
Not using any machine configuration. Consider creating a configuration
file following the examples in /mnt/Projects/athenapk/cmake/machine_cfgs/
and then point the MACHINE_CFG cmake or environment variable to your custom
file.Note, that the machine file can be placed in any directory (also
outside the repo).
Call Stack (most recent call first):
external/parthenon/CMakeLists.txt:21 (include)
-- The C compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- black --version: black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.9
-- Found HDF5: /usr/lib/libhdf5.so;/usr/lib/libsz.so;/usr/lib/libz.so;/usr/lib/libdl.a;/usr/lib/libm.so (found version "1.12.2") found components: C
-- Setting default Kokkos CXX standard to 17
-- The project name is: Kokkos
-- Compiler Version: 11.8.89
-- kokkos_launch_compiler (/mnt/Projects/athenapk/external/Kokkos/bin/kokkos_launch_compiler) is enabled...
-- SERIAL backend is being turned on to ensure there is at least one Host space. To change this, you must enable another host execution space and configure with -DKokkos_ENABLE_SERIAL=OFF or change CMakeCache.txt
-- Using -std=c++17 for C++17 standard as feature
-- Built-in Execution Spaces:
-- Device Parallel: Kokkos::Cuda
-- Host Parallel: NoTypeDefined
-- Host Serial: SERIAL
--
-- Architectures:
-- TURING75
-- Found CUDAToolkit: /opt/cuda/include (found version "11.8.89")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found TPLCUDA: TRUE
-- Found TPLLIBDL: /usr/include
-- Using internal desul_atomics copy
-- Kokkos Devices: CUDA;SERIAL, Kokkos Backends: CUDA;SERIAL
-- Using Kokkos source from Kokkos_ROOT=/mnt/Projects/athenapk/external/Kokkos
-- PAR_LOOP_LAYOUT='MANUAL1D_LOOP' (default par_for wrapper layout)
-- PAR_LOOP_INNER_LAYOUT='TVR_INNER_LOOP' (default par_for_inner wrapper layout)
-- Found Python3: /usr/bin/python3.10 (found version "3.10.9") found components: Interpreter
-- Found Git: /usr/bin/git (found version "2.39.2")
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Checking for Python modules (numpy;unyt;matplotlib;h5py;scipy) required for regression tests.
Check can be disabled by setting PARTHENON_ENABLE_PYTHON_MODULE_CHECK=OFF but then
tests are not guaranteed to work anymore.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
-DCMAKE_CXX_COMPILER
should point to the host compiler (g++), not the CUDA compiler or wrapper.
-DCMAKE_CXX_COMPILER
should point to the host compiler (g++), not the CUDA compiler or wrapper.
Yes, with g++ It is not working so I had to use g++-11. Still same error. nvcc_wrapper I did it after in search of fix
These are cache variables from the initial build (i did it weeks ago)
$ grep -n CMAKE_CXX_COMPILER CMakeCache.txt
48:CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-11
52:CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-11
56:CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-11
1115://ADVANCED property for variable: CMAKE_CXX_COMPILER
1116:CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
1117://ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
1118:CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
1119://ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
1120:CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
What does your CMake configure output look like now?
CMake configure output look like now?
You mean console output? that is already shared here https://github.com/parthenon-hpc-lab/athenapk/issues/42#issuecomment-1482902073
That has the wrong setting for CMAKE_CXX_COMPILER
.
That has the wrong setting for
CMAKE_CXX_COMPILER
.
@BenWibking Ok here is with g++ compiler
$ cmake -DKokkos_ARCH_TURING75=ON -DKokkos_ENABLE_CUDA=ON -DCUDA_ROOT=/opt/cuda \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-11 \
-DCMAKE_CXX_FLAGS:STRING="-I/opt/cuda/targets/x86_64-linux/include/ -L/opt/cuda/targets/x86_64-linux/lib/" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DCMAKE_BUILD_TYPE=Release -Bbuild -G Ninja
CMake Warning at external/parthenon/cmake/MachineCfg.cmake:61 (message):
Not using any machine configuration. Consider creating a configuration
file following the examples in /cmake/machine_cfgs/ and then point the
MACHINE_CFG cmake or environment variable to your custom file.Note, that
the machine file can be placed in any directory (also outside the repo).
Call Stack (most recent call first):
CMakeLists.txt:9 (include)
-- The CXX compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- clang-format --version: 15.0.7
-- black --version: black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.9
-- Found MPI_CXX: /usr/lib/libmpi_cxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1") found components: CXX
CMake Warning at external/parthenon/cmake/MachineCfg.cmake:61 (message):
Not using any machine configuration. Consider creating a configuration
file following the examples in /mnt/Projects/athenapk/cmake/machine_cfgs/
and then point the MACHINE_CFG cmake or environment variable to your custom
file.Note, that the machine file can be placed in any directory (also
outside the repo).
Call Stack (most recent call first):
external/parthenon/CMakeLists.txt:21 (include)
-- The C compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- black --version: black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.9
-- Found HDF5: /usr/lib/libhdf5.so;/usr/lib/libsz.so;/usr/lib/libz.so;/usr/lib/libdl.a;/usr/lib/libm.so (found version "1.12.2") found components: C
-- Setting default Kokkos CXX standard to 17
-- The project name is: Kokkos
-- Compiler Version: 11.8.89
-- kokkos_launch_compiler (/mnt/Projects/athenapk/external/Kokkos/bin/kokkos_launch_compiler) is enabled...
-- SERIAL backend is being turned on to ensure there is at least one Host space. To change this, you must enable another host execution space and configure with -DKokkos_ENABLE_SERIAL=OFF or change CMakeCache.txt
-- Using -std=c++17 for C++17 standard as feature
-- Built-in Execution Spaces:
-- Device Parallel: Kokkos::Cuda
-- Host Parallel: NoTypeDefined
-- Host Serial: SERIAL
--
-- Architectures:
-- TURING75
-- Found CUDAToolkit: /opt/cuda/include (found version "11.8.89")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found TPLCUDA: TRUE
-- Found TPLLIBDL: /usr/include
-- Using internal desul_atomics copy
-- Kokkos Devices: CUDA;SERIAL, Kokkos Backends: CUDA;SERIAL
-- Using Kokkos source from Kokkos_ROOT=/mnt/Projects/athenapk/external/Kokkos
-- PAR_LOOP_LAYOUT='MANUAL1D_LOOP' (default par_for wrapper layout)
-- PAR_LOOP_INNER_LAYOUT='TVR_INNER_LOOP' (default par_for_inner wrapper layout)
-- Found Python3: /usr/bin/python3.10 (found version "3.10.9") found components: Interpreter
-- Found Git: /usr/bin/git (found version "2.39.2")
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Checking for Python modules (numpy;unyt;matplotlib;h5py;scipy) required for regression tests.
Check can be disabled by setting PARTHENON_ENABLE_PYTHON_MODULE_CHECK=OFF but then
tests are not guaranteed to work anymore.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
Can you try deleting these flags: -DCMAKE_CXX_FLAGS:STRING="-I/opt/cuda/targets/x86_64-linux/include/ -L/opt/cuda/targets/x86_64-linux/lib/"
Still same error
Did you get error? I have tried it with microsoft c++ extension, clangd in vscode and also in qtcreator, just thinking maybe it is because of editor or language server specific but same error in all of them
No, I haven't seen this error before.
Which code editor you use?
I use emacs, but I'm not sure how that's relevant here. Are you building from the command line? I assumed so, since you listed:
$ cmake -DKokkos_ARCH_TURING75=ON -DKokkos_ENABLE_CUDA=ON -DCUDA_ROOT=/opt/cuda \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-11 \
-DCMAKE_CXX_FLAGS:STRING="-I/opt/cuda/targets/x86_64-linux/include/ -L/opt/cuda/targets/x86_64-linux/lib/" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DCMAKE_BUILD_TYPE=Release -Bbuild -G Ninja
for your CMake configure step.
Yes
@BenWibking does this relate to the current problem https://github.com/kokkos/kokkos/issues/5139
I am able to build successfully with
$ cmake .. -DKokkos_ARCH_VOLTA70=ON -DKokkos_ENABLE_CUDA=ON -GNinja
I get:
-- Setting default Kokkos CXX standard to 17
-- The project name is: Kokkos
-- Compiler Version: 11.8.89
-- kokkos_launch_compiler (/mnt/home/wibkingb/test/athenapk/external/Kokkos/bin/kokkos_launch_compiler) is enabled...
-- Using -std=c++17 for C++17 standard as feature
-- Built-in Execution Spaces:
-- Device Parallel: Kokkos::Cuda
-- Host Parallel: NoTypeDefined
-- Host Serial: SERIAL
--
-- Architectures:
-- VOLTA70
-- Using internal desul_atomics copy
-- Kokkos Devices: CUDA;SERIAL, Kokkos Backends: CUDA;SERIAL
-- Using Kokkos source from Kokkos_ROOT=/mnt/home/wibkingb/test/athenapk/external/Kokkos
-- PAR_LOOP_LAYOUT='MANUAL1D_LOOP' (default par_for wrapper layout)
-- PAR_LOOP_INNER_LAYOUT='TVR_INNER_LOOP' (default par_for_inner wrapper layout)
-- Checking for Python modules (numpy;unyt;matplotlib;h5py;scipy) required for regression tests.
Check can be disabled by setting PARTHENON_ENABLE_PYTHON_MODULE_CHECK=OFF but then
tests are not guaranteed to work anymore.
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/home/wibkingb/test/athenapk/build
For some reason I do not understand, your CMake configuration does not have the line
-- kokkos_launch_compiler (/mnt/home/wibkingb/test/athenapk/external/Kokkos/bin/kokkos_launch_compiler) is enabled...
I think this is the issue. I can't reproduce it, though, so I don't know how to fix it.
@BenWibking It is there
@BenWibking Ohk problem is solved, I don't know why it took me so long to solve it. But the indexing engine was using clangd. I switch to g++ and now there are no errors.
Please close this once you acknowledge this comment.
Also code works fine, this is some IDE problem.
Getting this error in <mesh/mesh.hpp> of kh.cpp file.
File
external/Kokkos/core/src/setup/Kokkos_Setup_Cuda.hpp
I have also tried
-D__CUDACC__=external/Kokkos/bin/nvcc_wrapper
, but still same error. Though code works fine and compiles without any error but it complains (false positive messages) in the code editor while working with the codebase.