Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroGPUBench

A cross-platform FP32 compute micro-benchmark for OpenCL and Vulkan.

Build

  • make

Requirements

  • OpenCL headers and libOpenCL.so
  • Vulkan headers and libvulkan.so
  • glslangValidator (for Vulkan shader build)

Run

OpenCL:

  • ./opencl_bench --gpu
  • ./opencl_bench --cpu
  • ./opencl_bench --work-items=1048576 --iters=1048576 --chunk-iters=4096 --accum=4 --runs=5 --warmup=3

Vulkan:

  • ./vulkan_bench
  • ./vulkan_bench --device=0 --work-items=1048576 --iters=1048576 --chunk-iters=4096 --accum=4 --runs=5 --warmup=3
  • ./vulkan_bench --shader=path/to/custom.spv

Notes

  • Work items are rounded up to a multiple of the local size.
  • The shader uses 4 accumulators by default (ACCUM=4). Each iteration is one fused multiply-add per accumulator, counted as 2 FLOPs each.

Note

This can result in 2x performance reported on some systems (such as Radeon Strix Point) that can perform both steps as one operation.

  • OpenCL builds with fast-math flags enabled for peak throughput.
  • Shader compilation uses basic SPIR-V generation flags for compatibility across glslangValidator versions.
  • chunk-iters splits the total iterations into smaller dispatches to avoid GPU watchdog timeouts and device loss.
  • Use --accum to select 1-1024 accumulators per work-item.

About

A cross-platform FP32 compute micro-benchmark for OpenCL and Vulkan.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages