Skip to content

Commit 71f2828

Browse files
authored
Fix destruction of reused GPU tensors (triton-inference-server#77)
1 parent 47a765c commit 71f2828

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pb_tensor.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ PbTensor::LoadFromSharedMemory(
309309

310310
cudaError_t err = cudaIpcOpenMemHandle(
311311
(void**)&data, *cuda_ipc_mem_handle, cudaIpcMemLazyEnablePeerAccess);
312+
312313
if (err != cudaSuccess) {
313314
throw PythonBackendException(std::string(
314315
"failed to open cuda ipc handle: " +
@@ -324,6 +325,7 @@ PbTensor::LoadFromSharedMemory(
324325
tensor_shm->dtype, raw_data->memory_type, raw_data->memory_type_id,
325326
data, raw_data->byte_size, nullptr /* DLManaged Tensor */);
326327
pb_tensor->cuda_ipc_mem_handle_ = cuda_ipc_mem_handle;
328+
pb_tensor->destruct_cuda_ipc_mem_handle_ = true;
327329
} else {
328330
pb_tensor = std::make_shared<PbTensor>(
329331
name, std::vector<int64_t>(dims, dims + dims_count),

0 commit comments

Comments
 (0)