{
  "id": "pytorch/cudnn-deterministic-error",
  "signature": "RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED",
  "signature_zh": "运行时错误：cuDNN 错误：CUDNN_STATUS_NOT_INITIALIZED",
  "regex": "RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED",
  "domain": "pytorch",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "cuDNN was not properly initialized, often because of an inconsistent CUDA context or because a cuDNN handle was used after the CUDA device was reset.",
  "root_cause_type": "generic",
  "root_cause_zh": "cuDNN 未正确初始化，通常是由于 CUDA 上下文不一致，或者在 CUDA 设备重置后使用了 cuDNN 句柄。",
  "versions": [
    {
      "version": "torch>=1.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cuDNN>=8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Calling torch.cuda.empty_cache() does not reinitialize cuDNN and may cause further issues.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Reinstalling PyTorch or cuDNN without addressing the CUDA context issue will not fix the problem.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure a single CUDA context is used. Avoid creating multiple contexts by calling torch.cuda.init() once at the beginning.",
      "success_rate": 0.8,
      "how": "Ensure a single CUDA context is used. Avoid creating multiple contexts by calling torch.cuda.init() once at the beginning.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set torch.backends.cudnn.deterministic = True and torch.backends.cudnn.benchmark = False to avoid handle conflicts.",
      "success_rate": 0.7,
      "how": "Set torch.backends.cudnn.deterministic = True and torch.backends.cudnn.benchmark = False to avoid handle conflicts.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure a single CUDA context is used. Avoid creating multiple contexts by calling torch.cuda.init() once at the beginning.",
    "Set torch.backends.cudnn.deterministic = True and torch.backends.cudnn.benchmark = False to avoid handle conflicts."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.nvidia.com/deeplearning/cudnn/api/index.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.75,
  "resolvable": "true",
  "first_seen": "2023-04-02",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}