Skip to content

Conversation

@yeahdongcn
Copy link
Collaborator

Make sure to read the contributing guidelines before submitting a PR

I noticed the following deprecation notice on https://packages.lunarg.com/

Deprecation Notice: LunarG will discontinue updating the Ubuntu Packages to newer SDK releases after the month of May, 2025. The Linux tarball should be used instead to keep up to date with Vulkan SDK releases.

This PR updates vulkan.Dockerfile to install the Vulkan SDK from the tarball.

Testing Done

❯ docker build -t local/llama.cpp:server-vulkan --target server -f .devops/vulkan.Dockerfile .
[+] Building 2599.0s (18/18) FINISHED                                                                                                docker:default
 => [internal] load build definition from vulkan.Dockerfile                                                                                    0.0s
 => => transferring dockerfile: 2.91kB                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                              0.0s
 => => transferring context: 35B                                                                                                               0.0s
 => [internal] load metadata for docker.io/library/ubuntu:24.04                                                                                0.0s
 => [build 1/9] FROM docker.io/library/ubuntu:24.04                                                                                            0.0s
 => [internal] load build context                                                                                                              0.4s
 => => transferring context: 3.95MB                                                                                                            0.4s
 => CACHED [build 2/9] RUN apt update && apt install -y git build-essential cmake wget xz-utils                                                0.0s
 => [build 3/9] RUN ARCH=$(uname -m) &&     wget -qO /tmp/vulkan-sdk.tar.xz https://sdk.lunarg.com/sdk/download/1.4.321.1/linux/vulkan-sdk  2314.6s
 => [build 4/9] RUN apt install -y libcurl4-openssl-dev curl     libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev                            47.6s
 => [build 5/9] WORKDIR /app                                                                                                                   0.0s 
 => [build 6/9] COPY . .                                                                                                                       1.2s 
 => [build 7/9] RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=1  -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=  199.1s 
 => [build 8/9] RUN mkdir -p /app/lib &&     find build -name "*.so" -exec cp {} /app/lib ;                                                    0.5s 
 => [build 9/9] RUN mkdir -p /app/full     && cp build/bin/* /app/full     && cp *.py /app/full     && cp -r gguf-py /app/full     && cp -r r  0.5s 
 => CACHED [base 2/3] RUN apt-get update     && apt-get install -y libgomp1 curl libvulkan-dev     && apt autoremove -y     && apt clean -y    0.0s 
 => [base 3/3] COPY --from=build /app/lib/ /app                                                                                                0.1s
 => [server 1/2] COPY --from=build /app/full/llama-server /app                                                                                 0.0s
 => [server 2/2] WORKDIR /app                                                                                                                  0.0s
 => exporting to image                                                                                                                         0.2s
 => => exporting layers                                                                                                                        0.2s
 => => writing image sha256:857b82d66ad8dd1cff7aaabad87263ccb8fe6b2d46543a8d76f5de322ff8f838                                                   0.0s
 => => naming to docker.io/local/llama.cpp:server-vulkan    

@yeahdongcn yeahdongcn requested a review from ngxson as a code owner August 13, 2025 05:31
@github-actions github-actions bot added the devops improvements to build systems and github actions label Aug 13, 2025
@yeahdongcn
Copy link
Collaborator Author

Hi @ngxson, could you please review this when you have a moment? Thanks.

@slaren slaren requested a review from 0cc4m August 20, 2025 20:59
Copy link
Collaborator

@0cc4m 0cc4m left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@0cc4m 0cc4m merged commit b55f06e into ggml-org:master Aug 23, 2025
2 checks passed
qnixsynapse pushed a commit to janhq/llama.cpp that referenced this pull request Aug 25, 2025
@ericcurtin
Copy link
Collaborator

Did you test this on aarch64 @0cc4m @yeahdongcn also? Something weird seems to happens, it appears like you pull the aarch64 one but when it's extracted there's only a x86_64 tarball in there:

0.067 + curl -L -o /tmp/vulkan-sdk.tar.xz https://sdk.lunarg.com/sdk/download/1.4.321.1/linux/vulkan-sdk-linux-aarch64-1.4.321.1.tar.xz
0.069   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
0.069                                  Dload  Upload   Total   Spent    Left  Speed
100  291M  100  291M    0     0  3426k      0  0:01:27  0:01:27 --:--:-- 3504k
87.15 + mkdir -p /opt/vulkan
87.16 + tar -xvf /tmp/vulkan-sdk.tar.xz -C /tmp --strip-components=1
87.16 1.4.321.1/vulkansdk
87.16 1.4.321.1/config/
87.16 1.4.321.1/config/vk_layer_settings.txt
87.16 1.4.321.1/README.txt
87.16 1.4.321.1/setup-env.sh
87.16 1.4.321.1/LICENSE.txt
87.16 1.4.321.1/x86_64/
87.16 1.4.321.1/x86_64/bin/
87.16 1.4.321.1/x86_64/bin/gfxrecon-extract
87.52 1.4.321.1/x86_64/bin/glslang
87.60 1.4.321.1/x86_64/bin/vulkaninfo
87.80 1.4.321.1/x86_64/bin/gfx.slang
87.80 1.4.321.1/x86_64/bin/dxl
87.80 1.4.321.1/x86_64/bin/spirv-lesspipe.sh

@0cc4m
Copy link
Collaborator

0cc4m commented Sep 18, 2025

@ericcurtin Apparently there isn't an ARM SDK available for Linux, see https://vulkan.lunarg.com/issue/view/654594145df11238996e13fe

@ericcurtin
Copy link
Collaborator

That makes me wish we did

apt install -y glslc libvulkan-dev

so we support all architectures, a lot of people use Vulkan on ARM, we oughta build for it.

I'm think people like @rhatdan @slp @kpouget could show you some interesting usage stats or experiences in general.

@0cc4m
Copy link
Collaborator

0cc4m commented Sep 18, 2025

We did that in the past, but it means people mostly use outdated versions of the packages, which leads to reduced performance due to unsupported features.

@ericcurtin
Copy link
Collaborator

Would moving to Ubuntu 25.04 just for the Vulkan image help? That way we keep aarch64 support

@0cc4m
Copy link
Collaborator

0cc4m commented Sep 18, 2025

Maybe it's possible to do that conditionally, based on the CPU arch?

@ericcurtin
Copy link
Collaborator

What features is x86_64 Ubuntu 25.04 Vulkan missing?

Could just ping the maintainer of that package also

@yeahdongcn
Copy link
Collaborator Author

This is what I use to build a cross-platform Vulkan SDK container image: https://gist.github.com/yeahdongcn/f57a37bfadcb0a607a6b0e5e710cbef2

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

Labels

devops improvements to build systems and github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants