Closed StaticObserver closed 9 months ago
Could you give a bit more details? Which hardware are you compiling on? Does it find the kokkos
/adios
libraries? Which branch are you using? How do you configure the code (the cmake
command)?
I'm compiling on a hpc with Intel Xeon ICX Platinum 8358 cpu. cmake command is the following: cmake ../ -B build -D pgen=weibel -D engine=pic -D output=ON -D precision=double -DKokkos_ENABLE_OPENMP=ON -DKokkos_ENABLE_CUDA=ON
the kokkos has already been compiled before with : cmake ../ -DCMAKE_CXX_COMPILER=/dssg/home/acct-tdlmzn/tdlmzn-yangyangcai/sources/kokkos/bin/nvcc_wrapper -DCMAKE_INSTALL_PREFIX=/dssg/home/acct-tdlmzn/tdlmzn-yangyangcai/Kokkos -DKokkos_ENABLE_OPENMP=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_CUDA_LDG_INTRINSIC=ON -DKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE=ON -DKokkos_ARCH_AMPERE80=ON -DKokkos_ARCH_NATIVE=ON
when configuring entity, the outputs are:
-- The CXX compiler identification is GNU 12.3.0 -- The C compiler identification is GNU 12.3.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /dssg/opt/icelake/linux-centos8-icelake/gcc-11.2.0/gcc-12.3.0-4kizoqayd6dyg5awzjbl7nv24d6ixrji/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /dssg/opt/icelake/linux-centos8-icelake/gcc-11.2.0/gcc-12.3.0-4kizoqayd6dyg5awzjbl7nv24d6ixrji/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Release mode connect: Network is unreachable -- No internet connection. Fetching disabled. -- kokkos_launch_compiler is enabled globally. C++ compiler commands with -DKOKKOS_DEPENDENCE will be redirected to the appropriate compiler for Kokkos -- Kokkos found. -- fmt not found. Using as submodule. -- Version: 10.2.0 -- Build type: -- plog not found. Using as submodule. -- toml11 not found. Using as submodule. -- adios2 found. -- CUDA compiler: /dssg/opt/icelake/linux-centos8-icelake/gcc-11.2.0/cuda-12.1.1-xkp7tw76f32u7vlt3o2sbotrsxwnvrkn/bin/nvcc
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . /\ _ /\ \ . . \ \ \/_\ \ \ . . / \ / \ \ \/\/\ \ \ \/ /\ \/\ \ . . /\ //\ \/\ \ \ _\ \ \ \ _\ \ _\ \ . . \ _\ _\ _\ _\ _\ _\ ____ \/\\ . . \/__/\//\//\// \/_/\/_/ \// \/_/ . . /_/ . . \// . . . . v0.9.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Main configurations [1]
Simulation engine [engine]: sandbox pic grpic
Metric [metric]: minkowski spherical qspherical
Problem generator [pgen]: debug/deposit dummy examples/inject langmuir magnetosphere reconnection turbulence weibel
External force [ext_force]: ON/OFF
Precision [precision]: single double
Output [output]: ON/OFF
GUI [gui]: ON/OFF
Compile configurations
CUDA [Kokkos_ENABLE_CUDA]: ON/OFF
OpenMP [Kokkos_ENABLE_OPENMP]: ON/OFF
C compiler [CMAKE_C_COMPILER]: /dssg/opt/icelake/linux-centos8-icelake/gcc-11.2.0/gcc-12.3.0-4kizoqayd6dyg5awzjbl7nv24d6ixrji/bin/gcc v12.3.0
C++ compiler [CMAKE_CXX_COMPILER]: /dssg/opt/icelake/linux-centos8-icelake/gcc-11.2.0/gcc-12.3.0-4kizoqayd6dyg5awzjbl7nv24d6ixrji/bin/g++ v12.3.0
CUDA compiler [CMAKE_CUDA_COMPILER]: /dssg/opt/icelake/linux-centos8-icelake/gcc-11.2.0/cuda-12.1.1-xkp7tw76f32u7vlt3o2sbotrsxwnvrkn/bin/nvcc v12.1
Debug mode [DEBUG]: ON/OFF
Dependencies
Kokkos: v4.2.0
ADIOS2: v2.9.2
Notes
[1] Set with cmake ... -D <FLAG>=<VALUE>
, the default value
: will be used unless the variable is explicitly set.
-- Configuring done (6.1s) -- Generating done (0.1s) -- Build files have been written to: /dssg/home/acct-tdlmzn/tdlmzn-yangyangcai/entity/weibel-test-gpu/build
gcc version is 12.3.0 cuda version is 12.1.0
I figured it out! It is the option -DKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE=ON I used on compiling Kokkos that's causing the problem. I don't know the reason behind, but when I remove the option, the code entity compiles well.
that is weird. what GPU are you compiling this for? you're using ampere80
, so i assume it's an A100?
a few notes:
../
to configure?
cmake ../ -B build -D pgen=weibel -D engine=pic -D output=ON -D precision=double -DKokkos_ENABLE_OPENMP=ON -DKokkos_ENABLE_CUDA=ON
i think it's not an issue, but it might mess up some of the paths. simply do (from the root) cmake -B build ...
, and then cmake --build build -j
.
you can use this tool to properly build/install kokkos
. at some point, i will also release a spack
module.
Kokkos_ENABLE_CUDA_LAMBDA
and Kokkos_ENABLE_CUDA_CONSTEXPR
are enabled by default in latest kokkos
.
RDC that you enabled in your kokkos
compilation is a way of embedding the host code around the device code (i think it determines the order in which the kernels are linked). are you sure it finds the right kokkos
? if it doesn't, it actually downloads and compiles kokkos
automatically. in general, if you're using a preinstalled kokkos
, i would specify the kokkos
path during configuration using cmake -B build ... -D Kokkos_DIR=/path/to/kokkos
.
I'am sure they found the kokkos I built in the system.
It is only the RDC option annoys your code. It would think there are mutiple definations of one function
On my own PC. l let cmake download the externs and compile all the dependencies for me, then everything works.
ok, sounds good. marking this as resolved. feel free to reopen if any follow-up is necessary.
Error occurs when building with GPU codes when only built with openmp, it works fine, also works for gpu on other computers, I don't get it
ibentity-framework.a(output_flds.cpp.o): In function >)'
libentity-framework.a(engines.cpp.o):tmpxft_001fd9e9_00000000-6_engines.cudafe1.cpp:(.text+0x16e4): first defined here
libentity-framework.a(fields.cpp.o): In function >)'
libentity-framework.a(engines.cpp.o):tmpxft_001fd9e9_00000000-6_engines.cudafe1.cpp:(.text+0x16e4): first defined here
libentity-framework.a(fields.cpp.o): In function `ntt::Fields<(ntt::Dimension)2, (ntt::SimulationEngine)2>::Fields(std::vector<unsigned int, std::allocator >)':
ntt::OutputField::initialize(ntt::SimulationEngine const&)': tmpxft_001fda24_00000000-6_output_flds.cudafe1.cpp:(.text+0x74): multiple definition of
ntt::OutputField::initialize(ntt::SimulationEngine const&)' libentity-framework.a(engines.cpp.o):tmpxft_001fd9e9_00000000-6_engines.cudafe1.cpp:(.text+0x92): first defined here libentity-framework.a(output_flds.cpp.o): In functionntt::OutputField::name[abi:cxx11](int const&) const': tmpxft_001fda24_00000000-6_output_flds.cudafe1.cpp:(.text+0x14c0): multiple definition of
ntt::OutputField::name[abi:cxx11](int const&) const' libentity-framework.a(engines.cpp.o):tmpxft_001fd9e9_00000000-6_engines.cudafe1.cpp:(.text+0x14de): first defined here libentity-framework.a(fields.cpp.o): In functionntt::Fields<(ntt::Dimension)1, (ntt::SimulationEngine)2>::Fields(std::vector<unsigned int, std::allocator<unsigned int> >)': tmpxft_001fd9b6_00000000-6_fields.cudafe1.cpp:(.text+0x92): multiple definition of
ntt::Fields<(ntt::Dimension)1, (ntt::SimulationEngine)2>::Fields(std::vector<unsigned int, std::allocatorntt::Fields<(ntt::Dimension)1, (ntt::SimulationEngine)2>::Fields(std::vector<unsigned int, std::allocator<unsigned int> >)': tmpxft_001fd9b6_00000000-6_fields.cudafe1.cpp:(.text+0x92): multiple definition of
ntt::Fields<(ntt::Dimension)1, (ntt::SimulationEngine)2>::Fields(std::vector<unsigned int, std::allocator