diff --git a/gpu/pick.go b/gpu/pick.go index 28fa967e..27660af7 100644 --- a/gpu/pick.go +++ b/gpu/pick.go @@ -23,12 +23,12 @@ func HandleGpu(target target.TargetGPU, env map[string]string, isVulkan bool) (m } } - gpu := gpus[target.Id] - - if gpu == nil { + if len(gpus) < target.Id+1 { return env, errors.New("gpu not found") } + gpu := gpus[target.Id] + env = gpu.ApplyEnv(env) return env, nil