Skip to main content

vkpeak编译使用

vkpeak是Vulkan性能对比的测试工具,代码位于 https://github.com/nihui/vkpeak

安装依赖

sudo apt install libvulkan-dev cmake gcc g++

下载代码

 git clone https://github.com/nihui/vkpeak.git
cd vkpeak
git submodule update --init --recursive

如果您所处的地方无法访问github,可以使用以下命令下载代码:

wget https://niconiconi.us/vkpeakfull.zip
unzip vkpeakfull.zip
cd vkpeak

编译代码

mkdir build
cd build
cmake ..
make -j$(nproc)

运行

./vkpeak 0

结果类似于如下情况:

[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