GPU backends¶
cuPDLPx supports NVIDIA GPUs through CUDA and AMD GPUs through ROCm/HIP. Both backends use the same algorithm and Python, command-line, and C APIs. The compatibility layer selects the GPU libraries.
Backend matrix¶
| Target | Compiler | Dense algebra | Sparse algebra | Parallel primitives |
|---|---|---|---|---|
| NVIDIA CUDA | NVCC | cuBLAS | cuSPARSE | CUB / Thrust |
| AMD ROCm | hipcc |
hipBLAS | hipSPARSE | hipCUB / rocPRIM / rocThrust |
With USE_HIP=ON, compatibility headers map CUDA calls to HIP so that the
same .cu sources compile for AMD GPUs.
See SpMV for sparse matrix storage, backend selection, and workspace reuse.
Select an architecture¶
CUDA¶
By default CMake builds for every supported major CUDA architecture
(all-major). To build only for the GPU in the build machine, pass native:
ROCm¶
HIP builds use CMake's GPU architecture detection by default. Set the target architecture explicitly for headless builds or when targeting another device:
Platform notes¶
- CI builds both the CUDA and ROCm configurations on Linux.
- CUDA builds are also exercised on Windows.
- The native CLI is disabled automatically for MSVC builds because its current argument parser depends on POSIX headers; the libraries and Python binding are separate build targets.
- ROCm packages installed outside CMake's search path may require an explicit
CMAKE_PREFIX_PATH.
Vendor documentation¶
- NVIDIA: CUDA Toolkit, cuBLAS, cuSPARSE, CUB, and Thrust.
- AMD: ROCm, hipBLAS, hipSPARSE, rocPRIM, and rocThrust.
- The backend dispatch described here is implemented in
internal/cusparse_compat.handsrc/spmv_backend.cu.