提交 2767204e authored 作者: Frederic Bastien's avatar Frederic Bastien

cnmem=1, default to 0.95 as otherwise, there is problems by default. It will…

cnmem=1, default to 0.95 as otherwise, there is problems by default. It will make smaller extra alloc by default if needed. We do this if cnmem > 0.99 to prevent rounding problems and allow user to start as the old way.
上级 61e7d5a3
...@@ -3244,10 +3244,10 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args) ...@@ -3244,10 +3244,10 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args)
if (cnmem > 1) if (cnmem > 1)
mem = cnmem * 1024 * 1024; mem = cnmem * 1024 * 1024;
else{ else{
// Clip to 98% to let memory for the driver. // Clip to 95% to let memory for the driver.
// 98.5% didn't worked in some cases. // 98% didn't worked in some cases.
if (cnmem > .98){ if (cnmem > .99){
cnmem = .98; cnmem = .95;
} }
size_t free = 0, total = 0; size_t free = 0, total = 0;
cudaError_t err = cudaMemGetInfo(&free, &total); cudaError_t err = cudaMemGetInfo(&free, &total);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论