Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Update cmake/upstream/FindCUDAToolkit.cmake (#18528)
Browse files Browse the repository at this point in the history
Previously MXNet includes a hotfix for a cross-compiling bug in upstream FindCUDAToolkit.cmake. Upstream has fixed the bug now in their master branch. Replace MXNet's fix by the upstream fix to avoid diverging from upstream.

See https://gitlab.kitware.com/cmake/cmake/-/issues/20572
  • Loading branch information
leezu authored Jun 18, 2020
1 parent 14aeb38 commit e96fbeb
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions cmake/upstream/FindCUDAToolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,15 @@ find_path(CUDAToolkit_INCLUDE_DIR
# And find the CUDA Runtime Library libcudart
find_library(CUDA_CUDART
NAMES cudart
PATH_SUFFIXES lib64 lib64/stubs lib/x64
PATH_SUFFIXES lib64 lib/x64
)
if (NOT CUDA_CUDART)
find_library(CUDA_CUDART
NAMES cudart
PATH_SUFFIXES lib64/stubs lib/x64/stubs
)
endif()

if (NOT CUDA_CUDART AND NOT CUDAToolkit_FIND_QUIETLY)
message(STATUS "Unable to find cudart library.")
endif()
Expand Down Expand Up @@ -788,9 +795,20 @@ if(CUDAToolkit_FOUND)
NAMES ${search_names}
HINTS ${CUDAToolkit_LIBRARY_DIR}
ENV CUDA_PATH
PATH_SUFFIXES nvidia/current lib64 lib64/stubs lib/x64 lib lib/stubs stubs
PATH_SUFFIXES nvidia/current lib64 lib/x64 lib
${arg_EXTRA_PATH_SUFFIXES}
)
# Don't try any stub directories intil we have exhausted all other
# search locations.
if(NOT CUDA_${lib_name}_LIBRARY)
find_library(CUDA_${lib_name}_LIBRARY
NAMES ${search_names}
HINTS ${CUDAToolkit_LIBRARY_DIR}
ENV CUDA_PATH
PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs
)
endif()

mark_as_advanced(CUDA_${lib_name}_LIBRARY)

if (NOT TARGET CUDA::${lib_name} AND CUDA_${lib_name}_LIBRARY)
Expand Down

0 comments on commit e96fbeb

Please sign in to comment.