Skip to content

Commit fd7a555

Browse files
committed
skip gpu init for sn
Signed-off-by: xianliang.li <[email protected]>
1 parent 947c885 commit fd7a555

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

internal/util/initcore/query_node.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
"github.com/milvus-io/milvus/pkg/v2/log"
4444
"github.com/milvus-io/milvus/pkg/v2/util/hardware"
4545
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
46+
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
4647
)
4748

4849
var initQueryNodeOnce sync.Once
@@ -122,9 +123,11 @@ func doInitQueryNodeOnce(ctx context.Context) error {
122123
cGrowingJSONKeyStatsEnabled := C.bool(paramtable.Get().CommonCfg.EnabledGrowingSegmentJSONKeyStats.GetAsBool())
123124
C.SetDefaultGrowingJSONKeyStatsEnable(cGrowingJSONKeyStatsEnabled)
124125

125-
cGpuMemoryPoolInitSize := C.uint32_t(paramtable.Get().GpuConfig.InitSize.GetAsUint32())
126-
cGpuMemoryPoolMaxSize := C.uint32_t(paramtable.Get().GpuConfig.MaxSize.GetAsUint32())
127-
C.SegcoreSetKnowhereGpuMemoryPoolSize(cGpuMemoryPoolInitSize, cGpuMemoryPoolMaxSize)
126+
if paramtable.GetRole() != typeutil.StreamingNodeRole {
127+
cGpuMemoryPoolInitSize := C.uint32_t(paramtable.Get().GpuConfig.InitSize.GetAsUint32())
128+
cGpuMemoryPoolMaxSize := C.uint32_t(paramtable.Get().GpuConfig.MaxSize.GetAsUint32())
129+
C.SegcoreSetKnowhereGpuMemoryPoolSize(cGpuMemoryPoolInitSize, cGpuMemoryPoolMaxSize)
130+
}
128131

129132
cEnableConfigParamTypeCheck := C.bool(paramtable.Get().CommonCfg.EnableConfigParamTypeCheck.GetAsBool())
130133
C.SetDefaultConfigParamTypeCheck(cEnableConfigParamTypeCheck)

0 commit comments

Comments
 (0)