From b2f8d4183df1e3129f6dbe822cb02ad418716cda Mon Sep 17 00:00:00 2001 From: peizhilin Date: Mon, 26 Nov 2018 11:55:19 +0800 Subject: [PATCH] Given the different fraction_of_gpu_memory_to_use depends on platform --- paddle/fluid/platform/gpu_info.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/platform/gpu_info.cc b/paddle/fluid/platform/gpu_info.cc index e0d0051ad..9d8a11a11 100644 --- a/paddle/fluid/platform/gpu_info.cc +++ b/paddle/fluid/platform/gpu_info.cc @@ -19,10 +19,16 @@ limitations under the License. */ #include "gflags/gflags.h" #include "paddle/fluid/platform/enforce.h" +#ifndef _WIN32 +const float fraction_of_gpu_memory_to_use = 0.92f; +#else // fraction_of_gpu_memory_to_use cannot be too high on windows, // since the win32 graphic sub-system can occupy some GPU memory // which may lead to insufficient memory left for paddle -DEFINE_double(fraction_of_gpu_memory_to_use, 0.5, +const float fraction_of_gpu_memory_to_use = 0.5f; +#endif + +DEFINE_double(fraction_of_gpu_memory_to_use, fraction_of_gpu_memory_to_use, "Allocate a trunk of gpu memory that is this fraction of the " "total gpu memory size. Future memory usage will be allocated " "from the trunk. If the trunk doesn't have enough gpu memory, " -- GitLab