Skip to content

The Vulkan backend: Adreno and other GPUs

MTL5 runs dense float products on GPUs through Vulkan compute, with its own shaders. It was built for Qualcomm Adreno GPUs, which have no vendor BLAS, and it runs on any Vulkan 1.0 device with a compute queue. It is the fourth backend on the accelerator core, after Metal, CUDA and HIP, and follows the accelerator backend architecture. Tracked in issue 1022, under the umbrella #225.

Issue 1022 asked for the compute API to be chosen per target device, with the devices named first.

The target device is an Arduino Ventuno Q board:

  • Chip: a Qualcomm QCS8300 (“Monaco”) with an Adreno 623 GPU, 8 CPU cores and 14 GiB of memory.
  • Software: Ubuntu 24.04 with Qualcomm’s 6.8 kernel.
  • Driver: the GPU runs on the upstream msm DRM driver, so its Vulkan driver is Mesa’s Turnip: Mesa 25.2.8, Vulkan 1.3.

What that driver reports:

PropertyAdreno 623 (Turnip)
FP64 in shadersno
FP16, int64 in shadersyes
Shared memory per workgroup32 KiB
Invocations per workgroup2048
Subgroup size128
Largest storage buffer128 MiB
Memoryone 11.2 GiB heap, device-local and host-visible, with a coherent, cached type

Vulkan compute was chosen (decided 2026-12-03):

  • Qualcomm’s own OpenCL is not available. It needs Qualcomm’s kgsl kernel driver, which this board does not run.
  • The only OpenCL is Mesa’s rusticl, which is younger on Adreno than Turnip. With it, CLBlast would supply BLAS but no factorizations.
  • Either API needs MTL5’s own kernels for everything beyond BLAS. With Vulkan the products are MTL5’s shaders too.
  • Vulkan carries to the other Adreno platforms. It is the better-supported compute API on Windows on Snapdragon X and on newer Android drivers.

Nothing in the backend is specific to Adreno, so the option is named for the API, MTL5_WITH_VULKAN, and the runtime is runtime::vulkan.

Terminal window
cmake -B build -DMTL5_WITH_VULKAN=ON

It needs the Vulkan headers and loader and glslc: libvulkan-dev and glslc on Debian and Ubuntu, or the LunarG Vulkan SDK.

  • The shaders: the GLSL shaders in src/vulkan/ are compiled to SPIR-V by glslc when the library is built, and embedded in it.
  • The library: MTL5::vulkan is a static library, built from src/mtl5_vulkan.cpp. It links Vulkan::Vulkan and defines MTL5_HAS_VULKAN.
  • Without it: code built without the option is unchanged.
target_link_libraries(my_app PRIVATE MTL5::vulkan)

An installed MTL5 built with the option exports MTL5::vulkan, and its package configuration finds Vulkan for the consumer.

runtime::vulkan names memory by a buffer and a byte offset, not a pointer, as runtime::metal does. The handle is runtime::vulkan::buffer<T>.

SpaceVulkan allocationHost access
memory_space::device<runtime::vulkan>a VkBuffer, device-local where the device has itnone through MTL5
memory_space::shared<runtime::vulkan>a VkBuffer in host-visible, coherent memory, mappedyes
  • Zero-filled. Every allocation is zero-filled, so it holds only element types whose value is all-zero bytes, as on the other backends (include/mtl/memory/zero_fill.hpp).
  • Shared memory costs no copies on an integrated GPU. On the Adreno, and on any GPU that shares the CPU’s memory, it is the GPU’s own memory, mapped for the host. The host touches it only between calls: every MTL5 call waits for the GPU before it returns.
  • Device memory on a discrete GPU is memory the host cannot map, reached by staging copies. On an integrated GPU it is the same memory as shared memory, which the backend maps for its own copies only.
  • No pinned memory. Shared memory is already host memory the GPU reads in place, so pinned memory is not offered.
