提交 b9967384 authored 作者: Frederic's avatar Frederic

make lib.cnmem=1 work more frequently

上级 a4bc6622
...@@ -3213,9 +3213,10 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args) ...@@ -3213,9 +3213,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.5% to let memory for the driver. // Clip to 98% to let memory for the driver.
if (cnmem > .985){ // 98.5% didn't worked in some cases.
cnmem = .985; if (cnmem > .98){
cnmem = .98;
} }
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论