Skip to content

Commit 07e30d3

Browse files
committed
Fix a segfaul introduced in 76e6109. sub_allocator is owned by gpu_bfc_allocator. deleting it early doesn't any real benefit. So lets the normal clean up do its work.
1 parent 36820c6 commit 07e30d3

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

tensorflow/core/common_runtime/gpu/gpu_process_state.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ Allocator* GPUProcessState::GetGPUAllocator(
206206
// If true, passes all allocation requests through to cudaMalloc
207207
// useful for doing memory debugging with tools like cuda-memcheck
208208
// **WARNING** probably will not work in a multi-gpu scenario
209-
delete gpu_bfc_allocator;
210-
delete sub_allocator;
211-
gpu_bfc_allocator = nullptr;
212-
sub_allocator = nullptr;
213209
gpu_allocator = new GPUcudaMallocAllocator(platform_device_id);
214210
} else if (UseCudaMallocAsyncAllocator() ||
215211
options.experimental().use_cuda_malloc_async()) {
@@ -219,10 +215,6 @@ Allocator* GPUProcessState::GetGPUAllocator(
219215
// TODO: useful for doing memory debugging with tools like
220216
// compute-sanitizer.
221217
// TODO: **WARNING** probably will not work in a multi-gpu scenario
222-
delete gpu_bfc_allocator;
223-
delete sub_allocator;
224-
gpu_bfc_allocator = nullptr;
225-
sub_allocator = nullptr;
226218
gpu_allocator =
227219
new GpuCudaMallocAsyncAllocator(platform_device_id, total_bytes);
228220
}

0 commit comments

Comments
 (0)