From 83bce35e8c24de86716754b55ccf1b5bc0afa3a5 Mon Sep 17 00:00:00 2001 From: zhiru Date: Thu, 13 Jun 2019 13:20:06 +0800 Subject: [PATCH] fix faiss ptx issue; change cuda gencode Former-commit-id: e45b7ae6b90cc3cdbf56dd30a8e9a674a03d0028 --- cpp/CHANGELOG.md | 1 + cpp/CMakeLists.txt | 27 --------------------------- cpp/cmake/DefineOptions.cmake | 4 ++-- cpp/cmake/ThirdPartyPackages.cmake | 10 +++++++++- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index 87fd3ee2f3..bef16a212d 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -23,6 +23,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-65 - Implement GetTableRowCount interface - MS-45 - Implement DeleteTable interface - MS-75 - cmake: change faiss version to 1.5.2; add CUDA gencode +- MS-81 - fix faiss ptx issue; change cuda gencode ## Task - MS-74 - Change README.md in cpp diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 194fdf7e1e..028b602056 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -44,33 +44,6 @@ if("${MAKE}" STREQUAL "") endif() endif() -set(GCC_VERSION 5.3.0) -set(GCC_DIR "${CMAKE_CURRENT_BINARY_DIR}/gcc") -set(GCC_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/gcc/gcc_build") -set(GCC_TAR_NAME "${GCC_BUILD_DIR}/gcc-${GCC_VERSION}.tar.gz") -if (NOT EXISTS ${GCC_TAR_NAME}) - file(MAKE_DIRECTORY ${GCC_BUILD_DIR}) - file(DOWNLOAD http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-${GCC_VERSION}/${GCC_TAR_NAME} - ${GCC_TAR_NAME}) - message(STATUS "Building GCC-${GCC_VERSION} from source") - execute_process( - COMMAND - "${CMAKE_COMMAND} -E tar -xf ${GCC_TAR_NAME}" - COMMAND - "./configure --prefix=${GCC_DIR} --with-local-prefix=${GCC_DIR} - --enable-languages=cxx,fortran - --enable-checking=release - --disable-bootstrap" - COMMAND - "${MAKE} -j4" - COMMAND - "${MAKE} install" - RESULT_VARIABLE _status - #OUTPUT_QUIET - #ERROR_QUIET - WORKING_DIRECTORY ${GCC_BUILD_DIR}) -endif () - set(MEGASEARCH_VERSION_MAJOR "${megasearch_VERSION_MAJOR}") set(MEGASEARCH_VERSION_MINOR "${megasearch_VERSION_MINOR}") set(MEGASEARCH_VERSION_PATCH "${megasearch_VERSION_PATCH}") diff --git a/cpp/cmake/DefineOptions.cmake b/cpp/cmake/DefineOptions.cmake index 340e72d847..538e54fe3b 100644 --- a/cpp/cmake/DefineOptions.cmake +++ b/cpp/cmake/DefineOptions.cmake @@ -70,8 +70,8 @@ define_option(MEGASEARCH_WITH_FAISS "Build with FAISS library" ON) define_option(MEGASEARCH_WITH_FAISS_GPU_VERSION "Build with FAISS GPU version" ON) -define_option_string(MEGASEARCH_FAISS_GPU_ARCH "Specifying which GPU architectures to build against" - "-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61") +#define_option_string(MEGASEARCH_FAISS_GPU_ARCH "Specifying which GPU architectures to build against" +# "-gencode=arch=compute_35,code=compute_35 -gencode=arch=compute_52,code=compute_52 -gencode=arch=compute_60,code=compute_60 -gencode=arch=compute_61,code=compute_61") define_option(MEGASEARCH_WITH_LAPACK "Build with LAPACK library" ON) diff --git a/cpp/cmake/ThirdPartyPackages.cmake b/cpp/cmake/ThirdPartyPackages.cmake index bdb573ca7d..ca84bca7b0 100644 --- a/cpp/cmake/ThirdPartyPackages.cmake +++ b/cpp/cmake/ThirdPartyPackages.cmake @@ -686,7 +686,15 @@ macro(build_faiss) if(${MEGASEARCH_WITH_FAISS_GPU_VERSION} STREQUAL "ON") set(FAISS_CONFIGURE_ARGS ${FAISS_CONFIGURE_ARGS} "--with-cuda=${CUDA_TOOLKIT_ROOT_DIR}" - "--with-cuda-arch=${MEGASEARCH_FAISS_GPU_ARCH}") +# "with_cuda_arch=\"-gencode=arch=compute_35,code=compute_35 \\ +# -gencode=arch=compute_52,code=compute_52 \\ +# -gencode=arch=compute_60,code=compute_60 \\ +# -gencode=arch=compute_61,code=compute_61\"" + "--with-cuda-arch=\"-gencode=arch=compute_35,code=compute_35\"" + "--with-cuda-arch=\"-gencode=arch=compute_52,code=compute_52\"" + "--with-cuda-arch=\"-gencode=arch=compute_60,code=compute_60\"" + "--with-cuda-arch=\"-gencode=arch=compute_61,code=compute_61\"" + ) else() set(FAISS_CONFIGURE_ARGS ${FAISS_CONFIGURE_ARGS} --without-cuda) endif()