{"id":"2a0a1699de5e623b","repo":"docker/cli","slug":"failed-to-read-gpu-options-w","errorCode":null,"errorMessage":"failed to read gpu options: %w","messagePattern":"failed to read gpu options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/gpus.go","lineNumber":79,"sourceCode":"\t\t}\n\n\t\tswitch key {\n\t\tcase \"driver\":\n\t\t\treq.Driver = val\n\t\tcase \"count\":\n\t\t\treq.Count, err = parseCount(val)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase \"device\":\n\t\t\treq.DeviceIDs = strings.Split(val, \",\")\n\t\tcase \"capabilities\":\n\t\t\treq.Capabilities = [][]string{append(strings.Split(val, \",\"), \"gpu\")}\n\t\tcase \"options\":\n\t\t\tr := csv.NewReader(strings.NewReader(val))\n\t\t\toptFields, err := r.Read()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to read gpu options: %w\", err)\n\t\t\t}\n\t\t\treq.Options = ConvertKVStringsToMap(optFields)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unexpected key '%s' in '%s'\", key, field)\n\t\t}\n\t}\n\n\tif _, ok := seen[\"count\"]; !ok && req.DeviceIDs == nil {\n\t\treq.Count = 1\n\t}\n\tif req.Options == nil {\n\t\treq.Options = make(map[string]string)\n\t}\n\tif req.Capabilities == nil {\n\t\treq.Capabilities = [][]string{{\"gpu\"}}\n\t}\n\n\to.values = append(o.values, req)","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/gpus.go#L61-L97","documentation":"Error \"failed to read gpu options: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/gpus.go:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}