4 releases (breaking)

0.6.0 Nov 21, 2021
0.5.0 Jun 11, 2020
0.3.0 Jan 17, 2020
0.2.0 Jun 12, 2017

#80 in Machine learning

Download history 49/week @ 2022-10-07 14/week @ 2022-10-14 24/week @ 2022-10-21 39/week @ 2022-10-28 52/week @ 2022-11-04 36/week @ 2022-11-11 41/week @ 2022-11-18 17/week @ 2022-11-25 23/week @ 2022-12-02 54/week @ 2022-12-09 19/week @ 2022-12-16 36/week @ 2022-12-23 15/week @ 2022-12-30 19/week @ 2023-01-06 14/week @ 2023-01-13 48/week @ 2023-01-20

105 downloads per month
Used in 6 crates (3 directly)


11K SLoC

rust-cuBLAS • Join the chat at https://gitter.im/spearow/juice Build Status Crates.io License

rust-cuBLAS provides a safe wrapper for CUDA's cuBLAS library, so you can use cuBLAS comfortably and safely in your Rust application.

As cuBLAS currently relies on CUDA to allocate memory on the GPU, you might also look into [rust-cuda][rust-cuda].

rust-cublas is part of the High-Performance Computation Framework Coaster, for the BLAS Plugin. For an easy, unified interface for BLAS operations, such as those provided by cuBLAS, you might check out Coaster.

For more information,

Getting Started

If you're using Cargo, just add rust-cuBLAS to your Cargo.toml:

cublas = "0.2.0"

If you're using Cargo Edit, you can call:

$ cargo add cublas


The library can be built by entering cublas/ and cublas-sys/, and issuing a cargo build within each directory.

rust-cublas depends on the cuBLAS runtime libraries, which can be obtained from NVIDIA.

Manual Configuration

rust-cublas's build script will by default attempt to locate cublas via pkg-config. This will not work in some situations, for example,

  • on systems that don't have pkg-config,
  • when cross compiling, or
  • when cuBLAS is not installed in the default system library directory (e.g. /usr/lib).

Therefore the build script can be configured by exporting the following environment variables:

    If specified, a directory that will be used to find cuBLAS runtime libraries. e.g. /opt/cuda/lib

    If specified, cuBLAS libraries will be statically rather than dynamically linked.

    If specified, will be used to find cuBLAS libraries under a different name.

If either CUBLAS_LIB_DIR or CUBLAS_INCLUDE_DIR are specified, then the build script will skip the pkg-config step.

If your also need to run the compiled binaries yourself, make sure that they are available:

# Linux; for other platforms consult the instructions that come with cuBLAS
cd <cublas_installpath>


Want to contribute? Awesome! We have instructions to help you get started contributing code or documentation.

We have a mostly real-time collaboration culture and happens here on Github and on the Gitter Channel.


You can find the release history in the root file CHANGELOG.md.

A changelog is a log or record of all the changes made to a project, such as a website or software project, usually including such records as bug fixes, new features, etc. - Wikipedia

We are using Clog, the Rust tool for auto-generating CHANGELOG files.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~17K SLoC