GPU Setup¶
IMPaCT supports GPU-accelerated synthesis via AdaptiveCpp’s SYCL implementation. GPU acceleration applies to the sorted synthesis algorithms — abstraction is computed on the CPU and loaded from file.
Prerequisites¶
Install the base IMPaCT dependencies first (see Installation), then add GPU-specific libraries.
Identify your GPU:
lspci | grep -i vga
LLVM¶
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
sudo apt install -y libclang-16-dev clang-tools-16 libomp-16-dev llvm-16-dev
CUDA (NVIDIA)¶
sudo apt install nvidia-cuda-toolkit
Verify with nvcc --version.
Rebuild AdaptiveCpp with GPU Support¶
After installing GPU libraries, rebuild AdaptiveCpp with the appropriate flags:
cd AdaptiveCpp-develop
sudo cmake . -DCUDAToolkit_LIBRARY_ROOT=/usr/lib/cuda
sudo make install
See the AdaptiveCpp documentation for other GPU backends (Intel, AMD).
Makefile Changes¶
To use GPU synthesis, update your example’s Makefile:
Change the target from
--acpp-targets="omp"to your GPU target (e.g.,cuda:sm_70for NVIDIA V100).Replace
IMDP.cppwithGPU_synthesis.cppin the source files.
CC = acpp
CFLAGS = --acpp-targets="cuda:sm_70" -O3 ...
SRCS = example.cpp ../../src/GPU_synthesis.cpp ../../src/MDP.cpp
Note
GPU synthesis requires pre-computed abstraction matrices loaded from file. Compute the abstraction on CPU first, save to HDF5, then load for GPU synthesis. See Loading and Saving for details.