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

chore: allow building simsearch along with tensorrt + disable python in faiss #1367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ if (NOT CUDA_FOUND)
endif()

# annoy
if (USE_CAFFE OR USE_TORCH)
if (USE_CAFFE OR USE_TORCH OR USE_TENSORRT)
if (USE_SIMSEARCH)
if (USE_FAISS AND USE_ANNOY)
message (STATUS "ANNOY selected, using ANNOY as simsearch backend")
Expand Down Expand Up @@ -326,9 +326,9 @@ if (USE_CAFFE OR USE_TORCH)
endif()
if(USE_FAISS)
if (USE_FAISS_CPU_ONLY)
set(CONFIGURE_OPTS "-DFAISS_ENABLE_GPU=OFF" "-DBUILD_TESTING=OFF")
set(CONFIGURE_OPTS "-DFAISS_ENABLE_GPU=OFF" "-DBUILD_TESTING=OFF" "-DFAISS_ENABLE_PYTHON=OFF")
else()
set(CONFIGURE_OPTS "-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc" "-DBUILD_TESTING=OFF")
set(CONFIGURE_OPTS "-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc" "-DBUILD_TESTING=OFF" "-DFAISS_ENABLE_PYTHON=OFF")
endif()
message(STATUS "Fetching FAISS")
add_definitions(-DUSE_FAISS)
Expand All @@ -349,7 +349,7 @@ if (USE_CAFFE OR USE_TORCH)
set(FAISS_INCLUDE_DIR ${CMAKE_BINARY_DIR}/faiss/src/faiss)
include_directories("${FAISS_INCLUDE_DIR}")
set(FAISS_LIB_DIR ${CMAKE_BINARY_DIR}/faiss/src/faiss/build/faiss)
set(FAISS_LIB_DEPS openblas faiss)
set(FAISS_LIB_DEPS openblas faiss lmdb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to #1369?

endif()
endif()
else()
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ gpu_build() {
"tf") extra_flags="$default_flags -DUSE_TF=ON" ;;
"caffe2") extra_flags="$default_flags -DUSE_CAFFE2=ON" ;;
"torch") extra_flags="$default_flags -DUSE_TORCH=ON" ;;
"tensorrt") extra_flags="-DUSE_TENSORRT=ON -DUSE_CAFFE=OFF" ;;
"tensorrt-cv4-cuda") extra_flags="-DUSE_TENSORRT=ON -DUSE_CAFFE=OFF -DUSE_CUDA_CV=ON -DUSE_OPENCV_VERSION=4 -DOpenCV_DIR=${DEEPDETECT_OPENCV4_BUILD_PATH}";;
"tensorrt") extra_flags="-DUSE_SIMSEARCH=ON -DUSE_TENSORRT=ON -DUSE_CAFFE=OFF" ;;
"tensorrt-cv4-cuda") extra_flags="-DUSE_SIMSEARCH=ON -DUSE_TENSORRT=ON -DUSE_CAFFE=OFF -DUSE_CUDA_CV=ON -DUSE_OPENCV_VERSION=4 -DOpenCV_DIR=${DEEPDETECT_OPENCV4_BUILD_PATH}";;
*) extra_flags="$default_flags";;
esac
cmake .. $extra_flags -DCUDA_ARCH="${DEEPDETECT_CUDA_ARCH} -DRELEASE=${DEEPDETECT_RELEASE}"
Expand Down