Skip to content

vulkan: fix output corruption on GCN 2.0/3.0 (Vulkan 1.2)#21787

Closed
rafikb wants to merge 1 commit into
ggml-org:masterfrom
rafikb:fix/vulkan-gcn2-sync
Closed

vulkan: fix output corruption on GCN 2.0/3.0 (Vulkan 1.2)#21787
rafikb wants to merge 1 commit into
ggml-org:masterfrom
rafikb:fix/vulkan-gcn2-sync

Conversation

@rafikb

@rafikb rafikb commented Apr 12, 2026

Copy link
Copy Markdown

Overview

This PR resolves output corruption (token repetition/double-wording) on legacy AMD GCN 2.0 and 3.0 hardware (e.g., R9 390, Fury X).

The issue was introduced in b8394 due to the implementation of modern Vulkan synchronization primitives that are not fully supported by the final legacy Adrenalin drivers (Vulkan 1.2.170). By restoring backward-compatible memory barrier logic in ggml-vulkan.cpp, we restore coherent generation for these cards without regressing performance on modern Vulkan 1.3+ hardware.

Additional information

  • Hardware Tested: Radeon R9 390 (8GB VRAM) on Windows 10.

  • Performance: Verified 22.0 t/s using gemma-4-E4B-it-Q4_K_M.gguf with 100% GPU offload.

  • Context: Many legacy 8GB cards are still highly capable for inference in 2026, but are limited by driver-level Vulkan support. This fix ensures continued accessibility for users on vintage or budget-restricted hardware.

Requirements

@rafikb rafikb requested a review from a team as a code owner April 12, 2026 02:13
@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Apr 12, 2026
@0cc4m

0cc4m commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Your hardware is not limited by the driver, on Linux you'd still have full support and the existing code would work. This is not a change we can accept, you are just reverting #20518.

@emansom

emansom commented Apr 13, 2026

Copy link
Copy Markdown

Install a recent kernel and recent Mesa, it should then default to AMDGPU on that hardware and work.

If for some reason the Vulkan behavior is indeed different, contribute a backwards compatibility to Mesa instead of here.

@szmania

szmania commented May 23, 2026

Copy link
Copy Markdown

Your hardware is not limited by the driver, on Linux you'd still have full support and the existing code would work. This is not a change we can accept, you are just reverting #20518.

Do you not support Win11? I'm in the same boat as the OP and would love to see this fixed. R9 390 8 GB VRAM on Windows 11.

@0cc4m

0cc4m commented May 23, 2026

Copy link
Copy Markdown
Contributor

Windows 11 is supported. If the current version is not working for you, then your driver is broken. You have to use a working driver to run the backend. The only driver that still provides updates and fixes for your card is Linux RADV.

@szmania

szmania commented May 23, 2026

Copy link
Copy Markdown

Windows 11 is supported. If the current version is not working for you, then your driver is broken. You have to use a working driver to run the backend. The only driver that still provides updates and fixes for your card is Linux RADV.

So your solution is to migrate to Linux with a Vulkan?

@0cc4m

0cc4m commented May 23, 2026

Copy link
Copy Markdown
Contributor

That's the easiest way. If you find a solution for your driver problem in the Vulkan backend that does not involve making the backend worse for other GPUs, that's fine, too. But this PR isn't it.

@0cc4m 0cc4m closed this May 23, 2026
@szmania

szmania commented May 23, 2026

Copy link
Copy Markdown

For future reference to anyone else getting gibberish or repeating characters with Vulkan cards, rolling back to https://github.com/ggml-org/llama.cpp/releases?q=b8393&expanded=true fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants