fix crash when creating a GPU IVF index (#5097)

Signed-off-by: shengjun.li <shengjun.li@zilliz.com>
pull/5099/head
shengjun.li 2021-04-30 11:01:18 +08:00 committed by GitHub
parent 638da8594f
commit c19290b1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Please mark all change in change log and use the issue from GitHub
- \#5010 IVF_PQ failed to query on GPU if 'nbits' doesn't equal to 8
- \#5050 Index type returned by get_collection_stats() is incorrect
- \#5063 Empty segment is serialized and crash milvus
- \#5078 Server crashed when creaing a GPU IVF index whose dimension is 2048/4086/8192
## Feature
- \#4564 Allow get_entity_by_id() in a specified partition

View File

@ -65,6 +65,10 @@ StackDeviceMemory::Stack::getSizeAvailable() const {
char*
StackDeviceMemory::Stack::getAlloc(size_t size,
cudaStream_t stream) {
if (size == 0) {
return nullptr;
}
if (size > (end_ - head_)) {
// Too large for our stack
DeviceScope s(device_);
@ -133,6 +137,10 @@ void
StackDeviceMemory::Stack::returnAlloc(char* p,
size_t size,
cudaStream_t stream) {
if (size == 0) {
return;
}
if (p < start_ || p >= end_) {
// This is not on our stack; it was a one-off allocation
DeviceScope s(device_);