Installation Guide#
cuSolverDx is distributed as a part of the MathDx package. To download the most recent release of the MathDx package including cuSolverDx, go to the https://developer.nvidia.com/cusolverdx-downloads website.
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.
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.
cuSolverDx In Your Project#
To use cuSolverDx library, users need to include the directories with cusolverdx.hpp and its dependencies commonDx, which are shipped with the MathDx package, and link with cuSolverDx static LTO (Link Time Optimization) library libsolverdx.a:
nvcc -dlto -std=c++17 -arch sm_XY (...) -I<mathdx_include_dir> <your_source_file>.cu -o <your_binary> -lcusolverdx
The -dlto option at link time instructs the linker to retrieve the LTO IR from the library object and perform optimization on the resulting IR for code generation.
Alternatively, when using NVRTC and nvJitLink it’s possible to use fatbin file libcusolverdx.fatbin instead of libcusolverdx.a. It contains the
same set of functions but can be used on platforms other than x86_64 Linux.
When you unpack MathDx YY.MM package tarball into <your_directory>, cusolverdx.hpp file will be available at the following
location:
<your_directory>/nvidia/mathdx/yy.mm/include/
The library files libcusolverdx.a and libcusolverdx.fatbin will be present in:
<your_directory>/nvidia/mathdx/yy.mm/lib/
The commonDx headers will be available at the following location:
<your_directory>/nvidia/mathdx/yy.mm/include/
Detailed requirements are listed in the Requirements section.
cuSolverDx In Your CMake Project#
The MathDx package provides configuration files that simplify using cuSolverDx in other CMake projects. After
finding mathdx using find_package, users have to link mathdx::cusolverdx to their target.
This propagates the include directory cusolverdx_INCLUDE_DIRS, commonDx, and the C++17 requirement to their target.
To enable LTO in CMake for a target, set INTERPROCEDURAL_OPTIMIZATION to true, and to allow separate compilation
of device code set CUDA_SEPARABLE_COMPILATION to true. This is done by the CMake set_target_properties command:
find_package(mathdx REQUIRED COMPONENTS cusolverdx CONFIG)
set_target_properties(YourProgram
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
INTERPROCEDURAL_OPTIMIZATION ON)
target_link_libraries(YourProgram mathdx::cusolverdx)
You can pass the path to MathDx package using PATHS option:
find_package(mathdx REQUIRED COMPONENTS cusolverdx 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/" (...)
Defined Variables#
mathdx_cusolverdx_FOUND,cusolverdx_FOUNDTrue if cuSolverDx was found.
cusolverdx_INCLUDE_DIRScuSolverDx include directories.
mathdx_INCLUDE_DIRSMathDx include directories.
cusolverdx_LIBRARIEScuSolverDx library target.
cusolverdx_FATBINPath to cuSolverDx fatbin library
libcusolverdx.fatbincusolverdx_LIBRARY_DIRSThe directory containing cuSolverDx library
mathdx_VERSIONMathDx package version number in
X.Y.Zformat.cusolverdx_VERSIONcuSolverDx version number in
X.Y.Zformat.MathDx/cuSolverDx version matrix
MathDx
cuSolverDx
25.01
0.1.0