| | |
| | | "analysis/util" |
| | | "context" |
| | | "plugin" |
| | | "strconv" |
| | | |
| | | "basic.com/valib/gogpu.git" |
| | | ) |
| | |
| | | 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 |