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

fix OOM error during resource allocation #14444

Merged
merged 1 commit into from
Mar 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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