Installation#
GLASS is a header-only CUDA library. There is nothing to build or link for
the pure-SIMT path — you add the repository root to your include path and
#include the umbrella header. Only the optional glass::nvidia:: backend
pulls in external dependencies (NVIDIA MathDx).
Header-only include model#
Clone (or vendor) the repository, add its root to your compiler’s include path, and include the header you need:
#include "glass.cuh" // pure-SIMT glass:: API
// or
#include "glass-cgrps.cuh" // cooperative-groups glass::cgrps:: API
// or
#include "glass-nvidia.cuh" // CUB / cuBLASDx / cuSOLVERDx backend
A minimal nvcc invocation for the pure-SIMT path:
nvcc -std=c++17 -I /path/to/GLASS -arch=sm_86 my_kernel.cu -o my_kernel
CUDA Toolkit requirement#
CUDA Toolkit 11.0 or newer. CUB (used by the
glass::nvidia::L1 reductions) ships bundled with every CUDA 11+ install — no separate download.C++17 (
nvcc -std=c++17). The pure-SIMT core compiles cleanly under C++17; theglass::nvidia::path requires C++17 (mandated by cuBLASDx / cuSOLVERDx).
Component |
C++ Standard |
Optional deps |
|---|---|---|
|
C++17 |
— |
|
C++17 |
CUB (bundled with CUDA 11+) |
|
C++17 + |
cuBLASDx |
|
C++17 + |
cuSOLVERDx |
Optional: MathDx setup for the glass::nvidia:: backend#
The glass::nvidia:: GEMM/GEMV/batched and LAPACK wrappers route to NVIDIA’s
device-side libraries cuBLASDx and cuSOLVERDx, which ship together in the
MathDx package. They are not distributed via apt — installation is a
manual download from the NVIDIA Developer portal.
Library |
Used by |
Header-only? |
|---|---|---|
CUB |
|
Yes (bundled with CUDA) |
cuBLASDx |
|
Yes |
cuSOLVERDx |
LAPACK (Cholesky / TRSM / posv / …) |
No — links a precompiled device fatbin |
Download#
Go to https://developer.nvidia.com/cublasdx-downloads (a free NVIDIA Developer account is required).
Choose MathDx for CUDA 12, Linux x86_64 (
.tar.gz). Version 25.12.x or later is recommended — that is the version the GLASS wrappers are tested against.
Install#
# Extract to /opt (or any directory you prefer)
tar -xzf MathDx_*.tar.gz -C /opt
# Confirm the version directory name
ls /opt/nvidia/mathdx/
# Set the environment variable (add to ~/.bashrc to persist)
export MATHDX_ROOT=/opt/nvidia/mathdx/25.12 # adjust version as needed
Verify#
ls $MATHDX_ROOT/include/cublasdx.hpp # cuBLASDx header
ls $MATHDX_ROOT/include/cusolverdx.hpp # cuSOLVERDx header
ls $MATHDX_ROOT/include/cusolverdx_io.hpp # cuSOLVERDx IO helpers
ls $MATHDX_ROOT/lib/libcusolverdx.a # cuSOLVERDx device library
echo $MATHDX_ROOT
Linking notes#
cuBLASDx is header-only — #include <cublasdx.hpp> is enough; no extra
link flags.
cuSOLVERDx is not header-only: part of the implementation ships as a
precompiled device fatbin (libcusolverdx.a). Any .cu file that uses
cuSOLVERDx must add:
-rdc=true # relocatable device code (required for device link)
-dlto # link-time optimization (the fatbin is LTO-compiled)
-L$MATHDX_ROOT/lib
-lcusolverdx # the device library
-lcublas -lcusolver -lcudart # host-side CUDA libs
The benchmark driver bench/run_bench.py adds these automatically when
cusolverdx.hpp is present.
Required nvcc flags and known issues#
cuBLASDx headers require
--expt-relaxed-constexpr(otherwise many#20013-Dconstexpr/__host__/__device__warnings fire).CUDA 12.9 cuBLASDx miscompilation: apply
-Xptxas -O1(this flag also doubles as anti-DSE for bench loops). If results are still wrong, add-DCUBLASDX_IGNORE_NVBUG_5218000_ASSERT.cuSOLVERDx NVBUG 5288270 affects SM 1200 (Blackwell consumer) for some real-precision configs on CUDA ≤ 13.0. Define
CUSOLVERDX_IGNORE_NVBUG_5288270_ASSERTto silence the static asserts, but verify correctness on your target arch first.
Next steps#
Library Overview — the single-block model and the call surfaces.
Quickstart — a minimal end-to-end kernel.
Using the NVIDIA Backend — a full compile-and-call walkthrough for the MathDx backend.
See Using the NVIDIA Backend for a full compile-and-call walkthrough.