The `nvidia-cublas-cu11` package provides the native CUBLAS runtime libraries for NVIDIA GPUs, specifically for CUDA 11 environments. CUBLAS is NVIDIA's highly optimized implementation of BLAS (Basic Linear Algebra Subprograms) which is critical for accelerating AI and HPC workloads. This package allows Python environments to access GPU computational resources for linear algebra operations, typically as a dependency for higher-level frameworks like PyTorch, TensorFlow, or through wrappers like Numba. The current version is 11.11.3.6, with releases generally aligned with CUDA Toolkit updates and subsequent patch releases.
pip install nvidia-cublas-cu11Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to utilize GPU-accelerated linear algebra through Numba, which in turn leverages the underlying CUBLAS libraries provided by `nvidia-cublas-cu11`. It performs a basic matrix multiplication, highlighting the necessary steps for device memory allocation, kernel execution, and result retrieval. Ensure you have Numba installed (`pip install numba`) and a compatible NVIDIA GPU and CUDA Toolkit. This example uses a custom kernel but Numba can also directly call CUBLAS functions for some operations.
Always ensure the installed `nvidia-cublas-cu11` package version (indicated by `cu11` in the name for CUDA 11 compatibility) matches your system's CUDA Toolkit version. Consult NVIDIA's documentation for compatibility matrices.
Utilize frameworks like Numba (`from numba import cuda`), PyTorch (`import torch`), or TensorFlow (`import tensorflow`) to leverage GPU acceleration. These libraries handle the low-level interactions with CUBLAS.
Verify that your `LD_LIBRARY_PATH` (Linux) or system PATH (Windows) includes the `lib64` (Linux) or `bin` (Windows) directory of your CUDA Toolkit installation (e.g., `/usr/local/cuda/lib64`). Tools like `ldd` (Linux) can help diagnose linking issues.
Monitor GPU memory usage with `nvidia-smi`. Optimize your workload sizes or use smaller batches. Review CUBLAS function parameters for correctness, as invalid inputs can trigger this error. Sometimes, reinstalling `nvidia-cublas-cu11` can resolve perceived library mismatches.