From 1dee4eae03db6c6ab028b2a37af07a9c6f0bb226 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期一, 23 十二月 2019 16:21:35 +0800
Subject: [PATCH] update;

---
 main.go            |    8 --------
 app/slave/slave.go |   10 ++++++++++
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/app/slave/slave.go b/app/slave/slave.go
index 6c77ec2..bb084fc 100644
--- a/app/slave/slave.go
+++ b/app/slave/slave.go
@@ -6,6 +6,8 @@
 	"analysis/util"
 	"context"
 	"plugin"
+
+	"basic.com/valib/gogpu.git"
 )
 
 // TwoPluginConflict test
@@ -39,6 +41,14 @@
 		return false
 	}
 
+	// 閰嶇疆鏂囦欢璁剧疆浜唃pu memory涓斿�艰嚦灏戜袱浣嶆暟,鍒ゆ柇鏄惁鏈塯pu鍙敤
+	if v, ok := cfg.Param["gpu-memory"]; ok && len(v) > 1 {
+		indices := gogpu.RankGPU()
+		if len(indices) == 0 {
+			logo.Errorln("!!!!!!THERE IS NO VALID GPU")
+			return false
+		}
+	}
 	// func Create(config string, typ, id string, gpu int, shm bool, ipc2Rule string, ruleMaxSize int, fn func(...interface{}), reserved map[string]string) interface{}
 	// func Run(ctx context.Context, i interface{}) {
 
diff --git a/main.go b/main.go
index ae5150e..861e5a9 100644
--- a/main.go
+++ b/main.go
@@ -14,8 +14,6 @@
 	"flag"
 
 	"os"
-
-	"basic.com/valib/gogpu.git"
 	// "net/http"
 	// _ "net/http/pprof"
 )
@@ -89,12 +87,6 @@
 }
 
 func main() {
-
-	indices := gogpu.RankGPU()
-	if len(indices) == 0 {
-		logo.Errorln("there is no gpu for valid")
-		return
-	}
 
 	util.InitConfig()
 

--
Gitblit v1.8.0