#include <mtl/mtl.hpp>
#include <mtl/interface/vulkan.hpp>
using shrd = mtl::memory_space::shared<mtl::runtime::vulkan>; // or shared<> in a Vulkan build
mtl::mat::dense2D<float> A = ..., B = ...;
auto sA = mtl::copy_to<shrd>(A);
auto sB = mtl::copy_to<shrd>(B);
auto sC = mtl::copy_to<shrd>(mtl::mat::dense2D<float>(A.num_rows(), B.num_cols()));
mtl::mult(sA, sB, sC); // src/vulkan/sgemm.comp
float c00 = sC(0, 0); // read in place
CallOperandsRuns as
mult(A, B, C)dense2D<float>, all in Vulkan memorysrc/vulkan/sgemm.comp, or src/vulkan/sgemm_staged.comp when neither B’s columns nor A’s rows are adjacent in memory (see the kernels below)
mult(A, x, y)dense2D<float> and dense_vector<float>, all in Vulkan memorysrc/vulkan/sgemv.comp
lu_factor(A, pivot), cholesky_factor(A)dense2D<float> in Vulkan memoryblocked: the host factors each panel, the GPU does the rest (see the factorizations below). With LAPACK linked, the host factors orders below lu_gpu_min_order and cholesky_gpu_min_order, by default every order
lu_solve, cholesky_solvethe factor or a vector in Vulkan device memorythe host routine on host copies, with x copied back. In shared memory alone the host solves in place
  • float only. The shaders compute in float, and most Adreno GPUs have no FP64, so supports<double> is false. A double (or custom-typed) container in shared memory takes the host routines; in device memory it does not compile. A non-default Accumulator (#585) never reaches the GPU either.
  • Placement follows the operands. If every operand is in Vulkan device or shared memory, in any mix, the call runs on the GPU. A pinned operand keeps the call off the GPU. The dispatch trace counts gemm_vulkan and gemv_vulkan, and for the factorizations getrf_vulkan, potrf_vulkan, getrf_vulkan_host and potrf_vulkan_host (handed to host LAPACK), getrs_vulkan and potrs_vulkan.
  • Orientation is free. Each shader addresses its operands by an element offset and a row and a column stride, so every mix of row-major and column-major operands runs without a transposed copy.
  • Synchronous. Each call submits its work and waits for it, as phase 1 of the design promises, and reports a Vulkan failure as std::runtime_error. One mutex serializes the backend’s queue, so calls from several threads are safe but do not overlap.
  • Aliasing. A product whose result shares memory with an operand goes through a temporary.
  • A failed factorization is the host’s. The factorizations work on A in place and keep a device copy of the input. A pivot that is zero or NaN (LU), or a diagonal entry that is not positive (Cholesky), stops the GPU, and the host routine factors the copy, so the return code and the contents of A are exactly the host’s. The pivots follow the host’s convention, which is also LAPACK’s.
  • sgemm: two shaders with one tile. A workgroup of 16 × 8 = 128 invocations, the most Vulkan guarantees on every device, computes a 64 × 128 tile of C. Each invocation keeps an 8 × 8 block of C in registers, so each step of the inner index loads 8 elements of A and 8 of B for 64 multiply-adds. Each element sums its products in the order of the inner index.

    • sgemm.comp reads A and B straight from their buffers, with no shared memory. It is the fast one when B’s columns are adjacent in memory: the 16 invocations of a row then read 16 adjacent elements of B.
    • sgemm_staged.comp stages 8 steps of B at a time in shared memory, loaded along whichever of its dimensions is adjacent. It runs only when B’s columns are not adjacent and A’s rows are not either.
    • The choice: a product whose B has adjacent columns runs sgemm.comp. One whose A has adjacent rows instead is computed as Cᵀ = Bᵀ Aᵀ, which has that form, and the shader writes C through its transposed strides. The rest run sgemm_staged.comp. mtl5_vulkan_sgemm_staged_submissions counts those, for tests.
    • Three builds of each: as is, with C writeonly; with ACCUMULATE, where each sum starts from the value in C, for the later parts of a long inner index; and with UPDATE, C += A B with the sums formed from 0 and added to C at the end, as BLAS’s sgemm with beta = 1 rounds, for the factorizations’ trailing updates: about 50 GFLOP/s on such an update, where ACCUMULATE ran at 45.
    • C is read through a second binding. The two builds that read C take it from binding 3, the same buffer bound readonly, and write it through binding 2, still writeonly. Read and written through one read-write binding, the Adreno ran them at 24 to 26 GFLOP/s, against 57 for the plain build. SPIR-V lets a compiler assume that two variables without the Aliased decoration do not overlap, and GLSL cannot say Aliased, so the backend adds it to both variables when it loads those builds; it cost nothing on the Adreno.
  • sgemv: one workgroup of 64 invocations computes one element of y. Each invocation sums a strided share of the row, and the partial sums are added as a tree.

  • Speed of sgemm, on the Adreno 623 (issue 1022, second part). The first shader, with a 16 × 16 tile and two elements of C per invocation, ran at about 17 GFLOP/s. A standalone harness timed variants at n = 1024 with all operands row-major:

    variantGFLOP/s
    the first shader18.5
    shared-memory tiles, 8 × 4 per invocation40
    no shared memory, 8 × 4 per invocation54
    no shared memory, 8 × 8 per invocation (sgemm.comp)69
    the same, 8 × 16 per invocation4, presumably register spills
    vec4 loads along the contiguous dimensions52
    • Orientation. Reading B directly is fast only when its columns are adjacent: with B column-major it fell to 17 GFLOP/s. Staging B in shared memory (sgemm_staged.comp) runs 44 to 51 GFLOP/s in every orientation, which is why it covers the case the transposed form cannot.
    • The GPU’s peak. A shader of independent multiply-adds runs at about 300 GFLOP/s, so sgemm.comp reaches about a quarter of it.
    • Through mult, mtl5_bench’s accel area on device memory: 64 GFLOP/s at n = 1024 and 66 at 2048, against 17.6 and 17.4 before. The board’s four Cortex-A78C cores reach 120 and 123 at those sizes with OpenBLAS (the backends page’s host row), so the CPU is still the faster one for sgemm.
  • sgemv is a first version, written for correctness and every orientation.

lu_factor and cholesky_factor are blocked and right-looking, in panels of 128 columns (mtl5_vulkan_sgetrf and mtl5_vulkan_spotrf in src/mtl5_vulkan.cpp). The host does the narrow, sequential work: pivot searches and many small steps, which a GPU runs at a submission per step. The GPU does the products, which are most of the FLOPs.

  • Panels move through cached scratch. The GPU copies each panel (saxpy2d.comp, an exact copy) into a mapped scratch buffer, where the host factors it, and copies it back. On the Adreno every memory type is host-visible, and A’s device memory is the uncached one, which the CPU reads at about 230 MB/s: reading the panels in place took 37 ms of LU’s 330 at n = 2048. The scratch buffer takes the memory a staging buffer does, which is cached there, and the allocation slot kept for one, as the panel transfers did before. The copy also serves a discrete GPU, whose device memory the host cannot map, and either order of A. Device memory’s own policy is unchanged.
  • Usually one or two submissions per panel. A recorder in the runtime puts a panel’s dispatches, each followed by a barrier, into one command buffer, where each was its own submission and wait (about 0.35 ms each on the Adreno, dozens per panel). A submission also ends where the sgemm work in it would pass the dispatch budget (see the limits below), so either phase of the look-ahead can take several. The budget counts only sgemm’s work: a submission also carries the panel’s copies, row interchanges and triangular solves, which are small beside its update, so it can run somewhat longer than one standalone sgemm submission.
  • Look-ahead. The first phase of a panel ends with the next panel’s columns updated and copied to the host, and the host waits for it. The second, the rest of the update, runs while the host factors the next panel. On the Adreno the host’s panel took about as long as the GPU’s update.

For each panel:

  • LU:
    1. The host factors the panel (rows k to n), with partial pivoting, recursively: each half of the panel’s columns is factored and applied to the other half as a small triangular solve and product. The panel then stays in cache, where a column at a time sweeps all of it once per column. Except for the first, it does so while the GPU finishes the previous panel’s update.
    2. srowperm.comp makes the panel’s interchanges in the other columns, in one pass: their net effect permutes at most 256 rows, which each workgroup moves through shared memory, 8 columns at a time.
    3. The block row, U12 = L11⁻¹ A12, by forward substitution in place (strsm.comp): the next panel’s columns in the first phase, the others in the second. Not as a product with L11’s inverse, which can lose all accuracy where the substitution does not: with L11 = [[1, 0, 0], [−1, 1, 0], [−1, −1, 1]], which partial pivoting allows, and a column [2²³, 1, −2²⁴], the inverse rounds the last entry of U to 0 instead of 1.
    4. The trailing update, A22 += (−L21) U12: sgemm’s UPDATE build, with −L21 copied from the host’s panel to scratch, where its rows are adjacent. The next panel’s columns first, then that panel to the host; the rest in the second phase.
  • Cholesky:
    1. The host factors the diagonal block, L11, in the order of MTL5’s host routine (tag::subtract_sum): each sum of products is formed, then subtracted, so a diagonal entry that should fail is not rounded to a positive one. Except for the first, it does so while the GPU finishes the previous panel’s update.
    2. The block column, L21 = A21 L11⁻ᵀ, by forward substitution in place, as L11 L21ᵀ = A21ᵀ (strsm.comp on a transposed view). saxpy2d.comp then writes W = −L21 and L21ᵀ to scratch, where their elements are adjacent.
    3. The trailing update, A22 += W L21ᵀ, in up to 4 blocks of rows, each from A22’s first column through its own diagonal block: 1 + 1/blocks times the work of the lower triangle, where the whole square would be twice. With L21ᵀ’s columns adjacent, the update runs sgemm.comp. The first block, which always covers the next diagonal block, ends the first phase, and that block goes to the host; the others are the second.
    4. The upper triangle is overwritten by those blocks, so it is copied back at the end from the input’s copy (saxpy2d.comp, above the diagonal, a plain load and store), and the factorization leaves it as it was, as the host’s does.

Speed on the Adreno 623, mtl5_bench’s accel area, in device memory, GFLOP/s:

n = 102420484096
LU on the GPU12.523.536.0
LU on the GPU, before batching and look-ahead7.117.431.1
LU, MTL5’s generic host routine5.24.33.9
LU, OpenBLAS on the four Cortex-A78C cores25.333.341.0
Cholesky on the GPU8.915.526.3
Cholesky on the GPU, before batching and look-ahead4.112.320.6
Cholesky, MTL5’s generic host routine2.32.32.2
Cholesky, OpenBLAS20.729.940.5

The GPU rows and OpenBLAS’s come from one run (2026-12-05). An earlier run measured OpenBLAS’s Cholesky at 32.2 / 40.8 / 50.7; the generic routines are from that run.

  • Where LU’s time goes now, at n = 2048 (about 220 ms): the host’s panels, 91 ms, are the critical path, with the GPU’s second phases done within them; the first phases take 47 ms; and the first panel and the input’s copy (for the host fallback) most of the rest. At n = 4096 the GPU’s update is the critical path. Cholesky’s host work is small, so its time is the GPU’s.
  • Against OpenBLAS the GPU does not win at any order the 128 MiB buffers allow (n ≤ 5792), though LU comes within 12% at n = 4096. So with LAPACK linked, lu_gpu_min_order and cholesky_gpu_min_order default to the largest std::size_t, and the host factors. A program on a GPU that wins sets them to the order where it does. mtl5_bench sets them to 0, so its device rows time the GPU in a LAPACK build too.
  • Without LAPACK the GPU always factors. Below n = 512 the two are within a few milliseconds of each other, and a matrix of one panel (n ≤ 128) is factored on the host in any case; the GPU path’s fixed cost shows most in Cholesky at n = 128, 1.4 ms against the host’s 0.4. From n = 512 the GPU is faster, and at n = 2048 and 4096 4 to 10 times faster.
  • What batching and look-ahead took: the panels’ reads from uncached memory, about 0.35 ms per submission, and the host’s panel and the GPU’s update one after the other. Moving U12’s substitution for the columns past the next panel into the second phase gained little: the GPU was then the bound.
  • What it took, at n = 2048: the first version ran LU at 11 GFLOP/s and Cholesky at 4. The read-write binding of C halved the update’s speed (above); a column-at-a-time panel spent 260 ms on the host where the recursive one spends about 100; a sequential swap shader took 5 ms per panel; and a Cholesky update by many blocks of rows took two submissions and a masked add per block. strsm.comp first solved one column per invocation, reading the solved elements back through B’s read-write binding, which halved both factorizations again; it now gives each row an invocation, which keeps its row of 16 columns in registers, and adds the products in the same order.
  • A matrix the shaders cannot bind, a buffer larger than maxStorageBufferRange, is found before the GPU changes it, and the host routine factors it, as it did before this backend factored. mtl5_vulkan_inject_fault(3) stands in for one, for tests.
  • Near the edge of definiteness, blocked differs from unblocked. Within a panel the host forms each sum and then subtracts it, as MTL5’s host routine does, but across panels each panel’s update is subtracted in turn. A matrix whose last pivot is within rounding of 0 can then pass on the GPU where the unblocked host routine rejects it, or the reverse, as with LAPACK’s blocked spotrf. Such a matrix is singular at float precision either way.
  • The panel width is 128, the fastest overall: with 64, LU at n = 4096 ran at 16 GFLOP/s, and with 96 at 22, where Cholesky was within the run-to-run spread. mtl5_vulkan_set_factor_block changes it, for tests, up to 128, the most srowperm.comp allows.
  • Buffer size. Each operand’s whole buffer is bound, so a buffer larger than the device’s maxStorageBufferRange cannot be used: 128 MiB on the Adreno 623, a 5792 × 5792 float matrix. Such a call throws std::runtime_error.
  • 32-bit indices. Sizes and offsets are passed to the shaders as 32-bit integers, which that limit already bounds.
  • Long GPU jobs. A GPU driver resets a job that runs too long: on the Adreno 623 under the msm driver, one dispatch of about a second loses the device (n = 1792 sgemm took 0.91 s and passed, n = 2048 at 1.4 s did not). So sgemm splits a product into submissions that aim at 4 GFLOP each, about 70 ms there when the tiles fill the GPU, and 0.15 to 0.25 s for a single tile. The smallest submission, one row of tiles and one step of k, can exceed that: for a product more than about 31 million columns wide, which the buffer limit below allows only for k = 1 (128 MiB holds 33.5 million floats). The device must still accept that many workgroups (maxComputeWorkGroupCount); a product that needs more is refused with std::runtime_error.
    • The work is counted as the shader does it. Every invocation of a 64 × 128 tile runs all its steps of the inner index, even past the edge of C, so a row of tiles costs 2 · 64 · (w rounded up to 128) FLOPs per step, where w is the width of the product the shader writes: C’s columns, or C’s rows when it writes Cᵀ (a column-major C, or the transposed form above). A 1 × k times k × 1 product is one workgroup running k steps, about 0.6 µs each on the Adreno: k = 2²² (4,194,304) would be one job of about 2.5 s.
    • Blocks of rows in whole tiles, as many as fit the budget, shared out evenly so the last block is not a sliver.
    • Parts of the inner index when one row of tiles is already over the budget: k is split into the fewest equal parts that fit. Each part after the first runs the shader built with ACCUMULATE, which starts each sum from the value in C, so the products are added in the same order and the result has the same bits as from one submission. The common case keeps its writeonly C, which was about 5% faster.
    • mtl5_vulkan_set_dispatch_budget changes the budget and mtl5_vulkan_sgemm_submissions counts the submissions, for tests.
  • Allocations. Each container is one Vulkan memory allocation. The device caps how many may be live (maxMemoryAllocationCount), and the backend keeps the last one for its staging transfers. When a heap runs out, the next compatible memory type is tried. Running out raises std::bad_alloc; a backend that cannot run raises std::runtime_error with Vulkan’s message.
  • Alignment. The host addresses shared memory through vkMapMemory, whose pointer Vulkan aligns to at least 64 bytes, so shared memory holds types aligned to 64 bytes or less. Device memory has no such limit.
  • Memory that runs out raises std::bad_alloc: Vulkan’s out-of-memory results, the allocation count, or a heap too small. The backend keeps working.
  • Any other failed Vulkan call raises std::runtime_error from the MTL5 call that made it, with Vulkan’s message. The backend keeps working, unless the device was lost.
  • A lost device disables the backend: later calls raise std::runtime_error, and so does host access to shared memory, whose contents Vulkan no longer guarantees. Pointers taken before the loss must not be used. Containers can still be destroyed, since Vulkan treats a lost device’s resources as no longer in use.
  • Waiting for submitted work. Every call is synchronous: when it returns, the GPU no longer touches its buffers. If waiting for the work fails, other than by losing the device, the wait is retried, and then the whole device is waited for. If either wait succeeds, the call returns normally. If neither does, the process aborts with a message rather than hand the caller shared memory the GPU might still write; this is the one failure a caller cannot catch. A factorization, which lets some submissions run while the host works, waits for all of them before it returns, on failure too.
  • A borrowed result. A result in a memory space that does not allocate (caller-owned buffers) works as any other: when it overlaps an operand, the product goes through a temporary in Vulkan device memory and is copied back.

The backend uses one Vulkan device for the whole process.

  • By default it takes the first discrete GPU, else the first integrated GPU, else the first other GPU, and only then a CPU implementation such as Mesa’s lavapipe.
  • MTL5_VULKAN_DEVICE=<i> names the device by its index in vkEnumeratePhysicalDevices order. vulkaninfo --summary lists them.
  • runtime::vulkan::device_name() says which device was chosen. runtime::vulkan::init_error() says why none could be used.

tests/unit/vulkan/ checks MTL5’s host routines against the GPU’s results for:

  • Allocations and copies, including unaligned byte copies and copies through staging buffers.
  • Every orientation of mult, at sizes across the shader’s tile edges, and operands at offsets inside a larger buffer.
  • LU and Cholesky in both orientations, in device and shared memory, across the panel edges (with 8-column panels and the default 128), in device memory the host does not map, and against the host routines: the factor, the pivots, the untouched upper triangle, and the solves. The GPU path is also called directly, so a factorization that always fell back to the host would fail. Singular, NaN and indefinite matrices return the host’s code and factor.
  • The factorizations’ submissions: how many a factorization makes (mtl5_vulkan_submissions), so the batching cannot quietly come undone; factorizations with many submissions in flight at once (a dispatch budget of one FLOP); and a submission that fails after 0 to 30 that succeed (mtl5_vulkan_inject_fault_after(4, skips)), which reports a Vulkan error and leaves the backend working.
  • The edge cases: empty dimensions and aliasing.
  • The paths that stay off the GPU: the host path for double, and pinned operands.

A test skips itself on a machine without a Vulkan device, and fails instead when MTL5_REQUIRE_VULKAN is set.

  • Failures injected. mtl5_vulkan_inject_fault makes the next memory allocation run out, the next fence reset fail with VK_ERROR_UNKNOWN, a factorization find its matrix unbindable, or a factorization’s next submission fail; mtl5_vulkan_inject_fault_after lets that many calls at the site succeed first. The tests check that running out raises std::bad_alloc, that any other failure raises std::runtime_error, and that the backend keeps working after either.
  • Device memory without the mapping. Device memory is mapped for copies where the device allows it, which on the Adreno and on lavapipe is always. The tests turn that off with mtl5_vulkan_set_device_mapping(0), so the staging-buffer and transfer-command paths a discrete GPU takes run too.
  • In CI: GitHub’s hosted runners have no GPU, but Mesa’s lavapipe implements Vulkan on the CPU. CI’s Linux x64 Vulkan (lavapipe) lane builds the library and the tests and runs them there on every PR, with MTL5_REQUIRE_VULKAN set.
  • On the board: lavapipe is not the Adreno. Timing, and how a real driver behaves, are checked on the board.

The board needs the build tools and Vulkan’s development packages:

Terminal window
sudo apt install cmake ninja-build glslc libvulkan-dev vulkan-tools
vulkaninfo --summary # should list "Adreno623" (Mesa Turnip), and llvmpipe

Then build and run the tests with gcc and with clang. Ubuntu 24.04’s clang has no clang-scan-deps, which CMake’s Ninja generator wants for C++20 targets. MTL5 uses no modules, so turn the scan off:

Terminal window
cmake -S . -B build-gcc -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ \
-DMTL5_WITH_VULKAN=ON -DMTL5_BUILD_EXAMPLES=OFF
cmake --build build-gcc -j4 --target vulkan_test_vulkan
MTL5_REQUIRE_VULKAN=1 ctest --test-dir build-gcc -R '^vulkan_' --output-on-failure
cmake -S . -B build-clang -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DMTL5_WITH_VULKAN=ON -DMTL5_BUILD_EXAMPLES=OFF
cmake --build build-clang -j4 --target vulkan_test_vulkan
MTL5_REQUIRE_VULKAN=1 ctest --test-dir build-clang -R '^vulkan_' --output-on-failure
# The same tests on the board's lavapipe, as CI runs them. Replace 1 with
# lavapipe's index from `vulkaninfo --summary` (GPU1, "llvmpipe", on the board):
MTL5_VULKAN_DEVICE=1 MTL5_REQUIRE_VULKAN=1 build-gcc/tests/unit/vulkan_test_vulkan

On 2026-12-03 all 19 test cases (226 assertions) passed on the Adreno 623 and on the board’s lavapipe, with gcc 13.3 and clang 18.

  • Faster shaders: register blocking, wider tiles, and sgemv tuned for each orientation.
  • A board session on the backends page: platform.sh --variants vulkan runs the device benchmarks; the Arduino board’s session follows once this code is on main.
  • Faster factorizations: a host panel on several cores, which is LU’s critical path at n = 2048; a faster strsm.comp; and no copy of the input where the host fallback can do without one. Whether custom number types should reach the GPU overlaps with domain flow on the KPU (#251).
  • The other Adreno targets: Windows on Snapdragon X and Android are untested.
  • macOS through MoltenVK: the backend enables Vulkan’s portability extensions when the loader and device offer them, so MoltenVK’s devices are listed and usable, but it has not been run there. Apple GPUs have the Metal backend.
  • Streams (stream<runtime::vulkan>), so calls can overlap.