Skip to content

ci: replace spirv-tools prebuilds with vulkan sdk from lunarg #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/install-spirv-tools/Cargo.toml

This file was deleted.

109 changes: 0 additions & 109 deletions .github/install-spirv-tools/src/main.rs

This file was deleted.

45 changes: 25 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ jobs:
RUSTUP_IO_THREADS: "1"
steps:
- uses: actions/checkout@v4
# Install the spirv-tools binaries from tarballs hosted on each release
# of spirv-tools. This downloads the tarball, decompresses it, unpacks
# the binaries to the specified path, and adds them to PATH
- name: Install spirv-tools binaries
shell: bash
run: cargo run --manifest-path .github/install-spirv-tools/Cargo.toml -- ${{matrix.host || matrix.target}} 0.10.0 "${{github.workspace}}/bin"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we know if "${{github.workspace}}/bin" is enough to induce caching?
Looking at the docs, it seems like explicitly using actions/cache may have been needed to get any caching?
(and we don't seem to use actions/cache anywhere atm)

It might be worth trying to cache $RUSTUP_HOME (~/.rustup unless it's explicitly set ig?) and even target/{debug,release}/incremental but that could become sketchy territory (ideally only main branch CI runs could save such caches, and then PR CI runs would use the latest one? unsure if that's doable tho).

- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
Comment on lines -33 to +37
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hah, this seems to be the same thing SPIR-T uses, I found a bit awkward sometimes due to the build times, but I suppose if you couldn't get caching to work... hmm

Copy link
Member Author

Choose a reason for hiding this comment

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

Interestingly, this page shows caches: https://github.com/Rust-GPU/rust-gpu/actions/caches

But it doesn't reduce CI time, the install action is run regardless

Copy link
Member Author

Choose a reason for hiding this comment

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

cache (optional; default=false): boolean indicating whether to cache the downloaded installer file between builds.

It helps to read... it reinstalls the vulkan sdk every time, which is why it's "slow". And looking at their action file, it's using:

  • windows (8s): 7z which is multithreaded by default
  • linux (25s): single-threaded tar with zstd
  • mac (39s): just calls the installer

https://github.com/humbletim/install-vulkan-sdk/blob/30ba978f977e81b72d091fc8888feb1fb26f9aff/vulkan_prebuilt_helpers.sh#L42-L77

- if: ${{ runner.os == 'Linux' }}
name: Linux - Install native dependencies
run: sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
Expand Down Expand Up @@ -91,12 +90,11 @@ jobs:
RUSTUP_IO_THREADS: "1"
steps:
- uses: actions/checkout@v4
# Install the spirv-tools binaries from tarballs hosted on each release
# of spirv-tools. This downloads the tarball, decompresses it, unpacks
# the binaries to the specified path, and adds them to PATH
- name: Install spirv-tools binaries
shell: bash
run: cargo run --manifest-path .github/install-spirv-tools/Cargo.toml -- ${{matrix.host || matrix.target}} 0.10.0 "${{github.workspace}}/bin"
- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
# cargo version is a random command that forces the installation of rust-toolchain
- name: install rust-toolchain
run: cargo version
Expand Down Expand Up @@ -142,9 +140,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install spirv-tools binaries
shell: bash
run: cargo run --manifest-path .github/install-spirv-tools/Cargo.toml -- ${{matrix.target}} 0.10.0 "${{github.workspace}}/bin"
- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
# cargo version is a random command that forces the installation of rust-toolchain
- name: install rust-toolchain
run: cargo version
Expand All @@ -167,9 +167,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install spirv-tools binaries
shell: bash
run: cargo run --manifest-path .github/install-spirv-tools/Cargo.toml -- ${{matrix.target}} 0.10.0 "${{github.workspace}}/bin"
- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
- if: ${{ runner.os == 'Linux' }}
name: Linux - Install native dependencies
run: sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
Expand Down Expand Up @@ -212,8 +214,11 @@ jobs:
submodules: "false"
- name: Install native dependencies
run: sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
- name: Install spirv-tools
run: cargo run --manifest-path .github/install-spirv-tools/Cargo.toml -- x86_64-unknown-linux-gnu 0.10.0 "${{github.workspace}}/bin"
- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
- name: Install rustup components
run: rustup component add rustfmt clippy
# cargo version is a random command that forces the installation of rust-toolchain
Expand Down