-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvcc link failure with Kokkos_ENABLE_LIBDL and glibc >= 2.34 #4824
Comments
Does this problem go away with the latest cmake? This looks like something cmake should fix, but we can try and add a workaround. |
Note turning LIBDL off the way you did will disable the ability to load profiling tools during runtime. |
This has been with cmake-3.22.2 |
We disabled LIBDL in PETSc as a workaround. I don't know if it's relevant to our users. https://gitlab.com/petsc/petsc/-/merge_requests/4890 |
Generally the profiling tools are pretty relevant for downstream users, because it allows proper kernel names like KokkosKernels::gemv etc. to show up inside of the major third party profiling tools like Tau, VTune and Nsight Compute. But its probably an acceptable short term solution for you. We are looking into how to put a workaround in on our side. |
Perhaps just check if the symbols are available despite not explicitly linking libdl? |
What about this? diff --git a/cmake/kokkos_tpls.cmake b/cmake/kokkos_tpls.cmake
index 54c6b520b..4dfdb6457 100644
--- a/cmake/kokkos_tpls.cmake
+++ b/cmake/kokkos_tpls.cmake
@@ -77,7 +77,7 @@ ENDIF()
KOKKOS_IMPORT_TPL(HWLOC)
KOKKOS_IMPORT_TPL(LIBNUMA)
KOKKOS_IMPORT_TPL(LIBRT)
-KOKKOS_IMPORT_TPL(LIBDL)
+#KOKKOS_IMPORT_TPL(LIBDL)
KOKKOS_IMPORT_TPL(MEMKIND)
IF (NOT WIN32)
KOKKOS_IMPORT_TPL(THREADS INTERFACE)
diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt
index 88cca93f3..9c5db5994 100644
--- a/core/src/CMakeLists.txt
+++ b/core/src/CMakeLists.txt
@@ -95,7 +95,7 @@ IF (NOT KOKKOS_ENABLE_COMPILE_AS_CMAKE_LANGUAGE)
KOKKOS_LINK_TPL(kokkoscore PUBLIC CUDA)
ENDIF()
KOKKOS_LINK_TPL(kokkoscore PUBLIC HPX)
-KOKKOS_LINK_TPL(kokkoscore PUBLIC LIBDL)
+#KOKKOS_LINK_TPL(kokkoscore PUBLIC LIBDL)
KOKKOS_LINK_TPL(kokkoscore PUBLIC LIBRT)
# On *nix-like systems (Linux, macOS) we need pthread for C++ std::thread
IF (NOT WIN32)
@@ -111,6 +111,8 @@ IF (KOKKOS_ENABLE_IMPL_DESUL_ATOMICS AND
(KOKKOS_ENABLE_OPENMPTARGET OR (CMAKE_CXX_COMPILER_ID STREQUAL XLClang)))
target_link_libraries(kokkoscore PUBLIC atomic)
ENDIF()
-
+IF (KOKKOS_ENABLE_LIBDL)
+ target_link_libraries(kokkoscore PUBLIC ${CMAKE_DL_LIBS})
+ENDIF()
KOKKOS_LINK_TPL(kokkoscore PUBLIC LIBQUADMATH) |
The potential issue with your suggestion is we lose the |
Discuss and assign on Wednesday |
Thx @masterleinad |
Profiling is useful for us and downstream users and we should turn it on when possible The Kokkos issue raised at kokkos/kokkos#4824 seems to have been fixed by kokkos/kokkos#5179 This MR effectively reverts !4890
Glibc 2.34 integrated libdl into libc. The residual
/usr/bin/libdl.a
is a text stubgcc knows how to handle this just fine, but nvcc does not.
This results in link failures unless configuring
-DKokkos_ENABLE_LIBDL=OFF
. Maybe this can be turned off by default or use-ldl
instead of CMake's explicit/usr/lib/libdl.a
.The text was updated successfully, but these errors were encountered: