Skip to content

Fix vulkan SDK install on linux/arm64#205

Merged
p1-0tr merged 1 commit intomainfrom
ps-fix-vulkan-linux-arm64
Oct 9, 2025
Merged

Fix vulkan SDK install on linux/arm64#205
p1-0tr merged 1 commit intomainfrom
ps-fix-vulkan-linux-arm64

Conversation

@p1-0tr
Copy link

@p1-0tr p1-0tr commented Oct 9, 2025

Summary by Sourcery

Fix Vulkan SDK installation on linux/arm64 by installing missing tools, adjusting extraction steps, and building the SDK on non-x86_64 architectures

Bug Fixes:

  • Add missing wget and xz-utils dependencies to support SDK download and extraction
  • Ensure correct setup of Vulkan SDK on ARM by installing build dependencies and compiling the SDK when arch is not x86_64

Enhancements:

  • Adjust tar extraction to preserve versioned directory before moving artifacts to /opt/vulkan
  • Clean up redundant TARGETARCH argument in Dockerfile

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 9, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the Vulkan SDK install process on Linux ARM64 by adding missing utilities, revising extraction steps, and introducing an on‐the‐fly SDK build path for non-x86_64 architectures; it also removes an unused build argument in the Dockerfile.

Flow diagram for updated Vulkan SDK installation process on Linux/ARM64

flowchart TD
    A["Start Vulkan SDK install"] --> B["Detect architecture (uname -m)"]
    B --> C["Install wget and xz-utils"]
    C --> D["Download Vulkan SDK tarball"]
    D --> E["Extract tarball to /tmp"]
    E --> F{"Is architecture x86_64?"}
    F -- Yes --> G["Move /tmp/x86_64/* to /opt/vulkan/"]
    F -- No --> H["Install build dependencies"]
    H --> I["Build Vulkan SDK in /tmp/<vulkan_version> with vulkansdk script"]
    I --> J["Move /tmp/<vulkan_version>/<arch>/* to /opt/vulkan/"]
    G --> K["Clean up /tmp"]
    J --> K
    K --> L["End"]
Loading

File-Level Changes

Change Details Files
Ensure tar.xz support and adjust extraction
  • Install wget and xz-utils before download
  • Remove strip-components flag and extract to a versioned temp directory
scripts/apt-install.sh
Add conditional ARM64 build workflow
  • Install non-x86_64 build dependencies
  • Run SDK builder with --no-deps and parallel jobs
  • Guard build steps with architecture check
scripts/apt-install.sh
Relocate SDK files into /opt/vulkan per architecture
  • Move extracted arch subdirectory into /opt/vulkan
  • Clean up temporary files after relocation
scripts/apt-install.sh
Remove unused build argument
  • Drop TARGETARCH ARG from Dockerfile
Dockerfile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @p1-0tr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue preventing the successful installation of the Vulkan SDK on Linux ARM64 environments. It modifies the installation script to detect the architecture and, for non-x86_64 systems, installs all required build dependencies before compiling the SDK from source. This ensures broader compatibility and correct functionality across different hardware platforms. Additionally, a minor cleanup was performed in the Dockerfile by removing an unnecessary argument.

Highlights

  • Vulkan SDK Installation Fix for ARM64: The pull request resolves an issue with installing the Vulkan SDK on Linux ARM64 systems by introducing a conditional build process for non-x86_64 architectures.
  • On-the-fly SDK Compilation: For architectures other than x86_64, the Vulkan SDK is now built directly from source within the installation script, which includes installing a comprehensive set of necessary build dependencies.
  • Dockerfile Cleanup: A redundant TARGETARCH argument has been removed from the Dockerfile, streamlining the build configuration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider using a multi‐stage build or explicitly purging the build‐time dependencies after ./vulkansdk to avoid bloating your final image.
  • Removing the TARGETARCH ARG in the Dockerfile will break the LLAMA_BINARY_PATH expansion—either reintroduce it or update the path logic accordingly.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider using a multi‐stage build or explicitly purging the build‐time dependencies after `./vulkansdk` to avoid bloating your final image.
- Removing the `TARGETARCH` ARG in the Dockerfile will break the `LLAMA_BINARY_PATH` expansion—either reintroduce it or update the path logic accordingly.

## Individual Comments

### Comment 1
<location> `scripts/apt-install.sh:27-28` </location>
<code_context>
+            clang-format qtbase5-dev qt6-base-dev
+        pushd /tmp/"${vulkan_version}"
+        # TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
+        ./vulkansdk --no-deps -j $(nproc)
+    fi
+
</code_context>

<issue_to_address>
**suggestion (bug_risk):** No error handling for build failures.

Add error checking after the build step to stop the script if the build fails.

```suggestion
        # TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
        ./vulkansdk --no-deps -j $(nproc)
        if [ $? -ne 0 ]; then
            echo "ERROR: Vulkan SDK build failed."
            exit 1
        fi
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +27 to +28
# TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
./vulkansdk --no-deps -j $(nproc)
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (bug_risk): No error handling for build failures.

Add error checking after the build step to stop the script if the build fails.

Suggested change
# TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
./vulkansdk --no-deps -j $(nproc)
# TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
./vulkansdk --no-deps -j $(nproc)
if [ $? -ne 0 ]; then
echo "ERROR: Vulkan SDK build failed."
exit 1
fi

Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
@p1-0tr p1-0tr force-pushed the ps-fix-vulkan-linux-arm64 branch from e83fcd0 to 5279c60 Compare October 9, 2025 13:11
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix the Vulkan SDK installation on linux/arm64 by adding a build-from-source step for non-x86_64 architectures. The changes in scripts/apt-install.sh correctly identify the architecture and trigger the build, but they also introduce some issues. Specifically, there's a critical bug due to a missing popd command, and the build dependencies are not uninstalled, which will lead to a significantly larger Docker image. I've provided suggestions to fix these issues and improve the script's robustness and efficiency. The change in the Dockerfile is a minor cleanup and looks good.

Comment on lines +18 to +29
if [ "$arch" != "x86_64" ]; then
# TODO: uninstall build time deps after building the SDK
apt-get install -y libglm-dev cmake libxcb-dri3-0 libxcb-present0 libpciaccess0 \
libpng-dev libxcb-keysyms1-dev libxcb-dri3-dev libx11-dev g++ gcc \
libwayland-dev libxrandr-dev libxcb-randr0-dev libxcb-ewmh-dev \
git python-is-python3 bison libx11-xcb-dev liblz4-dev libzstd-dev \
ocaml-core ninja-build pkg-config libxml2-dev wayland-protocols python3-jsonschema \
clang-format qtbase5-dev qt6-base-dev
pushd /tmp/"${vulkan_version}"
# TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
./vulkansdk --no-deps -j "$(nproc)"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current implementation for building the Vulkan SDK on non-x86_64 architectures has a few issues that should be addressed:

  • Missing popd: There's a pushd without a corresponding popd, which can cause subsequent commands to fail. This is a critical bug.
  • Build dependencies are not removed: This will significantly bloat the final Docker image. The TODO comment highlights this.
  • Missing --no-install-recommends: Using this flag with apt-get install is a best practice for Docker images to minimize their size.
  • Readability: The long list of packages can be stored in a variable to improve readability.

Here is a suggested replacement that addresses these points.

Suggested change
if [ "$arch" != "x86_64" ]; then
# TODO: uninstall build time deps after building the SDK
apt-get install -y libglm-dev cmake libxcb-dri3-0 libxcb-present0 libpciaccess0 \
libpng-dev libxcb-keysyms1-dev libxcb-dri3-dev libx11-dev g++ gcc \
libwayland-dev libxrandr-dev libxcb-randr0-dev libxcb-ewmh-dev \
git python-is-python3 bison libx11-xcb-dev liblz4-dev libzstd-dev \
ocaml-core ninja-build pkg-config libxml2-dev wayland-protocols python3-jsonschema \
clang-format qtbase5-dev qt6-base-dev
pushd /tmp/"${vulkan_version}"
# TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
./vulkansdk --no-deps -j "$(nproc)"
fi
if [ "$arch" != "x86_64" ]; then
local build_deps="libglm-dev cmake libxcb-dri3-0 libxcb-present0 libpciaccess0 \
libpng-dev libxcb-keysyms1-dev libxcb-dri3-dev libx11-dev g++ gcc \
libwayland-dev libxrandr-dev libxcb-randr0-dev libxcb-ewmh-dev \
git python-is-python3 bison libx11-xcb-dev liblz4-dev libzstd-dev \
ocaml-core ninja-build pkg-config libxml2-dev wayland-protocols python3-jsonschema \
clang-format qtbase5-dev qt6-base-dev"
apt-get install -y --no-install-recommends $build_deps
pushd /tmp/"${vulkan_version}"
# TODO: we don't need the whole SDK to run stuff, so eventually only build necessary targets here
./vulkansdk --no-deps -j $(nproc)
popd
apt-get purge -y --auto-remove $build_deps
fi

local vulkan_version=1.4.321.1
local arch
arch=$(uname -m)
apt-get install -y wget xz-utils
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change introduces an additional apt-get install command. The script now contains multiple apt-get install calls (here, for build dependencies, and for ca-certificates). For better efficiency and to optimize Docker image layers, it's recommended to consolidate all package installations into a single apt-get install command at the top of the script, right after apt-get update.

@ericcurtin
Copy link
Contributor

Does this match with how we build in the other repo?

@p1-0tr
Copy link
Author

p1-0tr commented Oct 9, 2025

Does this match with how we build in the other repo?

Yep, the only difference is here I went with building the full SDK for now. The runtime repo only builds the components that it needs.

@p1-0tr p1-0tr merged commit 85e7f27 into main Oct 9, 2025
7 checks passed
@p1-0tr p1-0tr deleted the ps-fix-vulkan-linux-arm64 branch October 9, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants