nihui / vkpeak

A tool which profiles Vulkan devices to find their peak capacities
MIT License
100 stars 3 forks source link

vkpeak

CI

A synthetic benchmarking tool to measure peak capabilities of vulkan devices. It only measures the peak metrics that can be achieved using vector operations and does not represent a real-world use case.

Download

Download Windows/Linux/MacOS Executable for Intel/AMD/Nvidia GPU

https://github.com/nihui/vkpeak/releases

Usages

vkpeak.exe 0

The only parameter 0 is the device id.

If you encounter a crash or error, try upgrading your GPU driver:

Build from Source

  1. Download and setup the Vulkan SDK from https://vulkan.lunarg.com/

    • For Linux distributions, you can either get the essential build requirements from package manager
      dnf install vulkan-headers vulkan-loader-devel
      apt-get install libvulkan-dev
      pacman -S vulkan-headers vulkan-icd-loader
  2. Clone this project with all submodules

git clone https://github.com/nihui/vkpeak.git
cd vkpeak
git submodule update --init --recursive
  1. Build with CMake
    • You can pass -DUSE_STATIC_MOLTENVK=ON option to avoid linking the vulkan loader library on MacOS
mkdir build
cd build
cmake ..
cmake --build . -j 4

Sample

[nihui@nihui-pc build]$ ./vkpeak 0
device       = GeForce RTX 2070

fp32-scalar  = 8536.18 GFLOPS
fp32-vec4    = 8473.82 GFLOPS

fp16-scalar  = 8405.30 GFLOPS
fp16-vec4    = 16261.30 GFLOPS

fp64-scalar  = 262.86 GFLOPS
fp64-vec4    = 262.86 GFLOPS

int32-scalar = 8363.63 GIOPS
int32-vec4   = 8313.07 GIOPS

int16-scalar = 5518.05 GIOPS
int16-vec4   = 7138.91 GIOPS
nihui@nihui-macbook-air vkpeak-20210424-macos % ./vkpeak 0 
device       = Apple M1

fp32-scalar  = 2093.55 GFLOPS
fp32-vec4    = 2369.02 GFLOPS

fp16-scalar  = 2195.79 GFLOPS
fp16-vec4    = 2513.04 GFLOPS

fp64-scalar  = 0.00 GFLOPS
fp64-vec4    = 0.00 GFLOPS

int32-scalar = 653.38 GIOPS
int32-vec4   = 649.56 GIOPS

int16-scalar = 653.42 GIOPS
int16-vec4   = 652.94 GIOPS

Other Open-Source Code Used