Skip to content

docs(support): document the Vulkan GPU backend (#1029) - #1033

Merged
aittalam merged 3 commits into
mozilla-ai:mainfrom
Anai-Guo:docs-vulkan-backend-1029
Jul 31, 2026
Merged

aittalam merged 3 commits into
mozilla-ai:mainfrom
Anai-Guo:docs-vulkan-backend-1029

Conversation

@Anai-Guo

Copy link
Copy Markdown
Contributor

Problem

The GPU support section — which I contributed in #997 — says:

llamafile ships GPU acceleration for Apple Metal, NVIDIA, and AMD. There is no Vulkan or Intel oneAPI/SYCL backend...

That is wrong about Vulkan, as @polarathene points out in #1029. Vulkan landed in #892 (Feb 2026) and is a first-class backend today. My PR repeated a stale assumption; this corrects it.

What the code actually does

  • llamafile/vulkan.c loads a prebuilt ggml-vulkan.so / ggml-vulkan.dll and registers it through gpu_backend.c — the same load → suppress-logs → device-count-gate → register path as CUDA and ROCm. gpu_backend.h names Vulkan explicitly as one of the prebuilt-DSO backends.
  • llamafile_gpu_parse() in llamafile/llamafile.c accepts --gpu vulkan (alias vk), and llamafile_has_vulkan() participates in --gpu auto detection.
  • llamafile/release.sh bundles both ggml-vulkan.so and ggml-vulkan.dll into the full llamafile release; otherwise llamafile/vulkan.sh / vulkan.bat build it (already documented in docs/building_dlls.md).
  • macOS works via MoltenVK — ImportVulkanImpl() deliberately does not skip Apple Silicon, unlike CUDA.
  • Per Bug: uncaught SIGSEGV in llamafile-0.10.2 #988 the device-count gate means a Vulkan library that loads with 0 usable devices is skipped so fallback still happens, rather than blocking CPU fallback.

Changes (docs only, single file)

  • Intro sentence: Vulkan is shipped; only oneAPI/SYCL is missing.
  • Support table: added a Vulkan row (Linux/Windows/macOS, --gpu vulkan), and split the old "Intel / other" row so its "Not supported" applies to oneAPI/SYCL rather than to Vulkan — it now points readers at the Vulkan row.
  • Added a short paragraph on how the Vulkan library is located/built, the MoltenVK caveat on macOS, and the no-usable-device fallback behaviour.
  • "Verifying GPU acceleration": listed --gpu vulkan next to --gpu nvidia / --gpu amd.

I deliberately kept this to facts I could verify in the tree. The open questions from the #1023 thread (prebuilt arch/libc coverage, exact fallback ordering, .zip artifact contents) are not asserted here.

Fixes #1029

🤖 Generated with Claude Code

The GPU support section stated that llamafile has no Vulkan backend, but
Vulkan has been supported since mozilla-ai#892 (Feb 2026): llamafile/vulkan.c loads
a prebuilt ggml-vulkan.so/.dll through the same shared probe/register path
as CUDA and ROCm, llamafile_gpu_parse() accepts --gpu vulkan (alias vk),
and llamafile/release.sh bundles ggml-vulkan.so and ggml-vulkan.dll into
the full llamafile release.

Correct the intro sentence, describe how the Vulkan library is located and
built, add a Vulkan row to the support table, split the Intel row so it
refers to the missing oneAPI/SYCL backend rather than to Vulkan, and list
--gpu vulkan alongside --gpu nvidia/--gpu amd in the verification tips.

Fixes mozilla-ai#1029

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Tai An <antai12232931@outlook.com>
@Anai-Guo
Anai-Guo force-pushed the docs-vulkan-backend-1029 branch from 367465b to 82d3f9e Compare July 25, 2026 04:20
Comment thread docs/support.md Outdated
Comment on lines +44 to +47
Vulkan is loaded the same way as CUDA and ROCm: llamafile looks for a
prebuilt `ggml-vulkan.so` / `ggml-vulkan.dll` (the full `llamafile` release
bundles both) and otherwise falls back to a library you build yourself with
`llamafile/vulkan.sh` (`vulkan.bat` on Windows) — see

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies the llamafile-thin behaviour requires a user to manually intervene to ensure the backend library is built? I am not a user of llamafile and do not have a system spare that I can verify this.

My understanding was this was fully transparent to the user with llamafile-thin, assuming their system has the ability to build the backend support. The details of how this is done is described in the technical details page of the docs. As such I'm not sure if this paragraph is relevant here.

Comment thread docs/support.md Outdated
| AMD | HIP / rocBLAS | Linux, Windows | Supported | Pass `-ngl 999` to offload; multi-GPU may be broken on Radeon (see below) |
| Intel / other | — | — | Not supported | No Vulkan or SYCL backend; runs on CPU. For these, build llama.cpp directly |
| Any (incl. Intel) | Vulkan | Linux, Windows, macOS | Supported | Pass `-ngl 999` to offload; select with `--gpu vulkan`. Used in `--gpu auto` when no vendor backend is available |
| Intel / other | oneAPI / SYCL | — | Not supported | No SYCL backend; use the Vulkan row above, or build llama.cpp directly |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there's no plans to support this API AFAIK, it's probably sufficient to remove this row. If there's actual demand for it requested over the Vulkan backend by enough users, or interested users asking about such support, then there may be more value in keeping such in documentation.

The previous engagement for support was before Vulkan backend became available.

@Anai-Guo

Copy link
Copy Markdown
Contributor Author

Thanks — dropped the SYCL row in dcb1420 (the prose above the table still notes there's no oneAPI/SYCL backend, so the information isn't lost, but the table no longer advertises an unsupported target).

On the paragraph: I checked llamafile/vulkan.c and it's not thin-specific — Vulkan goes through the same llamafile_try_load_prebuilt_dso() path as CUDA/ROCm (llamafile/cuda.c:77), i.e. bundle first, then ~/.llamafile/. Neither backend compiles at runtime in current main; when nothing is found, vulkan.c prints to enable Vulkan support, build with: llamafile/vulkan.sh and the backend is skipped.

That said, your point that the how belongs in the technical docs is fair, so I reworded it to just state the lookup order and defer to Building the GPU libraries rather than naming the build script here.

@aittalam aittalam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Anai-Guo ! I rephrased the Vulkan description to make it more general (as the document itself did not provide previous info re: cuda/rocm, but aside of this I think the PR is good to go 🙏

Comment thread docs/support.md Outdated
@Anai-Guo

Copy link
Copy Markdown
Contributor Author

Thanks @aittalam — applied your rephrasing in 02cbf7e. The GPU library loading section now describes CUDA/ROCm/Vulkan together with the explicit search order and drops the Vulkan-specific framing. Good to go on my end 🙏

@aittalam
aittalam merged commit 486e6c5 into mozilla-ai:main Jul 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Vulkan backend support

3 participants