diff options
author | 2017-06-13 13:27:48 -0700 | |
---|---|---|
committer | 2017-06-13 13:32:06 -0700 | |
commit | 5c6015f89c3d500bb6d5f4145572aaaab3432bb1 (patch) | |
tree | 5c19d6ed59529e557ff081238bf6881b83ef3b6a | |
parent | 8eb015561b3a2f2e27f01617fd14d5a4f4b215bd (diff) |
Allocate 25 MiB less on GPUs with <2GB RAM, to avoid running
out of memory when launching kernels.
PiperOrigin-RevId: 158889089
-rw-r--r-- | tensorflow/core/common_runtime/gpu/gpu_device.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc index e787251e84..7eda5c90a1 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc @@ -598,13 +598,13 @@ namespace { int64 MinSystemMemory(int64 available_memory) { // We use the following heuristic for now: // - // If the available_memory is < 2GiB, we allocate 200MiB to system memory. + // If the available_memory is < 2GiB, we allocate 225MiB to system memory. // Otherwise, allocate max(300MiB, 0.05 * available_memory) to system memory. // // In the future we could be more sophisticated by using a table of devices. if (available_memory < (1LL << 31)) { - // 200MiB - return 209715200LL; + // 225MiB + return 225 * 1024 * 1024; } else { // max(300 MiB, 0.05 * available_memory) return std::max(314572800LL, static_cast<int64>(available_memory * 0.05)); |