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 (#14444)
Browse files Browse the repository at this point in the history
  • Loading branch information
szha authored and nswamy committed Apr 5, 2019
1 parent c47d8c8 commit 09a4d64
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 09a4d64

Please sign in to comment.