Skip to content

Commit

Permalink
FindcuFile now searches in the current CUDA Toolkit location (#11101)
Browse files Browse the repository at this point in the history
We shouldn't presume that the CUDA Toolkit is always installed at /usr/local/cuda. Instead we use use `find_package(CUDAToolkit)` to find the correct location.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #11101
  • Loading branch information
robertmaynard authored Jun 16, 2022
1 parent 0f77adc commit ac2d9a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpp/cmake/Modules/FindcuFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,24 @@ pkg_check_modules(PKG_cuFile QUIET cuFile)
set(cuFile_COMPILE_OPTIONS ${PKG_cuFile_CFLAGS_OTHER})
set(cuFile_VERSION ${PKG_cuFile_VERSION})

# Find the location of the CUDA Toolkit
find_package(CUDAToolkit QUIET)
find_path(
cuFile_INCLUDE_DIR
NAMES cufile.h
HINTS ${PKG_cuFile_INCLUDE_DIRS} /usr/local/cuda/include /usr/local/cuda/lib64
HINTS ${PKG_cuFile_INCLUDE_DIRS} ${CUDAToolkit_INCLUDE_DIRS}
)

find_library(
cuFile_LIBRARY
NAMES cufile
HINTS ${PKG_cuFile_LIBRARY_DIRS} /usr/local/cuda/lib64
HINTS ${PKG_cuFile_LIBRARY_DIRS} ${CUDAToolkit_LIBRARY_DIR}
)

find_library(
cuFileRDMA_LIBRARY
NAMES cufile_rdma
HINTS ${PKG_cuFile_LIBRARY_DIRS} /usr/local/cuda/lib64
HINTS ${PKG_cuFile_LIBRARY_DIRS} ${CUDAToolkit_LIBRARY_DIR}
)

include(FindPackageHandleStandardArgs)
Expand Down

0 comments on commit ac2d9a6

Please sign in to comment.