ECP-copa / CabanaMD

Molecular dynamics proxy application based on Cabana
Other
19 stars 13 forks source link

Problems with CUDA device #102

Open XzzX opened 3 years ago

XzzX commented 3 years ago

I tried to run the provided LJ example on a GPU:

./cbnMD -il in.lj --device-type CUDA

The job crashed with the following error message:

Kokkos::Cuda::initialize WARNING: Cuda is allocating into UVMSpace by default
                                  without setting CUDA_LAUNCH_BLOCKING=1.
                                  The code must call Cuda().fence() after each kernel
                                  or will likely crash when accessing data on the host.
terminate called after throwing an instance of 'std::runtime_error'
  what():  cudaDeviceSynchronize() error( cudaErrorIllegalAddress): an illegal memory access was encountered /.../kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp:144
Traceback functionality not available

What did I do wrong?

streeve commented 3 years ago

Sorry I missed responding to this.

Can you post a full stack trace and how you configured Kokkos/Cabana? This is likely a bug, but I've never encountered it.

XzzX commented 3 years ago

I did a standard installation without custom configuration. Kokkos: I enabled the stuff related to Cuda and architecture AMPERE80. Cabana: cmake -S CabanaMD -B build -DCabanaMD_LAYOUT=X -DCabanaMD_VECTORLENGTH=Y with different layouts and vector length. The stacktrace is not very helpful since this is a release build. I only have hex adresses. I will try a debug build.

XzzX commented 3 years ago

Here is the stack trace:

/.../kokkos/core/src/impl/Kokkos_Error.cpp:69
/.../gcc/10.2.0/include/c++/10.2.0/bits/basic_string.h:187
/.../gcc/10.2.0/include/c++/10.2.0/bits/stl_tree.h:287
/.../CabanaMD-build/_deps/cabana-src/core/src/Cabana_LinkedCellList.hpp:303
/.../CabanaMD-build/_deps/cabana-src/core/src/Cabana_LinkedCellList.hpp:81 (discriminator 2)
/.../CabanaMD-build/_deps/cabana-src/core/src/Cabana_VerletList.hpp:271 (discriminator 2)
/.../CabanaMD-build/_deps/cabana-src/core/src/Cabana_VerletList.hpp:751
/.../CabanaMD-build/_deps/cabana-src/core/src/Cabana_VerletList.hpp:727 (discriminator 2)
/.../CabanaMD-build/_deps/cabana-src/core/src/Cabana_VerletList.hpp:710
/.../CabanaMD/src/neighbor_types/neighbor_verlet.h:55
/.../CabanaMD/src/cabanamd_impl.h:314
/.../CabanaMD/bin/main.cpp:67