From 4b8a72f9aee179733faf82fdfc73bc12564a1090 Mon Sep 17 00:00:00 2001 From: fishpenguin Date: Fri, 29 Nov 2019 11:38:27 +0800 Subject: [PATCH] NSG build failed using GPU-edition if set gpu_enable false --- CHANGELOG.md | 1 + .../index/knowhere/knowhere/index/vector_index/IndexNSG.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba7561c33..12e7e01cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#533 - NSG build failed with MetricType Inner Product - \#543 - client raise exception in shards when search results is empty - \#545 - Avoid dead circle of build index thread when error occurs +- \#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 - \#599 - Build index log is incorrect diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp index 16c0b9172..9f00c82fd 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp @@ -117,7 +117,13 @@ NSG::Train(const DatasetPtr& dataset, const Config& config) { // TODO(linxj): dev IndexFactory, support more IndexType #ifdef MILVUS_GPU_VERSION + auto temp_resource = FaissGpuResourceMgr::GetInstance().GetRes(build_cfg->gpu_id); +#if temp_resource == nullptr + auto preprocess_index = std::make_shared(); +#else auto preprocess_index = std::make_shared(build_cfg->gpu_id); +#endif + #else auto preprocess_index = std::make_shared(); #endif -- GitLab