{"id":666,"library":"nvidia-cusparselt-cu12","title":"NVIDIA cuSPARSELt","description":"NVIDIA cuSPARSELt is a high-performance CUDA library dedicated to general matrix-matrix operations in which at least one operand is a structured sparse matrix. It supports NVIDIA Sparse MMA tensor cores, mixed-precision computation, matrix pruning and compression functionalities, activation functions, and batched computation. The current version is 0.8.1, and the library has an active release cadence with frequent updates.","status":"active","version":"0.8.1","language":"python","source_language":"en","source_url":"https://docs.nvidia.com/cuda/cusparselt/index.html","tags":["cuda","nvidia","machine learning","high-performance computing","sparse matrix","linear algebra","gpu","backend"],"install":[{"cmd":"pip install nvidia-cusparselt-cu12","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides the core CUDA runtime libraries required for any CUDA-accelerated Python package. cuSPARSELt explicitly requires CUDA 11.2 toolkit or above.","package":"nvidia-cuda-runtime-cu12","optional":false},{"reason":"NVIDIA JIT LTO Library, often a required dependency for other CUDA Python packages and implicitly for a full CUDA environment.","package":"nvidia-nvjitlink-cu12"},{"reason":"cuSPARSELt is an extension of cuSPARSE, and its underlying C API relies on 'cusparse.h' headers. This package provides the CUSPARSE native runtime libraries.","package":"nvidia-cusparse-cu12"}],"imports":[{"note":"This package primarily provides low-level C bindings for the cuSPARSELt library and is generally consumed by other Python frameworks (e.g., CuPy, PyTorch) rather than offering a direct, high-level Python API for end-users. Direct programmatic use might involve interacting with internal _lib modules or CFFI/ctypes wrappers, which are not typically exposed as stable public APIs.","symbol":"Low-level C bindings via 'nvidia.cusparselt' module","correct":"import nvidia.cusparselt # Primarily provides C-level bindings to the cuSPARSELt library, not a high-level Python API."}],"quickstart":{"code":"import sys\nimport subprocess\n\ndef check_package(package_name):\n    try:\n        __import__(package_name)\n        print(f\"Successfully imported {package_name}\")\n    except ImportError:\n        print(f\"Failed to import {package_name}. Please ensure it's installed and your CUDA environment is correctly set up.\")\n        sys.exit(1)\n\n# This package is primarily for providing underlying CUDA binaries\n# for other libraries. A direct high-level API is not typically exposed.\n# The primary quickstart is to ensure successful installation and importability.\n\nprint(\"Verifying nvidia-cusparselt-cu12 installation...\")\ncheck_package('nvidia.cusparselt')\n\n# Additional checks for CUDA runtime components (optional, but good practice)\nprint(\"Verifying core NVIDIA CUDA runtime components...\")\ncheck_package('nvidia.cuda_runtime')\n\nprint(\"Installation verification complete. Ensure your CUDA-enabled applications can leverage cuSPARSELt.\")","lang":"python","description":"The `nvidia-cusparselt-cu12` package provides low-level Python bindings to the NVIDIA cuSPARSELt library. It does not typically expose a high-level Python API for direct user interaction. This quickstart demonstrates how to verify that the package and its core CUDA runtime components can be imported successfully, indicating a correct installation in a compatible CUDA environment. Further usage usually involves integrating with frameworks like CuPy or PyTorch that utilize these low-level bindings."},"warnings":[{"fix":"For CUDA 12.9 or Jetson platforms, use `nvidia-cusparselt-cu12 < 0.9.0` (e.g., `==0.8.1`). Review NVIDIA's cuSPARSELt Release Notes for specific compatibility details before upgrading.","message":"Starting with cuSPARSELt v0.9.0 (a version newer than 0.8.1, but released by NVIDIA), support for CUDA 12.9 and the Jetson platform has been discontinued. Users on these configurations should ensure they use a compatible older version of cuSPARSELt.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Always install the `nvidia-cusparselt-cuXX` package corresponding to your CUDA Toolkit version. Verify your CUDA driver and toolkit installation. For CuPy users, `cupy.show_config()` can help diagnose CUDA environment issues. You may also need to explicitly install `nvidia-cuda-runtime-cu12` if not automatically resolved.","message":"A common footgun with NVIDIA CUDA libraries is ensuring compatibility between the installed CUDA Toolkit, GPU drivers, and the `cuXX` version suffix of the Python package. `nvidia-cusparselt-cu12` specifically requires a CUDA 11.2 toolkit or above and compatible drivers. Mismatches can lead to runtime errors or a failure to leverage the GPU.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For complex dependency graphs, consider pinning exact versions for NVIDIA packages in a `requirements.txt` file or using a dependency resolver with stricter constraints. Sometimes, specifying `--no-deps` for individual NVIDIA packages (if dependencies are managed manually) can speed up installation, but this is advanced usage.","message":"Installing `nvidia-*-cu12` packages can sometimes lead to prolonged dependency resolution times with `pip`. This is due to the complex interdependencies among various NVIDIA CUDA Python wheels.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When performing low-level operations or passing device memory pointers, ensure that output buffers are correctly allocated and aligned (e.g., to 16 bytes for `float` or `half` types) to prevent potential memory access errors. Use CUDA's memory allocation functions (`cudaMalloc`) which guarantee alignment. If using frameworks like NumPy/CuPy, ensure their buffer creation respects necessary alignments.","message":"Similar to its related library `cuSPARSE`, care must be taken with memory alignment. In `cuSPARSE` versions with CUDA 12.4, incorrect 16-byte alignment of output vectors in `cusparseSpMV` could lead to invalid memory accesses. While not explicitly documented for `cuSPARSELt` in Python, this highlights a potential low-level memory management consideration for direct buffer manipulation in sparse CUDA operations.","severity":"gotcha","affected_versions":"All versions, especially when interacting with raw memory buffers"},{"fix":"When installing NVIDIA Python packages, always include `--extra-index-url https://pypi.nvidia.com/` in your `pip install` command. For example: `pip install --extra-index-url https://pypi.nvidia.com/ nvidia-cusparselt-cu12`. Ensure that `https://pypi.nvidia.com/` is reachable from your build environment.","message":"NVIDIA Python packages like `nvidia-cusparselt-cu12` are often 'placeholder' packages on PyPI.org. They require `https://pypi.nvidia.com/` to be specified as an extra index URL to locate and download the actual pre-built wheels. Failure to provide this index URL or to reach the NVIDIA PyPI server will result in 'Didn't find wheel' errors during installation.","severity":"breaking","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T17:36:47.462Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Ensure your Python and system environment are compatible with the `nvidia-cusparselt-cu12` package, check for correct spelling, and verify if the package is available for your specific CUDA version and platform. You might need to specify a `--index-url` if it's hosted on a private repository or a specific NVIDIA index.","cause":"This error typically occurs when pip cannot find a compatible package version on PyPI for the current environment, often due to an unsupported Python version, OS, or a very new/private package not yet fully available or indexed.","error":"ERROR: Could not find a version that satisfies the requirement nvidia-cusparselt-cu12 (from versions: none)"},{"fix":"Install necessary build tools (e.g., `build-essential` on Linux), ensure the CUDA Toolkit is correctly installed and its paths are configured, and verify that your NVIDIA GPU drivers are up to date and compatible with the target CUDA version.","cause":"This indicates that the installation process failed during the build phase, often due to missing system dependencies (like a C++ compiler or CUDA toolkit components), an incompatible CUDA driver, or environmental issues preventing compilation of the underlying C++/CUDA code.","error":"ERROR: Could not build wheels for nvidia-cusparselt-cu12, which is required to install pyproject.toml-based projects"},{"fix":"Ensure you are using a Python library that correctly wraps `cusparselt` and that it is properly installed. `nvidia-cusparselt-cu12` primarily provides the CUDA library; a separate Python binding might be required to interact with it directly from Python, or it's used internally by other deep learning frameworks.","cause":"While `nvidia-cusparselt-cu12` installs the underlying C++/CUDA library, this error occurs if a Python wrapper or binding that *uses* `cusparselt` is expected but not found or correctly installed, or if the user is trying to directly import a C++ library as a Python module.","error":"ModuleNotFoundError: No module named 'cusparselt'"},{"fix":"Verify that an NVIDIA GPU is present and correctly installed. Update your NVIDIA GPU drivers to the latest version. Ensure the CUDA Toolkit is installed and configured correctly, and that the GPU is recognized by the operating system.","cause":"This is a common low-level CUDA runtime error, indicating that the system either lacks an NVIDIA GPU, the GPU drivers are not installed or are outdated, or the CUDA runtime cannot detect an available device for computation, which `cusparselt` requires.","error":"CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected"}],"ecosystem":"pypi","meta_description":null,"install_score":30,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"0.8.1","install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":6.5,"import_time_s":null,"mem_mb":null,"disk_size":"344M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"344M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":6.1,"import_time_s":null,"mem_mb":null,"disk_size":"345M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"345M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":5.6,"import_time_s":null,"mem_mb":null,"disk_size":"337M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"337M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":5.3,"import_time_s":null,"mem_mb":null,"disk_size":"337M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"337M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":6.6,"import_time_s":null,"mem_mb":null,"disk_size":"343M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"343M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"stale","tag_description":"widespread failures or data too old to trust","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}]}}