Skip to content

Commit

Permalink
Fix for OOM when CUB succeeds to free cache and reallocate
Browse files Browse the repository at this point in the history
  • Loading branch information
drnikolaev committed May 25, 2016
1 parent 19492ba commit 2dfb3e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/caffe/util/gpu_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ void GPUMemoryManager::allocate(void** ptr, size_t size, cudaStream_t stream) {
}
// Retry once
CUDA_CHECK(cub_allocator->DeviceAllocate(ptr, size, stream));
// If retry succeeds we need to clean up last error
cudaGetLastError();
}
// If retry succeeds we need to clean up last error
cudaGetLastError();
break;
default:
CUDA_CHECK(cudaMalloc(ptr, size));
Expand Down

0 comments on commit 2dfb3e7

Please sign in to comment.