{
  "id": "cuda/cublas-invalid-handle",
  "signature": "RuntimeError: CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemm_v2 with handle=0x0",
  "signature_zh": "运行时错误：调用cublasSgemm_v2时CUBLAS_STATUS_INVALID_VALUE，句柄=0x0",
  "regex": "CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemm_v2",
  "domain": "cuda",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A null cuBLAS handle (0x0) is passed to a cuBLAS function, typically because the handle was not properly created or was destroyed before the call.",
  "root_cause_type": "generic",
  "root_cause_zh": "向cuBLAS函数传递了空句柄（0x0），通常是因为句柄未正确创建或在调用前已被销毁。",
  "versions": [
    {
      "version": "CUDA 11.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cuBLAS 11.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Memory tracking is unrelated to handle management.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "More workers increase the likelihood of handle misuse.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the cuBLAS handle is created before use. In PyTorch, this is typically managed internally, but if using custom CUDA code, call `cublasCreate(&handle)` and check for errors. For PyTorch, reinitialize the model: `model = Model().cuda()`.",
      "success_rate": 0.85,
      "how": "Ensure the cuBLAS handle is created before use. In PyTorch, this is typically managed internally, but if using custom CUDA code, call `cublasCreate(&handle)` and check for errors. For PyTorch, reinitialize the model: `model = Model().cuda()`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure the cuBLAS handle is created before use. In PyTorch, this is typically managed internally, but if using custom CUDA code, call `cublasCreate(&handle)` and check for errors. For PyTorch, reinitialize the model: `model = Model().cuda()`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.nvidia.com/cuda/cublas/index.html",
  "official_doc_section": null,
  "error_code": "CUBLAS_STATUS_INVALID_VALUE",
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-07-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}