GPUBenchmark is a cross-platform GPU benchmarking tool written in C++. It supports many different GPUGPU backends, including:
- NVIDIA CUDA
- AMD HIP (though it SAYS it works on NVIDIA too...)
- OpenCL
- Vulkan
The benchmark suite includes a variety of tests to evaluate GPU performance and capabilities. This one executable can run all kinds of tests on all kinds of GPUs, provided you have the right drivers installed.
This project uses CMake for building, but realistically you could use literally any C++ compiler you'd like. For this project, however, a CMakeLists.txt file already exists so we will use that for now.
Please note that all libraries are loaded dynamically, at runtime. This means that you can still compile and run the program even if you don't have all of the prerequisites installed. This also means that if you want to add or remove a library later, you do not have to recompile the code. (Although you probably should!)
CMake version 3.25 or higher. A C++17 compiler. CUDA/NVML Drivers for NVIDIA CUDA support. HIP/RSMI Drivers for AMD HIP support. OpenCL for OpenCL backend support. Vulkan SDK for Vulkan backend support.
Note: When installing all of these, make sure that they are added to PATH where applicable.
- CMake: Download and install CMake from the official website.
- CUDA: Download and install the CUDA Toolkit from the NVIDIA website.
- HIP: Download and install the AMD ROCm toolkit from the AMD website.
- Vulkan SDK: Download and install the Vulkan SDK from the LunarG website.
- OpenCL: OpenCL is typically included with your GPU drivers. Ensure you have the latest drivers installed for your GPU.
Apple and NVIDIA hate each other, and modern AMD GPU support is non-existent in favor of modern Apple Silicon on Metal. This means that the only backends that work is Vulkan and OpenCL (which is now deprecated, but still available).
This project attempts to use CUDA/HIP drivers, but realistically they never will. But just know I was thinking of you Mac users!
OpenCL support on Apple Silicon still exists though, so that backend should work fine (despite it being version 1.2). OpenCL is automatically included with macOS.
sudo apt update
sudo apt install cmake build-essential nvidia-cuda-toolkit rocm-dev vulkan-sdksudo dnf install cmake gcc-c++ cuda vulkan-sdk rocm-dev(I, SovietPancakes, use Arch btw, so I can confirm that this works. I kind of BS'd the other ones tho ngl)
sudo pacman -Syu cmake gcc cuda rocm-hip-sdk vulkan-icd-loader vulkan-headers ocl-icd opencl-headersFor Vulkan suport, you may need to install additional packages depending on your GPU vendor: Source: Arch Linux Wiki
- AMD:
vulkan-radeon(orlib32-vulkan-radeon) - Intel:
vulkan-intel(orlib32-vulkan-intel) - NVIDIA: there are two implementations:
nvidia-utils(orlib32-nvidia-utils) - NVIDIA proprietaryvulkan-nouveau(orlib32-vulkan-nouveau) - NVK (part of Mesa project)
For OpenCL support, you may need to install additional packages depending on your GPU vendor: Source: Arch Linux Wiki
- AMD:
rocm-opencl-runtime,rocm-opencl-sdk - Intel:
intel-compute-runtime - NVIDIA:
opencl-nvidia
- Get a copy of the source code. You can use the Git CLI or the big fat "Code" button on GitHub.
git clone https://github.com/TheSovietPancakes/GPUBenchmark.git
cd GPUBenchmark- Setup CMake build files and compile the project.
mkdir build
cmake -S . -B build
cmake --build build- Assuming you did not get any errors, the final executable will be in the
builddirectory. Run it via:
# On Windowsa
.\build\gpumark.exe
# On everything else
./build/gpumarkNote that the executable must be run from the terminal. There is no GUI.
The program ignores all command line arguments. Follow the instructions in the terminal after launching the program to use.