Quick Installation Guide#

cuBLASDx is distributed as part of the MathDx package. To download the latest release of the MathDx package, including cuBLASDx, visit Math Dx downloads.

Note

MathDx package contains:

  • cuBLASDx for selected linear algebra functions like General Matrix Multiplication (GEMM),

  • cuFFTDx for FFT calculations,

  • cuSolverDx for selected dense matrix factorization and solve routines,

  • cuRANDDx for random number generation.

  • nvCOMPDx for compression and decompression of data on GPU.

MathDx libraries are designed to work together in a single project.

Note that for a project where multiple device extensions libraries are used all the libraries must come from the same MathDx release. Examples of such fusion are included in the package.

cuBLASDx in Your Project#

cuBLASDx is a header-only library. To use it, simply include the directories containing cublasdx.hpp and its dependencies, commonDx and CUTLASS, which are provided with the MathDx package, in your compilation commands. All requirements are listed in the Requirements section.

The simplest approach is to use the MathDx and CUTLASS include directories:

nvcc -std=c++17 -arch=sm_XY (...) -I<mathdx_include_dir> -I<cutlass_include_dir> <your_source_file>.cu -o <your_binary>

After unpacking the MathDx YY.MM package tarball into <your_directory>, the cublasdx.hpp file will be available at the following locations:

  • <your_directory>/nvidia/mathdx/yy.mm/include/

  • <your_directory>/nvidia/mathdx/yy.mm/include/cublasdx/include/

The commonDx headers will be available at:

  • <your_directory>/nvidia/mathdx/yy.mm/include/

The CUTLASS headers will be available at:

  • <your_directory>/nvidia/mathdx/yy.mm/external/cutlass/include/

cuBLASDx in Your CMake Project#

The MathDx package provides configuration files to simplify the integration of cuBLASDx into CMake projects. After locating mathdx using find_package, link mathdx::cublasdx to your target. This propagates the include directory cublasdx_INCLUDE_DIRS, both dependencies (commonDx and CUTLASS), and the C++17 requirement to your target.

find_package(mathdx REQUIRED COMPONENTS cublasdx CONFIG)
target_link_libraries(YourProgram mathdx::cublasdx)

You can specify the path to the MathDx package using the PATHS option:

find_package(mathdx REQUIRED COMPONENTS cublasdx CONFIG PATHS "<your_directory>/nvidia/mathdx/yy.mm/")

Alternatively, set mathdx_ROOT during CMake configuration of your project:

cmake -Dmathdx_ROOT="<your_directory>/nvidia/mathdx/yy.mm/" (...)

Using a Custom CUTLASS#

You may use a version of CUTLASS other than the one provided with the MathDx package, as long as it meets the requirements listed in the Requirements section. This can be done in two ways:

  1. Define the NvidiaCutlass_ROOT CMake variable or environment variable to point to the directory containing the installed CUTLASS. This allows MathDx to locate the NvidiaCutlass package.

  2. Define the mathdx_CUTLASS_ROOT CMake variable or environment variable to point to the directory containing the CUTLASS headers.

Defined Variables#

mathdx_cublasdx_FOUND, cublasdx_FOUND

True if cuBLASDx was found.

cublasdx_INCLUDE_DIRS

cuBLASDx include directories.

mathdx_cutlass_INCLUDE_DIR, cublasdx_cutlass_INCLUDE_DIR

CUTLASS include directory.

mathdx_INCLUDE_DIRS

MathDx include directories.

mathdx_VERSION

MathDx package version number in X.Y.Z format.

cublasdx_VERSION

cuBLASDx version number in X.Y.Z format.

MathDx/cuBLASDx Version Matrix

MathDx

cuBLASDx

23.07

0.1.0

24.08

0.2.0

25.01

0.3.0

25.01.1

0.3.1

25.06

0.4.0