This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bd2ddae9fc [bugfix] fix doris build failure because of no cuda 
support scene, and add FAISS_ENABLE_GPU switch to enable it or not by user, 
default value as OFF (#62133)
7bd2ddae9fc is described below

commit 7bd2ddae9fc0e0b220c3fe30fd7325dc5269852b
Author: heguanhui <[email protected]>
AuthorDate: Wed Apr 8 10:58:19 2026 +0800

    [bugfix] fix doris build failure because of no cuda support scene, and add 
FAISS_ENABLE_GPU switch to enable it or not by user, default value as OFF 
(#62133)
    
    fix doris build failure because of no cuda support scene, and add
    FAISS_ENABLE_GPU switch to enable it or not by user, default value as
    OFF
---
 be/src/storage/index/ann/cmake-protect/CMakeLists.txt | 6 +++---
 build.sh                                              | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/be/src/storage/index/ann/cmake-protect/CMakeLists.txt 
b/be/src/storage/index/ann/cmake-protect/CMakeLists.txt
index 4aa219ee3ad..0c65e4ae170 100644
--- a/be/src/storage/index/ann/cmake-protect/CMakeLists.txt
+++ b/be/src/storage/index/ann/cmake-protect/CMakeLists.txt
@@ -42,13 +42,13 @@ else()
         set(DYNAMIC_ARCH ON CACHE BOOL "Enable runtime CPU detection in 
OpenBLAS")
     endif ()
 endif ()
-
+# Set FAISS_ENABLE_GPU OFF before including FAISS to prevent CUDA language 
detection
+set(FAISS_ENABLE_GPU OFF CACHE BOOL "Enable GPU support in FAISS")
 # EXCLUDE_FROM_ALL so that binary in openblas is not installed.
 add_subdirectory(${PROJECT_SOURCE_DIR}/../contrib/openblas 
${PROJECT_BINARY_DIR}/openblas EXCLUDE_FROM_ALL)
 
 set(OPENBLAS_LIBRARY "${PROJECT_BINARY_DIR}/openblas/lib/libopenblas.a" CACHE 
PATH "Path to OpenBLAS build directory")
 set(FAISS_ENABLE_MKL OFF CACHE BOOL "Disable MKL support in FAISS")
-set(FAISS_ENABLE_GPU OFF CACHE BOOL "Disable GPU support in FAISS")
 set(FAISS_ENABLE_PYTHON OFF CACHE BOOL "Disable Python support in FAISS")
 set(FAISS_ENABLE_EXTRAS OFF CACHE BOOL "Disable FAISS extras")
 set(BUILD_TESTING OFF CACHE BOOL "Disable FAISS testing")
@@ -63,4 +63,4 @@ else()
 endif()
 
 # EXCLUDE_FROM_ALL so that binary in faiss is not installed.
-add_subdirectory(${PROJECT_SOURCE_DIR}/../contrib/faiss 
${PROJECT_BINARY_DIR}/faiss EXCLUDE_FROM_ALL)
\ No newline at end of file
+add_subdirectory(${PROJECT_SOURCE_DIR}/../contrib/faiss 
${PROJECT_BINARY_DIR}/faiss EXCLUDE_FROM_ALL)
diff --git a/build.sh b/build.sh
index e1cb4f635a6..6f2d9028e94 100755
--- a/build.sh
+++ b/build.sh
@@ -720,6 +720,7 @@ if [[ "${BUILD_BE}" -eq 1 ]]; then
         -DBUILD_AZURE="${BUILD_AZURE}" \
         -DENABLE_DYNAMIC_ARCH="${ENABLE_DYNAMIC_ARCH}" \
         -DWITH_TDE_DIR="${WITH_TDE_DIR}" \
+        -DFAISS_ENABLE_GPU="${FAISS_ENABLE_GPU:-OFF}" \
         "${DORIS_HOME}/be"
 
     if [[ "${OUTPUT_BE_BINARY}" -eq 1 ]]; then


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to