Browse Source

show gpu type

tags/v1.22.3.2^2
lewis 3 years ago
parent
commit
4662c80f65
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      routers/repo/cloudbrain.go

+ 10
- 1
routers/repo/cloudbrain.go View File

@@ -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) {



Loading…
Cancel
Save