Skip to content

[Vulkan] Assertion failure in ggml-vulkan.cpp during vision/image processing on Windows #22516

@mamama1

Description

@mamama1

Name and Version

version: 8966 (7b8443a)
built with Clang 19.1.5 for Windows x86_64

Operating systems

Windows

GGML backends

Vulkan

Hardware

E5-2640 v4
Intel Arc Pro B70

Models

gemma-4-26B-A4B-it-UD-Q4_K_M
gemma-4-26B-A4B-it-UD-Q6_K_XL

Problem description & steps to reproduce

I am encountering a crash when using multimodal/vision models (e.g., Gemma-4) with the Vulkan backend on Windows. The error appears to be an assertion failure related to tensor alignment.

Error Message:
ggml-vulkan.cpp:1974: GGML_ASSERT(!src0 || get_misalign_bytes(ctx, src0) == 0) failed

Environment:

  • OS: Windows (crashes) / Linux (works fine)
  • Backend: Vulkan
  • Model Type: Multimodal/Vision (e.g., Gemma-4)
  • Quantization: Observed with both Q4_K_M and Q6_K_XL

Observations:
The issue seems specific to the Windows environment. When running the same version of llama.cpp on Linux with the Vulkan backend, the vision/image decoding tasks complete without issue.

Potential Hypothesis:
It is possible that the assertion in init_pushconst_tensor_offsets is being triggered by a discrepancy in how Vulkan drivers report minStorageBufferOffsetAlignment across different operating systems.

In vision tasks, the model often operates on tensor "views" or slices of larger buffers. If the Windows driver reports a larger minimum alignment requirement than the Linux driver, these unaligned views might be triggering the GGML_ASSERT in ggml-vulkan.cpp.

It might be worth investigating whether the backend can support these unaligned views (perhaps by using aligned base offsets combined with push-constant-driven element offsets) or if the assertion is perhaps too strict for the variety of tensor views generated during multimodal processing.

First Bad Commit

No response

Relevant log output

Logs
ggml-vulkan.cpp:1974: GGML_ASSERT(!src0 || get_misalign_bytes(ctx, src0) == 0) failed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions