Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix OOM error during resource allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
szha committed Mar 15, 2019
1 parent 82504ad commit 3b1faa8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ void Resource::get_cudnn_dropout_desc(
// not initialized yet.
size_t dropout_state_size;
CUDNN_CALL(cudnnDropoutGetStatesSize(stream->dnn_handle_, &dropout_state_size));
// reserve GPU space
Storage::Get()->DirectFree(
Storage::Get()->Alloc(dropout_state_size, state_space->ctx));
CUDNN_CALL(cudnnSetDropoutDescriptor(*dropout_desc, stream->dnn_handle_,
dropout,
state_space->GetSpace(dropout_state_size),
Expand Down

0 comments on commit 3b1faa8

Please sign in to comment.