Skip to content
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

Fix FindNVTX.cmake #3421

Merged
merged 4 commits into from Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -229,7 +229,7 @@ endif()
if(HOROVOD_GPU_ALLREDUCE STREQUAL "D")
message(DEPRECATION "DDL backend has been deprecated. Please, start using the NCCL backend by building Horovod with "
"'HOROVOD_GPU_OPERATIONS=NCCL'. Will be removed in v0.21.0.")
list(APPEND LINKER_LIBS "${CUDAToolkit_LIBRARY_ROOT}/lib/libddl.so" "${CUDAToolkit_LIBRARY_ROOT}/lib/libddl_pack.so")
list(APPEND LINKER_LIBS "${CUDAToolkit_LIBRARY_DIR}/libddl.so" "${CUDAToolkit_LIBRARY_DIR}/libddl_pack.so")
list(APPEND SOURCES "${PROJECT_SOURCE_DIR}/horovod/common/mpi/ddl_mpi_context_manager.cc"
"${PROJECT_SOURCE_DIR}/horovod/common/ops/ddl_operations.cc")
add_definitions(-DHAVE_DDL=1)
Expand Down
6 changes: 3 additions & 3 deletions cmake/Modules/FindNCCL.cmake
Expand Up @@ -11,7 +11,7 @@
# NCCL_LIBRARIES
# NCCL_MAJOR_VERSION
#
# The path hints include CUDAToolkit_LIBRARY_ROOT seeing as some folks
# The path hints include CUDAToolkit_* seeing as some folks
# install NCCL in the same location as the CUDA toolkit.

set(HOROVOD_NCCL_HOME $ENV{HOROVOD_NCCL_HOME} CACHE PATH "Folder contains NVIDIA NCCL")
Expand All @@ -24,7 +24,7 @@ list(APPEND CMAKE_PREFIX_PATH ${NCCL_ROOT})

find_path(NCCL_INCLUDE_DIR
NAMES nccl.h
HINTS ${HOROVOD_NCCL_INCLUDE})
HINTS ${HOROVOD_NCCL_INCLUDE} ${CUDAToolkit_INCLUDE_DIRS})

set(HOROVOD_NCCL_LINK $ENV{HOROVOD_NCCL_LINK})
if (HOROVOD_NCCL_LINK STREQUAL "SHARED")
Expand All @@ -36,7 +36,7 @@ endif()

find_library(NCCL_LIBRARY
NAMES ${NCCL_LIBNAME}
HINTS ${HOROVOD_NCCL_LIB})
HINTS ${HOROVOD_NCCL_LIB} ${CUDAToolkit_LIBRARY_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIR NCCL_LIBRARY)
Expand Down
8 changes: 2 additions & 6 deletions cmake/Modules/FindNVTX.cmake
@@ -1,6 +1,6 @@
# Try to find NVTX
#
# NVTX comes with the CUDA toolkit so we use that root dir to search for the header-only variation of NVTX.
# NVTX comes with the CUDA toolkit so we use those include dirs to search for the header-only variation of NVTX.
# Alternatively an explicit path can be given via the variable HOROVOD_NVTX_INCLUDE
#
# The following are set after configuration is done:
Expand All @@ -10,13 +10,9 @@

set(HOROVOD_NVTX_INCLUDE $ENV{HOROVOD_NVTX_INCLUDE} CACHE PATH "Folder containing NVIDIA NVTX3 headers")

list(APPEND NVTX_ROOT ${CUDAToolkit_LIBRARY_ROOT})
# Compatible layer for CMake <3.12:
list(APPEND CMAKE_PREFIX_PATH ${NVTX_ROOT})

find_path(NVTX_INCLUDE_DIR
NAMES nvtx3/nvToolsExt.h
HINTS ${HOROVOD_NVTX_INCLUDE})
HINTS ${HOROVOD_NVTX_INCLUDE} ${CUDAToolkit_INCLUDE_DIRS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NVTX DEFAULT_MSG NVTX_INCLUDE_DIR)
Expand Down