Quick Installation Guide

cuBLASDx is distributed as a part of the MathDx package. To download the most recent release of the MathDx package including cuBLASDx go to the https://developer.nvidia.com/mathdx website.

Note

MathDx package also includes the cuFFTDx library for FFT calculations. Both libraries are designed to work together. When using multiple device extensions libraries in a single project they should all come from the same MathDx release.

cuBLASDx In Your Project

cuBLASDx is a header-only library, thus to use it users just need to the include the directories with cublasdx.hpp and its dependencies commonDx and CUTLASS, which are shipped with MathDx package, into their compilation commands. All exact requirements are listed in the Requirements section.

The easiest way 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>

When you unpack MathDx YY.MM package tarball into <your_directory>, 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 the following location:

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

The CUTLASS headers will be available at the following location:

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

cuBLASDx In Your CMake Project

The MathDx package provides configuration files that simplify using cuBLASDx in other CMake projects. After finding mathdx using find_package, users have to link mathdx::cublasdx to their target. This propagates the include directory cublasdx_INCLUDE_DIRS, both dependencies - commonDx and CUTLASSS, and the C++17 requirement to their target.

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

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

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

Alternatively, you can set mathdx_ROOT during cmake configuration of your project:

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

Using Custom CUTLASS

It’s possible to use CUTLASS other than the one shipped with MathDx package as long as the version meets the requirements listed in the Requirements section. It can be done in two ways:

  1. Define NvidiaCutlass_ROOT cmake variable or environment variable pointing to the directory with installed CUTLASS. This will allow MathDx to find NvidiaCutlass package.

  2. Define cublasdx_CUTLASS_ROOT cmake variable or environment variable pointing to the directory with CUTLASS headers.

Defined Variables

mathdx_cublasdx_FOUND, cublasdx_FOUND

True if cuBLASDx was found.

cublasdx_INCLUDE_DIRS

cuBLASDx include directories.

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