# PowerVR B-Series Vulkan driver 1.15@6133110: ten behaviours observed on BXM-8-256
Report prepared for Imagination Technologies / MediaTek driver teams. Each item has the
observed symptom, how it was isolated, a minimal description of the triggering API usage, and
the workaround an application can apply. Items 1–4 and 8–10 are crashes or faults inside the
driver; 5–7 are conformance questions.
## Environment
| | |
| — | — |
| SoC | MediaTek Dimensity 7020 (MT6855) |
| GPU | Imagination PowerVR BXM-8-256 |
| Driver | `PowerVR B-Series Vulkan Driver 1.15@6133110` (`vulkan.mtk.so`, `libsrv_um.so`, `libufwriter.so`) |
| Vulkan | device `apiVersion` 1.1.170, 86 device extensions, `maxMemoryAllocationSize` 1 GiB |
| Loader | Android `libvulkan` reporting 1.3.0 (loader version, not the driver’s) |
| Device | Infinix Note 40 Pro+ (X6851B) |
| Workload | a large Vulkan 1.1 renderer: ~330 graphics/compute pipelines, ~690 draws per frame, 2× MSAA colour+depth passes at 854×480, compute passes, descriptor-heavy |
Each item can be reproduced with the application that found it; smaller repro cases are
described where the triggering usage is known.
—
### 1. Heap corruption in `vkCmdPushDescriptorSetKHR`
- **Symptom.** SIGSEGV at wild negative addresses inside `vkCmdEndRenderPass` on the recording
thread; later scudo “header corruption” aborts from `vkBeginCommandBuffer`; with helper passes
pushing directly, a scudo abort inside `PVRSRVFreeDeviceMemMIW`.
- **Evidence.** bionic `malloc_debug` (`LIBC_DEBUG_MALLOC_OPTIONS=guard=64`) reports
`ALLOCATION … SIZE 48 HAS A CORRUPTED REAR GUARD`; the overflowing write comes from the
driver’s own `realloc` path reached from `vkCmdPushDescriptorSetKHR`.
- **Trigger.** Pushing a set of 10–20 descriptors (combined image samplers, storage buffers,
uniform buffers) per draw, several hundred draws per command buffer.
- **Workaround.** `vkUpdateDescriptorSets` + `vkCmdBindDescriptorSets`; the extension is
advertised but not used.
### 2. Shader compiler aborts the process on `OpDemoteToHelperInvocation`
- **Symptom.** `vkCreateGraphicsPipelines` → `libufwriter.so` `BILParseStream` → `abort()`
(exit 134) instead of `VK_ERROR_*`.
- **Trigger.** A SPIR-V module declaring `SPV_EXT_demote_to_helper_invocation` on a device that
does not advertise `VK_EXT_shader_demote_to_helper_invocation`. Arguably application error,
but the driver should fail the call, not the process.
- **Workaround.** Emit `OpKill` when the extension is absent.
### 3. SIGSEGV in `vkCreateGraphicsPipelines` with a trailing `VK_ATTACHMENT_UNUSED` colour reference
- **Symptom.** Fault at `vulkan.mtk.so+0x61168`, wild address.
- **Trigger.** A render pass whose subpass has `colorAttachmentCount = 1` with
`pColorAttachments[0].attachment = VK_ATTACHMENT_UNUSED`, used with a fragment shader that
writes no colour output. Valid per spec (unused references are legal).
- **Isolation.** The only pipeline in a trace of ~110 with an unused colour slot was the one
that crashed.
- **Workaround.** Drop trailing unused colour references from both the subpass and the pipeline
(compatible by the shorter-array padding rule).
### 4. `vkAllocateDescriptorSets` returns `VK_ERROR_OUT_OF_DEVICE_MEMORY` for an exhausted pool
- **Symptom.** With a pool created for N sets, allocation N+1 returns
`OUT_OF_DEVICE_MEMORY` rather than `VK_ERROR_OUT_OF_POOL_MEMORY`.
- **Note.** Permitted by the spec, but applications that distinguish the two codes treat this as
a real memory failure. Returning `OUT_OF_POOL_MEMORY` would help.
- **Workaround.** Rotate pools on both codes.
### 5. Render-pass load and blend use the image’s format, not the attachment view’s
- **Symptom.** An `R8G8B8A8_UNORM` image view used as a colour attachment of an
`R8G8B8A8_SRGB` image (created with `VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT`): the store honours
the view (linear bytes written), but `LOAD_OP_LOAD` and blending in later passes decode the
existing bytes as sRGB. The reverse case (sRGB view on a UNORM image) behaves the same way.
- **Evidence.** Per-pass image dumps: a frame-buffer mean value decayed 7.8 → 3.5 → 1.3 → 0.8 →
0.6 across five passes that each loaded and blended onto it, exactly the sRGB-decode-per-pass
curve. With a backing image created in the view’s format the values are stable.
- **Trigger.** Mutable-format image, attachment view in the sibling UNORM/sRGB format, a pass
with `loadOp = LOAD` or blending enabled.
- **Workaround.** Keep a second backing image created directly in the view’s format and copy
the bytes with `vkCmdCopyImage` before binding it as an attachment.
### 6. Intermittent SIGSEGV inside `vkCmdDrawIndexed` when recording from a worker thread
- **Symptom.** Fault at `vulkan.mtk.so+0x79db4` on the recording thread, every few runs, never
in ~10 runs when recording on the submitting thread.
- **Trigger.** Command buffers recorded on a second thread from a dedicated command pool
(externally synchronised per spec), while another thread updates descriptor sets not referenced
by that command buffer.
- **Status.** Not isolated further. Possibly the driver reading descriptor or image state that is
being updated by another thread for unrelated sets.
- **Workaround.** Record on the submitting thread.
### 7. The shader compiler is not thread-safe across `VkDevice` calls
- **Symptom.** Null dereference in `libufwriter.so` `BILParseStream` (`+0xac5ce8`) when
`vkCreateGraphicsPipelines` is called from two threads at once (three pipelines in flight in
the trace). Both calls use distinct `VkPipelineCache` objects.
- **Trigger.** Concurrent pipeline creation, which the spec allows.
- **Workaround.** Serialise `vkCreateShaderModule` and `vkCreate{Graphics,Compute}Pipelines`
behind one mutex.
### 8. `vkCreateComputePipelines` faults when the pipeline cache was seeded with saved data
- **Symptom.** Deterministic null dereference at `vulkan.mtk.so+0x766ac` inside
`vkCreateComputePipelines`, same point on every launch.
- **Trigger.** `vkGetPipelineCacheData` from a previous process (header valid: size 32,
version 1, matching vendor/device ID and `pipelineCacheUUID`), passed as `pInitialData` to
`vkCreatePipelineCache`; the first compute pipeline whose key is present in that data faults.
Graphics pipelines restore from the same data correctly (5 ms each vs. a full compile).
- **Workaround.** A separate, never-seeded `VkPipelineCache` for compute pipelines.
### 9. `vkCmdBeginRendering` entry points are null function pointers
- **Symptom.** `vkGetDeviceProcAddr(…, “vkCmdBeginRenderingKHR”)` returns a non-null pointer
that jumps to address 0 when called.
- **Note.** The device does not advertise `VK_KHR_dynamic_rendering`, so applications must not
call it; but a null-jumping stub is harder to diagnose than a null pointer.
### 10. Missing features that force emulation (information, not bugs)
- `textureCompressionBC = 0`: no BC1–7. Applications decode on the GPU to RGBA8/RG8/R8
(4–8× memory).
- `sparseBinding = 0`, no sparse queue; `vkGetBufferDeviceAddress` fails on an unbound sparse
buffer.
- Depth formats and `R32_SFLOAT` not linearly filterable (`optimalTilingFeatures` lack
`SAMPLED_IMAGE_FILTER_LINEAR`).
- No `VK_KHR_pipeline_binary`; the driver’s own `VkPipelineCache` data does round-trip for
graphics pipelines (see 8), which is what applications must rely on for startup time
(84 s → 19 s with persisted cache data in this workload).
—
## Reproduction tooling available on request
- A host-side script that queries `cmd gpu vkjson` and lists the device’s features, extensions
and format support against a requirement table.
- Per-pass image dumps and a text frame capture (render-pass shapes, pipelines, sampled views)
that isolated items 3 and 5.
- Symbolised native stack traces (`ndk-stack`) for items 1, 3, 6, 7 and 8.
Contact: via sie9hart · GitHub