From 9d9cd1d3b93613071d1dffc1c82c4515d2a65af6 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期二, 21 一月 2020 17:22:39 +0800 Subject: [PATCH] bug fixed change real fetcher ip --- app/slave/slave.go | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/slave/slave.go b/app/slave/slave.go index c3bc02e..d00d6e2 100644 --- a/app/slave/slave.go +++ b/app/slave/slave.go @@ -6,6 +6,7 @@ "analysis/util" "context" "plugin" + "strconv" "basic.com/valib/gogpu.git" ) @@ -17,7 +18,7 @@ logo.Errorln("Slave Read Config Error: ", err) return false } - sdk := loadSDK(cfg.SoFile) + sdk := LoadSDK(cfg.SoFile) if sdk == nil { } @@ -36,7 +37,7 @@ logo.Errorln("Slave Read Config Error: ", err) return false } - sdk := loadSDK(cfg.SoFile) + sdk := LoadSDK(cfg.SoFile) if sdk == nil { return false } @@ -49,10 +50,19 @@ return false } } + // 璁剧疆gpu index + rGPU := gpu + if v, ok := cfg.Param["gpu"]; ok { + if t, err := strconv.Atoi(v); err != nil { + rGPU = -1 + } else { + rGPU = t + } + } // 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{}) { - handle := sdk.fnCreate(config, typ, id, gpu, shm, util.ToRuleIPC, 30, logo.Infoln, nil) + handle := sdk.fnCreate(config, typ, id, rGPU, shm, util.ToRuleIPC, 30, logo.Infoln, nil) if handle == nil { logo.Errorln("Create SDK: ", typ, " ID: ", id, " Error") return false -- Gitblit v1.8.0