MCPcopy Index your code
hub / github.com/coder/envbox / GPUEnvs

Function GPUEnvs

xunix/gpu.go:27–39  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

25)
26
27func 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
41func GPUs(ctx context.Context, log slog.Logger, usrLibDir string) ([]Device, []mount.MountPoint, error) {
42 var (

Callers 2

runDockerCVMFunction · 0.92
TestGPUEnvsFunction · 0.92

Calls 1

EnvironFunction · 0.85

Tested by 1

TestGPUEnvsFunction · 0.74