{
  "id": "cmake/cuda-architectures-empty",
  "signature": "CMake Error: CUDA_ARCHITECTURES is empty for target \"mycudatarget\"",
  "signature_zh": "CMake 错误：目标 \"mycudatarget\" 的 CUDA_ARCHITECTURES 为空",
  "regex": "CUDA_ARCHITECTURES is empty for target",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "CMake 3.18+ requires CUDA_ARCHITECTURES to be set for all CUDA-enabled targets; an empty value or unset variable triggers this error to prevent unsupported architecture code.",
  "root_cause_type": "generic",
  "root_cause_zh": "CMake 3.18+ 要求为所有启用 CUDA 的目标设置 CUDA_ARCHITECTURES；空值或未设置变量会触发此错误，以防止不支持的架构代码。",
  "versions": [
    {
      "version": "CMake 3.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "CMake interprets OFF as an empty string, still triggering the error.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "An empty string is still empty; CMake requires a non-empty list of architectures.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "set_target_properties(mycudatarget PROPERTIES CUDA_ARCHITECTURES \"75;80\")\n# Or use the native arch detection:\nset(CMAKE_CUDA_ARCHITECTURES \"native\")",
      "success_rate": 0.9,
      "how": "set_target_properties(mycudatarget PROPERTIES CUDA_ARCHITECTURES \"75;80\")\n# Or use the native arch detection:\nset(CMAKE_CUDA_ARCHITECTURES \"native\")",
      "condition": "",
      "sources": []
    },
    {
      "action": "set(CMAKE_CUDA_ARCHITECTURES \"75;80\")\nadd_library(mycudatarget CUDA mycuda.cu)",
      "success_rate": 0.85,
      "how": "set(CMAKE_CUDA_ARCHITECTURES \"75;80\")\nadd_library(mycudatarget CUDA mycuda.cu)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "set_target_properties(mycudatarget PROPERTIES CUDA_ARCHITECTURES \"75;80\")\n# Or use the native arch detection:\nset(CMAKE_CUDA_ARCHITECTURES \"native\")",
    "set(CMAKE_CUDA_ARCHITECTURES \"75;80\")\nadd_library(mycudatarget CUDA mycuda.cu)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-12-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}