diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b537a3650..518eb18ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#547 - NSG build failed using GPU-edition if set gpu_enable false - \#552 - Server down during building index_type: IVF_PQ using GPU-edition - \#561 - Milvus server should report exception/error message or terminate on mysql metadata backend error +- \#579 - Build index hang in GPU version when gpu_resources disabled - \#599 - Build index log is incorrect - \#602 - Optimizer specify wrong gpu_id - \#606 - No log generated during building index with CPU diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 67769717c4..e2099739ed 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -1033,11 +1033,7 @@ DBImpl::BuildTableIndexRecursively(const std::string& table_id, const TableIndex if (!failed_files.empty()) { std::string msg = "Failed to build index for " + std::to_string(failed_files.size()) + ((failed_files.size() == 1) ? " file" : " files"); -#ifdef MILVUS_GPU_VERSION - msg += ", file size is too large or gpu memory is not enough."; -#else msg += ", please double check index parameters."; -#endif return Status(DB_ERROR, msg); } diff --git a/core/src/db/engine/ExecutionEngineImpl.cpp b/core/src/db/engine/ExecutionEngineImpl.cpp index 00bc548c06..70f2d6ef2d 100644 --- a/core/src/db/engine/ExecutionEngineImpl.cpp +++ b/core/src/db/engine/ExecutionEngineImpl.cpp @@ -86,6 +86,11 @@ ExecutionEngineImpl::ExecutionEngineImpl(VecIndexPtr index, const std::string& l VecIndexPtr ExecutionEngineImpl::CreatetVecIndex(EngineType type) { +#ifdef MILVUS_GPU_VERSION + server::Config& config = server::Config::GetInstance(); + bool gpu_resource_enable = true; + config.GetGpuResourceConfigEnable(gpu_resource_enable); +#endif std::shared_ptr index; switch (type) { case EngineType::FAISS_IDMAP: { @@ -94,18 +99,20 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) { } case EngineType::FAISS_IVFFLAT: { #ifdef MILVUS_GPU_VERSION - index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_MIX); -#else - index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_CPU); + if (gpu_resource_enable) + index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_MIX); + else #endif + index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_CPU); break; } case EngineType::FAISS_IVFSQ8: { #ifdef MILVUS_GPU_VERSION - index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_MIX); -#else - index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_CPU); + if (gpu_resource_enable) + index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_MIX); + else #endif + index = GetVecIndexFactory(IndexType::FAISS_IVFSQ8_CPU); break; } case EngineType::NSG_MIX: { @@ -120,10 +127,11 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) { #endif case EngineType::FAISS_PQ: { #ifdef MILVUS_GPU_VERSION - index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_MIX); -#else - index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_CPU); + if (gpu_resource_enable) + index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_MIX); + else #endif + index = GetVecIndexFactory(IndexType::FAISS_IVFPQ_CPU); break; } case EngineType::SPTAG_KDT: {