Tests linking to Mesa 26.0.6 and measures its offline GPU computation power via Vulkan compute shaders.
On this device (Termux on aarch64), the GLES/EGL path defaults to the llvmpipe software renderer (CPU-based, no X display). However, Vulkan gives direct access to the hardware GPU:
- Adreno 7c+ Gen 3 (freedreno Vulkan ICD) — hardware GPU compute
- llvmpipe — software fallback
The test uses the Vulkan surfaceless platform, which works without any display server — true offline computation.
Two tests are performed:
Dispaches 1024 work items doing c[i] = a[i] + b[i]. Verifies all results match expected values (3× loop unrolling). Ensures the compute pipeline, SSBOs, and dispatch are working correctly.
Dispaches a large grid (4M work items on GPU, 64K on CPU), each running 1024 iterations of heavy FP math (sin, cos, sqrt, multiplication, addition). Reports:
- Execution time per run
- Million items processed per second
- Estimated GFLOPS (based on ~5 FP ops per iteration)
| Metric | Value |
|---|---|
| Work items | 4,194,304 |
| Inner iterations | 1,024 |
| Total FP ops (est.) | ~20 billion |
| Avg time | 0.44 s |
| Throughput | 9.50 M items/s |
| Estimated GFLOPS | 48.66 |
| Output | Deterministic, all finite |
# Build
make
# Run
./mesa_offline_compute_test
# Or build directly
gcc -o mesa_offline_compute_test mesa_offline_compute_test.c \
-I$PREFIX/include -L$PREFIX/lib -lvulkan -lmmesa(Vulkan ICDs: freedreno, swrast)vulkan-loader/vulkan-headersglslang(for SPIR-V shader compilation)xxd(to embed SPIR-V as C arrays)