Test harness: testGpuFwVulkan
testGpuFwVulkan is the firmware’s main Vulkan test battery. It is a headless
program that drives the firmware through the mainline powervr kernel
driver and Mesa, and checks every result on the CPU, pixel by pixel or
word by word. A test passes only if every fence signals within the timeout
and every value read back matches. A firmware that skips work or renders
garbage fails even when nothing faults.
It lives in its own repository, NoBlobs/testGpuFwVulkan, next to this one
(../testGpuFwVulkan), because the BXM-4-64 firmware uses the same harness. It is
written in GNU C23 for GCC, does not depend on the CPU architecture, and
comes only from the public Vulkan API and docsClean
(board-testing-oracle.md section 4).
Build and run
tools/deploy.sh testGpuFwVulkan sends the sources to the board and builds them
there; the board has GCC 14, libvulkan and glslangValidator, but no
rsync. The binary is ~/testGpuFwVulkan-clean/build/testGpuFwVulkan. The earlier
~/testGpuFwVulkan is left untouched. Run it like this:
export VK_ICD_FILENAMES=/opt/mesa-pvr/share/vulkan/icd.d/powervr_mesa_icd.riscv64.json
export PVR_I_WANT_A_BROKEN_VULKAN_DRIVER=1
~/testGpuFwVulkan-clean/build/testGpuFwVulkan -v all # every test
~/testGpuFwVulkan-clean/build/testGpuFwVulkan -j bigpb -t 2M # one test, JSON line
~/testGpuFwVulkan-clean/build/testGpuFwVulkan list
Options: --frames, --size WxH, --tris N[K|M], --iters,
--groups, --seed, --timeout, --repeat, --priority,
--device, --require-preempt, --keep-going, --json,
-v/-q. all runs every test except hwr-* and prio-*.
Exit codes:
0: pass;1: output mismatch;2: fence timeout;3: device lost;4: setup error or bad option;77: skipped.
Tests
Test (alias) |
Firmware paths |
Check |
|---|---|---|
|
TA + 3D over several frames on one framebuffer, so Mesa alternates the two HWRTData of the render target |
every pixel of every frame (per-frame colour, or a per-pixel LCG
with |
|
geometry-heavy frames: layers of tiny tiled triangles (100 K by default) |
every pixel equals the last layer’s colour for its cell |
|
compute dispatches |
every word equals |
|
|
every byte |
|
parameter-buffer OOM, grows and partial renders: 4 M triangles into
1024×1024 + stored |
every pixel equals the first layer’s colour (later layers are farther away) |
|
one render pass with two subpasses (two HWRTData); subpass 1 reads
colour + |
both colour attachments |
|
a 6-layer render target: render pass clear, per-layer
|
every pixel of every layer |
|
texture unit (address modes, borders, linear, mips); depth/stencil load; 4× render + resolve; 8 colour attachments; 1×1 … 4096×4096 and a partial render area |
every pixel (filtering and sRGB ±1) |
|
vertex/index buffers, instancing, points, lines; indirect draws and dispatches; occlusion queries and timestamps; RGB565, BGRA8, sRGB, RGBA16F, R32_UINT, blend, discard |
every pixel, word or query result |
|
4 devices at once; one long-lived device; 20 devices created and destroyed |
the checks of the tests they run |
|
stage E: a compute shader that spins forever; then |
|
|
stage E with an MMU page fault (accesses ~4 GiB past a buffer) |
as |
|
stage F: a long LOW-priority job (about 1.5 s) while HIGH-priority probes run |
every output; reports whether the probes were delayed
( |
On the host GPU of the development PC (an NVIDIA GTX 1060), every test of
all passes, and so do the prio-* tests. So the expected values are right
(E044). hwr-lockup is not run there, because it would freeze the display.
On the board, docsClean/testGpuFwVulkan-results.md gives the reference: with the
manufacturer firmware, the vendor stack passes every test it can run (38/38),
and the mainline + Mesa pvr stack gets 18 pass / 18 fail / 3 skip. Those 18
tests must pass with our firmware too; E044 compares the two
test by test.
Acceptance oracle
tools/oracle.sh uses testGpuFwVulkan for:
stage B:
multiframe,pre-ta,pre-cdm,xfer,bigpb. Each needsrc == 0(the harness’s own checks) plus the trace proofs: kick lines present and no hard failure in the new trace lines;stage B also runs
input-attachandrta;stage D:
xferfrom the suspended state;stage E (only when asked,
oracle.sh E):hwr-lockupandhwr-fault;stage F (optional,
oracle.sh F): the other tests andprio-*.
TESTGPUFWVULKAN and TESTGPUFWVULKAN_ARGS override the binary and add options.