{"library":"nvidia-cublas","title":"NVIDIA CUBLAS Runtime Libraries","description":"The `nvidia-cublas` package provides the native runtime libraries for NVIDIA's CUBLAS (CUDA Basic Linear Algebra Subroutines). It acts as a foundational dependency, allowing other Python deep learning and scientific computing frameworks (like PyTorch, TensorFlow, and CuPy) to leverage GPU-accelerated linear algebra operations efficiently. It is currently at version 13.3.0.5 and typically receives updates aligned with new NVIDIA CUDA Toolkit releases.","language":"python","status":"active","last_verified":"Thu Apr 09","install":{"commands":["pip install nvidia-cublas"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import torch\n\ndef check_cublas_availability():\n    # Ensure PyTorch is installed and CUDA is available for CUBLAS to be used\n    try:\n        if not torch.cuda.is_available():\n            print(\"CUDA is not available. CUBLAS operations will run on CPU or not at all.\")\n            return\n\n        print(f\"CUDA is available. Device name: {torch.cuda.get_device_name(0)}\")\n        print(f\"Number of CUDA devices: {torch.cuda.device_count()}\")\n\n        # Perform a simple matrix multiplication that typically uses CUBLAS\n        a = torch.randn(1000, 1000, device='cuda')\n        b = torch.randn(1000, 1000, device='cuda')\n        c = torch.matmul(a, b)\n        print(\"Successfully performed a GPU matrix multiplication (likely using CUBLAS).\")\n        print(f\"Result shape: {c.shape}\")\n    except Exception as e:\n        print(f\"An error occurred during CUDA operation: {e}\")\n        print(\"This might indicate an issue with CUBLAS, CUDA installation, or drivers.\")\n\nif __name__ == \"__main__\":\n    check_cublas_availability()","lang":"python","description":"This quickstart demonstrates how to verify that your system has CUDA (and by extension, CUBLAS through `nvidia-cublas`) correctly configured and available for a framework like PyTorch. This package itself does not expose a direct Python API, but rather provides the underlying shared libraries for other GPU-accelerated libraries. Ensure `torch` is installed (`pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` or similar for your CUDA version).","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":-1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":-1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":-1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":-1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":-1}]},"compatibility":null}