google / google/shaderc

ollama fails to compile: shaderc: internal error: compilation succeeded but failed to optimize: Invalid capability operand: 5447

Open
#1,590 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
445
Avg merge
11h 6m
Merged PRs (30d)
6

Description

```
cannot compile flash_attn_f32_f16_f16acc_cm2 (exit code 1)

/usr/local/bin/glslc -fshader-stage=compute --target-env=vulkan1.3 /wrkdirs/usr/ports/misc/ollama/work/llama.cpp-b10091/ggml/src/ggml-vulkan/vulkan-shaders/flash_attn_cm2.comp -o /wrkdirs/usr/ports/misc/ollama/work/github.com/yurivict/ollama@v0.32.5/build/llama-server-vulkan/_deps/llama_cpp-build/ggml/src/ggml-vulkan/vulkan-shaders.spv/flash_attn_f32_f16_f16acc_cm2.spv -O -DACC_TYPE=float16_t -DACC_TYPEV2=f16vec2 -DACC_TYPEV4=f16vec4 -DACC_TYPE_MAX=float16_t(65504.0) -DD_TYPE=float -DD_TYPEV4=vec4 -DFLOAT16=1 -DFLOAT_TYPE=float16_t -DFLOAT_TYPEV2=f16vec2 -DFLOAT_TYPEV4=f16vec4 -DFLOAT_TYPE_MAX=float16_t(65504.0) -DQ_TYPE=float

shaderc: internal error: compilation succeeded but failed to optimize: Invalid capability operand: 5447
```

[ollama-build.log](https://pkg-status.freebsd.org/beefy23/data/150amd64-default/21e0e5c9488a/logs/errors/ollama-0.32.5.log)

Version: 2026.3
FreeBSD 15.1

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the logged glslc command, flash_attn_cm2.comp shader, and shaderc optimizer on FreeBSD 15.1. Start with the ollama-build.log invocation and the reported capability operand 5447, then trace the shaderc/glslc compilation path. Done means the shader compiles and produces the expected SPIR-V output without the optimizer error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.