(ctx context.Context)
| 25 | ) |
| 26 | |
| 27 | func GPUEnvs(ctx context.Context) []string { |
| 28 | envs := Environ(ctx) |
| 29 | |
| 30 | gpus := []string{} |
| 31 | for _, env := range envs { |
| 32 | name := strings.Split(env, "=")[0] |
| 33 | if gpuEnvRegex.MatchString(name) { |
| 34 | gpus = append(gpus, env) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return gpus |
| 39 | } |
| 40 | |
| 41 | func GPUs(ctx context.Context, log slog.Logger, usrLibDir string) ([]Device, []mount.MountPoint, error) { |
| 42 | var ( |