{
  "id": "cuda/nvrtc-include-path-missing",
  "signature": "RuntimeError: NVRTC compilation failed: error: cannot open source file 'cuda_runtime.h'",
  "signature_zh": "运行时错误：NVRTC 编译失败：错误：无法打开源文件 'cuda_runtime.h'",
  "regex": "error: cannot open source file 'cuda_runtime.h'",
  "domain": "cuda",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "NVRTC (CUDA runtime compilation) cannot find the CUDA include path because the CUDA toolkit headers are not in the default search path or the CUDA_HOME environment variable is not set correctly.",
  "root_cause_type": "generic",
  "root_cause_zh": "NVRTC（CUDA 运行时编译）找不到 CUDA 包含路径，因为 CUDA 工具包头文件不在默认搜索路径中，或者 CUDA_HOME 环境变量未正确设置。",
  "versions": [
    {
      "version": "CUDA 11.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CUDA 12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PyTorch 2.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "TensorFlow 2.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "NVRTC relies on the system's CUDA installation, not the deep learning framework's bundled headers; reinstalling the framework does not fix the include path.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This may work temporarily but breaks portability and version compatibility; also other headers may be missing.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set the CUDA_HOME environment variable to the root of your CUDA installation (e.g., /usr/local/cuda-12.1) before running the script. For Python, add it in the code using os.environ.",
      "success_rate": 0.9,
      "how": "Set the CUDA_HOME environment variable to the root of your CUDA installation (e.g., /usr/local/cuda-12.1) before running the script. For Python, add it in the code using os.environ.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Create a symlink from the CUDA toolkit include directory to a standard location, or add it to the CPLUS_INCLUDE_PATH environment variable.",
      "success_rate": 0.85,
      "how": "Create a symlink from the CUDA toolkit include directory to a standard location, or add it to the CPLUS_INCLUDE_PATH environment variable.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Set the CUDA_HOME environment variable to the root of your CUDA installation (e.g., /usr/local/cuda-12.1) before running the script. For Python, add it in the code using os.environ.",
    "Create a symlink from the CUDA toolkit include directory to a standard location, or add it to the CPLUS_INCLUDE_PATH environment variable."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.nvidia.com/cuda/nvrtc/index.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}