From c0fece4c4978cde052889bfcb8e0561342596eca Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期日, 19 一月 2020 13:00:33 +0800
Subject: [PATCH] calculate gpu memory
---
csrc/common/gpu/info.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/csrc/common/gpu/info.cpp b/csrc/common/gpu/info.cpp
index d19de83..b633d5e 100644
--- a/csrc/common/gpu/info.cpp
+++ b/csrc/common/gpu/info.cpp
@@ -380,7 +380,7 @@
int mem_idle = need;
for(int i = 0; i < gpu_info.device_count; i++){
if (i != lastChoice){
- int mem_free = gpu_info.devices[i].memory_free >> 20;
+ int mem_free = (gpu_info.devices[i].memory_free >> 20) - reserved;
if(mem_free > mem_idle){
mem_idle = mem_free;
suitable_gpu = i;
--
Gitblit v1.8.0