zhangmeng
2020-01-21 9d9cd1d3b93613071d1dffc1c82c4515d2a65af6
app/slave/slave.go
@@ -6,6 +6,7 @@
   "analysis/util"
   "context"
   "plugin"
   "strconv"
   "basic.com/valib/gogpu.git"
)
@@ -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