This document describes how to build and install GPUBench on your system.
At least one of the following compute backends must be available:
- Vulkan: Vulkan SDK with
glslccompiler - OpenCL: OpenCL development libraries
- ROCm: AMD ROCm with HIP support
git clone <repository-url>
cd GPUBench
mkdir build && cd buildLinux (default prefix: /usr/local):
cmake ..Linux (custom prefix):
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/installWindows:
cmake .. -DCMAKE_INSTALL_PREFIX="C:\Program Files\GPUBench"make -j$(nproc)On Windows, use:
cmake --build . --config ReleaseLinux (from the build directory):
sudo make installWindows (run as Administrator from the build directory):
cmake --build . --target install --config ReleaseNote: All commands in steps 2-4 should be run from the build directory.
The installation creates the following structure:
<PREFIX>/
├── bin/
│ └── gpubench # The executable
└── share/gpubench/
└── kernels/
├── vulkan/ # Compiled SPIR-V shaders (*.spv)
├── opencl/ # OpenCL source files (*.cl)
└── rocm/ # Compiled HIP objects (*.o)
- Linux:
/usr/local - Windows:
C:\Program Files\GPUBench
After installation, you can run GPUBench from anywhere:
# List available benchmarks
gpubench --list-benchmarks
# Run all benchmarks
gpubench
# Run specific benchmarks
gpubench -b FP32,FP64
# List available devices
gpubench --list-devices
# Run on a specific device
gpubench -d 0 -b FP32GPUBench searches for kernel files in the following order:
- Environment variable
GPUBENCH_KERNEL_PATH(if set) - Installed location:
<PREFIX>/share/gpubench/kernels - Development fallback:
./kernels(relative to working directory)
You can override the kernel path using an environment variable:
export GPUBENCH_KERNEL_PATH=/custom/path/to/kernels
gpubench -b FP32This is useful for:
- Testing modified kernels
- Running from a non-standard installation
- Development and debugging
To uninstall GPUBench:
Linux:
cd build
sudo make uninstallOr manually remove:
sudo rm /usr/local/bin/gpubench
sudo rm -rf /usr/local/share/gpubenchWindows: Delete the installation directory:
C:\Program Files\GPUBench
For development, you can build without installing:
mkdir build && cd build
cmake ..
make -j$(nproc)
./gpubench --list-benchmarksThe binary will automatically use the ./kernels directory in the source tree.
If you see this warning, GPUBench couldn't locate the kernel files. Check:
- The binary is installed correctly
- Kernel files exist in
<PREFIX>/share/gpubench/kernels - Try setting
GPUBENCH_KERNEL_PATHenvironment variable
Ensure at least one compute backend is installed:
- Vulkan: Install Vulkan SDK from https://vulkan.lunarg.com/
- OpenCL: Install OpenCL development packages (e.g.,
ocl-icd-opencl-devon Debian/Ubuntu) - ROCm: Install AMD ROCm from https://rocm.docs.amd.com/
On Linux, use sudo for system-wide installation:
sudo make installOr use a prefix in your home directory:
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local
make installThen add $HOME/.local/bin to your PATH.
- Recommended prefix:
/usr/localor$HOME/.local - May need to add installation directory to PATH
- No special requirements
- Recommended prefix:
C:\Program Files\GPUBench - Requires Administrator privileges for installation
- Add installation directory to system PATH for easy access
You can disable backends by not installing their dependencies:
# Build with only Vulkan
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
# CMake will automatically detect available backendsThe build system will automatically detect and enable available backends.
GPUBench supports creating pre-packaged Windows binaries and installers. See packaging/windows/README.md for detailed instructions.
Quick start:
# Automated build script (recommended)
.\packaging\windows\build_package.ps1
# Or manually:
mkdir build-release
cd build-release
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="GPUBench"
cmake --build . --config Release
# Create ZIP package
cpack -G ZIP -C Release
# Create NSIS installer (requires NSIS)
cpack -G NSIS -C ReleaseOutput:
GPUBench-1.0.0-win64.zip- Portable ZIP archiveGPUBench-1.0.0-win64.exe- NSIS installer (if NSIS is installed)
GPUBench supports creating DEB and RPM packages:
mkdir build-release
cd build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
# Create DEB package (Debian/Ubuntu)
cpack -G DEB
# Create RPM package (Fedora/RHEL)
cpack -G RPM
# Create tarball
cpack -G TGZOutput:
GPUBench-1.0.0-Linux.debGPUBench-1.0.0-Linux.rpmGPUBench-1.0.0-Linux.tar.gz
mkdir build-release
cd build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
# Create DMG installer
cpack -G DragNDrop
# Create tarball
cpack -G TGZFor more information on packaging, see:
- Windows packaging:
packaging/windows/README.md - CPack documentation: https://cmake.org/cmake/help/latest/module/CPack.html