{"record":{"id":"a3c68f2d219faf7d","repo":"jax-ml/jax","slug":"cudnn-not-found","errorCode":null,"errorMessage":"cuDNN not found.","messagePattern":"cuDNN not found\\.","errorType":"exception","errorClass":"std::runtime_error","httpStatus":null,"severity":"error","filePath":"jaxlib/cuda/versions_helpers.cc","lineNumber":98,"sourceCode":"\nint CusparseGetVersion() {\n  // cusparseGetVersion is unhappy if passed a null library handle. But\n  // cusparseGetProperty doesn't require one.\n  int major, minor, patch;\n  JAX_THROW_IF_ERROR(JAX_AS_STATUS(cusparseGetProperty(MAJOR_VERSION, &major)));\n  JAX_THROW_IF_ERROR(JAX_AS_STATUS(cusparseGetProperty(MINOR_VERSION, &minor)));\n  JAX_THROW_IF_ERROR(JAX_AS_STATUS(cusparseGetProperty(PATCH_LEVEL, &patch)));\n  ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(&major, sizeof major);\n  ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(&minor, sizeof minor);\n  ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(&patch, sizeof patch);\n  return major * 1000 + minor * 100 + patch;\n}\nsize_t CudnnGetVersion() {\n  size_t version = ::cudnnGetVersion();\n  // If the cudnn stub in TSL can't find the library, it will use a dummy stub\n  // that returns 0, since cudnnGetVersion() cannot fail.\n  if (version == 0) {\n    throw std::runtime_error(\"cuDNN not found.\");\n  }\n  ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(&version, sizeof version);\n  return version;\n}\nint CudaComputeCapability(int device) {\n  int major, minor;\n  {\n    absl::MutexLock lock(driver_initialization_mutex);\n    if (!driver_initialized) {\n      JAX_THROW_IF_ERROR(JAX_AS_STATUS(cuInit(0)));\n      driver_initialized = true;\n    }\n  }\n  JAX_THROW_IF_ERROR(JAX_AS_STATUS(gpuDeviceGetAttribute(\n      &major, GPU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device)));\n  JAX_THROW_IF_ERROR(JAX_AS_STATUS(gpuDeviceGetAttribute(\n      &minor, GPU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device)));\n  ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(&major, sizeof major);","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jaxlib/cuda/versions_helpers.cc#L80-L116","documentation":"jaxlib queries cuDNN's version at runtime via cudnnGetVersion(); a 0 return means TSL's stub loader could not locate or load libcudnn, so a dummy stub answered. jaxlib refuses to report a bogus version and raises instead.","triggerScenarios":"Importing/initializing jax CUDA support when LD_LIBRARY_PATH/PIP cuDNN does not contain a loadable libcudnn (e.g. nvidia-cudnn-cu12 wheel missing or wrong major version for your CUDA).","commonSituations":"pip-installing jax without the matching nvidia-cudnn-cu12 package; custom CUDA envs where cuDNN is not on the loader path; upgrading jaxlib but not the CUDA extras wheels.","solutions":["pip install -U nvidia-cudnn-cu12 matching your jaxlib CUDA version","Set LD_LIBRARY_PATH to the directory containing libcudnn.so (e.g. the pip nvidia/cudnn/lib dir)","Verify with python -c \"import ctypes; ctypes.CDLL('libcudnn.so')\" and fix loader errors","Ensure cuDNN major version matches the one your jaxlib wheel was built against"],"exampleFix":"# before: pip install jax\n# after:  pip install -U \"jax[cuda12]\"","handlingStrategy":"validation","validationCode":"import ctypes\ntry:\n    ctypes.CDLL('libcudnn.so')\n    ok = True\nexcept OSError as e:\n    ok = False; print(e)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install jax via extras: pip install 'jax[cuda12]'","Verify nvidia-cudnn-cu12 version matches jaxlib requirements before running","Set LD_LIBRARY_PATH to the pip nvidia lib dirs"],"tags":["jax","cuda","cudnn","gpu","shared-library"],"backgroundTag":"shared-library-not-found","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}