This document describes how to install all dependencies required to build GPU4S. For general information about the project, check the main README.
In order to compile the files of the project you need to have installed GCC ≥ 7. or Clang ≥ 6 in order to support C++17.
# Install on Fedora
sudo dnf install gcc-c++ clang
# Install on Ubuntu
sudo apt update
sudo apt install build-essential clang
# Check version
g++ --version
clang --versionIn order to build the project you need to install CMake ≥ 3.24
# Install on Fedora
sudo dnf install cmake
# Install on Ubuntu
sudo apt install cmake
# Check version
cmake --versionTo fetch external dependencies and CMake FetchContent modules, you need Git.
# Install on Fedora
sudo dnf install git
# Install on Ubuntu
sudo apt install git
# Check version
git --versionRequired for compiling CUDA accelerated benchmarks (.cu targets).
Tested with version: V13.2.86
# Install on Fedora (via RPM Fusion / NVIDIA repo)
sudo dnf install xorg-x11-drv-nvidia-cuda cuda-toolkit
# Install on Ubuntu
sudo apt update
sudo apt install nvidia-cuda-toolkit
# Check version
nvcc --versionAdditional lib NVIDIA cuDNN
NVIDIA CUDA Deep Neural Network library (cuDNN) is required by some of the benchmark.
Tested with V9.23.2, can be downloaded from NVIDIA website.
Installation Details
When downloading the local package installer from the NVIDIA website, select your operating system distribution:
-
Fedora: Select Linux
$\rightarrow$ x86_64$\rightarrow$ RHEL (.rpmpackage)$\rightarrow$ FULL. -
Ubuntu: Select Linux
$\rightarrow$ x86_64$\rightarrow$ Ubuntu or Debian (.debpackage)$\rightarrow$ FULL.
Fedora Installation
# Download the RPM repository package for cuDNN 9.23.2
wget https://developer.download.nvidia.com/compute/cudnn/9.23.2/local_installers/cudnn-local-repo-rhel10-9.23.2-1.0-1.x86_64.rpm
# Install the package to register it with the package manager
sudo rpm -i cudnn-local-repo-rhel10-9.23.2-1.0-1.x86_64.rpm
# Clean the DNF package manager
sudo dnf clean all
# Install the cuDNN 9 library for CUDA 13
sudo dnf -y install cudnn9-cuda-13Ubuntu Installation
# Download the local DEB package for cuDNN 9.23.2
wget https://developer.download.nvidia.com/compute/cudnn/9.23.2/local_installers/cudnn-local-repo-ubuntu2404-9.23.2_1.0-1_amd64.deb
# Install the local package to register it with APT
sudo dpkg -i cudnn-local-repo-ubuntu2404-9.23.2_1.0-1_amd64.deb
# Copy the GPG key to authenticate packages
sudo cp /var/cudnn-local-repo-ubuntu2404-9.23.2/cudnn-*-keyring.gpg /usr/share/keyrings/
# Refresh the APT package
sudo apt-get update
# Install the cuDNN 9 library for CUDA 13
sudo apt-get -y install cudnn9-cuda-13Required for compiling AMD HIP benchmarks (.cpp HIP targets).
Tested with version: 6.4.43484-9999
# Install on Fedora
sudo dnf install rocm-hip-devel rocm-runtime
# Install on Ubuntu
sudo apt update
sudo apt install hipcc rocm-dev
# Check version
hipcc --versionRequired for compiling OpenCL accelerated benchmarks (.cpp OpenCL targets).
Tested with version: OpenCL 3.0
# Install on Fedora
sudo dnf install opencl-headers ocl-icd-devel clinfo
# Install on Ubuntu
sudo apt update
sudo apt install opencl-headers ocl-icd-opencl-dev clinfo
# Check version and available devices
clinfoAdditional lib CLBlast
The tuned OpenCL BLAS library (CLBlast) is required by some benchmarks.
Tested with v1.6.3 and v1.7.0, can be downloaded from the CLBlast GitHub Releases.
Installation Details
# Install CLBlast development libraries directly via DNF
sudo dnf -y install clblast-devel# Install CLBlast development libraries directly via APT
sudo apt-get -y install libclblast-devRequired for multi-threaded CPU parallel execution (-fopenmp).
Tested with: OpenMP 4.5 (201511)
# Install runtime & development libraries on Fedora
sudo dnf install libgomp
# Install runtime & development libraries on Ubuntu
sudo apt install libomp-dev
# Check supported OpenMP version via compiler macro (_OPENMP)
echo | g++ -fopenmp -dM -E - | grep _OPENMPAdditional lib OpenBLAS
An optimized Basic Linear Algebra Subprograms (BLAS) library required by some benchmarks.
Tested with v0.3.x, can be downloaded from the OpenBLAS GitHub Releases.
Installation Details
# Install OpenBLAS development libraries directly via DNF
sudo dnf -y install openblas-devel# Install OpenBLAS development libraries directly via APT
sudo apt-get -y install libopenblas-devA C subroutine library for computing the Discrete Fourier Transform (DFT) required by some benchmarks.
Tested with v3.3.10, can be downloaded from the FFTW Official Website.
Installation Details
# Install FFTW3 development libraries directly via DNF
sudo dnf -y install fftw-devel# Install FFTW3 development libraries directly via APT
sudo apt-get -y install libfftw3-devFirst, you will need to download the Android NDK in your environment to cross-compile for Android targets.
You can use other versions of the Android NDK, but the project was built and successfully tested using NDK r27d (27.3.13750724).
Recommended installation instructions:
- Download the Android Command Line Tools
- Install them and set
ANDROID_HOMEandsdkmanagerto your bash path:
# Put default Android Studio path
# or wherever you installed it
echo 'export ANDROID_HOME=$HOME/Android/Sdk' >> ~/.bashrc
echo 'export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin' >> ~/.bashrc
source ~/.bashrc #reload bash configuration- Download your preferred version of the NDK using the
sdkmanager:
sdkmanager --install "ndk;27.3.13750724"In addition, if you want to push the binaries to your phone and execute them, you should install ADB (Android Debug Bridge).
# Ubuntu
sudo apt install android-tools-adb
# Fedora
sudo dnf install android-toolsSome benchmarks on Android will require several pre-compiled static libraries, headers, and an OpenCL stub.
In release versions, these dependencies are already pre-compiled and included under ./gpu4s_benchmark/common/android/ this version targets the following specifications:
- Target ABIs: arm64-v8a, armeabi-v7a
- Minimum Android API: 21
- Built With: Android NDK r27d
If you need to target a newer architecture (like ARMv9) or running the main repo, you can use my custom toolchains to download, compile the stub, libraries and headers:
- clblast-android-toolchain (
libclblast.aandlibOpenCL.sostub) - openblas-android-toolchain (
cblas.h,openblas_config.h, andlibopenblas.a) - fftw-android-toolchain (
libfftw3.aandlibfftw3_omp.a)
After having recompiled the libraries, you need to replace the corresponding files in the common/android/ directory with the new ones:
common/android/ ├── include/ │ ├── arm64-v8a/ │ │ ├── cblas.h * │ │ └── openblas_config.h * │ └── armeabi-v7a/ │ ├── cblas.h * │ └── openblas_config.h * └── libs/ ├── arm64-v8a/ │ ├── libOpenCL.so * │ ├── libclblast.a * │ ├── libfftw3_omp.a * │ ├── libfftw3.a * │ └── libopenblas.a * └── armeabi-v7a/ ├── libOpenCL.so * ├── libopenblas.a * ├── libfftw3_omp.a * ├── libfftw3.a * └── libopenblas.a * OpenBLAS toolchain* CLBlast toolchain* fftw3 toolchain*