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

Conversation

Firestar99
Copy link
Member

@Firestar99 Firestar99 commented Jun 11, 2025

While caching is enabled, it seems like github runners don't care, so we got to redownload the sdk every time.

This even speeds up CI:

  • windows: 1m19 -> 7s
  • linux: 32s -> 23s
  • mac: 35s -> 32s

@Firestar99 Firestar99 marked this pull request as ready for review June 11, 2025 09:08
@Firestar99 Firestar99 enabled auto-merge June 11, 2025 09:08
Copy link
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

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

Sweet!

@Firestar99 Firestar99 added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit fbe8893 Jun 11, 2025
13 checks passed
@Firestar99 Firestar99 deleted the install-tools-from-vulkan-sdk branch June 11, 2025 20:32
Comment on lines -33 to +37
# 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
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

# 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).

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.

3 participants