From 4662c80f6560220d9a73925010b4273395f1bf69 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 25 Mar 2022 18:25:43 +0800 Subject: [PATCH] show gpu type --- routers/repo/cloudbrain.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index a5e417911..5e5a403ea 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -415,7 +415,16 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo jobRes.Resource.Memory = strings.ReplaceAll(jobRes.Resource.Memory, "Mi", "MB") spec := "GPU数:" + strconv.Itoa(jobRes.Resource.NvidiaComGpu) + ",CPU数:" + strconv.Itoa(jobRes.Resource.CPU) + ",内存(MB):" + jobRes.Resource.Memory ctx.Data["resource_spec"] = spec - ctx.Data["resource_type"] = jobRes.Config.GpuType + if task.JobType == string(models.JobTypeTrain) { + if trainGpuInfos == nil { + json.Unmarshal([]byte(setting.TrainGpuTypes), &trainGpuInfos) + } + for _, resourceType := range trainGpuInfos.GpuInfo { + if resourceType.Queue == jobRes.Config.GpuType { + ctx.Data["resource_type"] = resourceType.Value + } + } + } taskRoles := jobRes.TaskRoles if jobRes.JobStatus.State != string(models.JobFailed) {