From a0811a1c3c6a1ccda582c83bf64f93f88b93e285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Tue, 30 Sep 2025 12:46:23 +0200 Subject: [PATCH 01/26] set docker buildkit cache mode to min --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 446c666b90ef3..1bde69f6c729f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -132,7 +132,7 @@ jobs: provenance: false # using github experimental cache cache-from: type=gha - cache-to: type=gha,mode=max + cache-to: type=gha,mode=min # return to this if the experimental github cache is having issues #cache-to: type=local,dest=/tmp/.buildx-cache #cache-from: type=local,src=/tmp/.buildx-cache @@ -151,7 +151,7 @@ jobs: provenance: false # using github experimental cache cache-from: type=gha - cache-to: type=gha,mode=max + cache-to: type=gha,mode=min # return to this if the experimental github cache is having issues #cache-to: type=local,dest=/tmp/.buildx-cache #cache-from: type=local,src=/tmp/.buildx-cache @@ -170,7 +170,7 @@ jobs: provenance: false # using github experimental cache cache-from: type=gha - cache-to: type=gha,mode=max + cache-to: type=gha,mode=min # return to this if the experimental github cache is having issues #cache-to: type=local,dest=/tmp/.buildx-cache #cache-from: type=local,src=/tmp/.buildx-cache From efb851315f33cdb83306ba535abdfb1c888f54d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Tue, 30 Sep 2025 19:40:29 +0200 Subject: [PATCH 02/26] go back to local cache --- .github/workflows/docker.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1bde69f6c729f..09bfe4e07e46c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -131,11 +131,11 @@ jobs: target: full provenance: false # using github experimental cache - cache-from: type=gha - cache-to: type=gha,mode=min + #cache-from: type=gha + #cache-to: type=gha,mode=min # return to this if the experimental github cache is having issues - #cache-to: type=local,dest=/tmp/.buildx-cache - #cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache - name: Build and push Light Docker image (tagged + versioned) if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.light == true }} @@ -150,11 +150,11 @@ jobs: target: light provenance: false # using github experimental cache - cache-from: type=gha - cache-to: type=gha,mode=min + #cache-from: type=gha + #cache-to: type=gha,mode=min # return to this if the experimental github cache is having issues - #cache-to: type=local,dest=/tmp/.buildx-cache - #cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache - name: Build and push Server Docker image (tagged + versioned) if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.server == true }} @@ -169,11 +169,11 @@ jobs: target: server provenance: false # using github experimental cache - cache-from: type=gha - cache-to: type=gha,mode=min + #cache-from: type=gha + #cache-to: type=gha,mode=min # return to this if the experimental github cache is having issues - #cache-to: type=local,dest=/tmp/.buildx-cache - #cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache create_tag: name: Create and push git tag From 1c6d3490de90a27f8021fbe66fcf7b2c509e65da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Wed, 1 Oct 2025 10:02:53 +0200 Subject: [PATCH 03/26] use registry cache --- .github/workflows/docker.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 09bfe4e07e46c..f73a2bc9f458b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -89,12 +89,15 @@ jobs: TYPE="-${{ matrix.config.tag }}" fi PREFIX="ghcr.io/${REPO_OWNER}/${REPO_NAME}:" + CACHETAGS="${PREFIX}buildcache${TYPE}" FULLTAGS="${PREFIX}full${TYPE},${PREFIX}full${TYPE}-${{ steps.srctag.outputs.name }}" LIGHTTAGS="${PREFIX}light${TYPE},${PREFIX}light${TYPE}-${{ steps.srctag.outputs.name }}" SERVERTAGS="${PREFIX}server${TYPE},${PREFIX}server${TYPE}-${{ steps.srctag.outputs.name }}" + echo "cache_output_tags=$CACHETAGS" >> $GITHUB_OUTPUT echo "full_output_tags=$FULLTAGS" >> $GITHUB_OUTPUT echo "light_output_tags=$LIGHTTAGS" >> $GITHUB_OUTPUT echo "server_output_tags=$SERVERTAGS" >> $GITHUB_OUTPUT + echo "cache_output_tags=$CACHETAGS" # print out for debugging echo "full_output_tags=$FULLTAGS" # print out for debugging echo "light_output_tags=$LIGHTTAGS" # print out for debugging echo "server_output_tags=$SERVERTAGS" # print out for debugging @@ -132,10 +135,13 @@ jobs: provenance: false # using github experimental cache #cache-from: type=gha - #cache-to: type=gha,mode=min + #cache-to: type=gha,mode=max # return to this if the experimental github cache is having issues - cache-to: type=local,dest=/tmp/.buildx-cache - cache-from: type=local,src=/tmp/.buildx-cache + #cache-to: type=local,dest=/tmp/.buildx-cache + #cache-from: type=local,src=/tmp/.buildx-cache + # using registry cache (no storage limit) + cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }} + cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max - name: Build and push Light Docker image (tagged + versioned) if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.light == true }} @@ -151,10 +157,13 @@ jobs: provenance: false # using github experimental cache #cache-from: type=gha - #cache-to: type=gha,mode=min + #cache-to: type=gha,mode=max # return to this if the experimental github cache is having issues - cache-to: type=local,dest=/tmp/.buildx-cache - cache-from: type=local,src=/tmp/.buildx-cache + #cache-to: type=local,dest=/tmp/.buildx-cache + #cache-from: type=local,src=/tmp/.buildx-cache + # using registry cache (no storage limit) + cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }} + cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max - name: Build and push Server Docker image (tagged + versioned) if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.server == true }} @@ -170,10 +179,13 @@ jobs: provenance: false # using github experimental cache #cache-from: type=gha - #cache-to: type=gha,mode=min + #cache-to: type=gha,mode=max # return to this if the experimental github cache is having issues - cache-to: type=local,dest=/tmp/.buildx-cache - cache-from: type=local,src=/tmp/.buildx-cache + #cache-to: type=local,dest=/tmp/.buildx-cache + #cache-from: type=local,src=/tmp/.buildx-cache + # using registry cache (no storage limit) + cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }} + cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max create_tag: name: Create and push git tag From eb7a2b39540171214499f733fe1f779561c942e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 13:56:05 +0200 Subject: [PATCH 04/26] actions cache --- .github/workflows/build-cache.yml | 104 ++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/build-cache.yml diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml new file mode 100644 index 0000000000000..9948e3f6c2ac0 --- /dev/null +++ b/.github/workflows/build-cache.yml @@ -0,0 +1,104 @@ +name: Build Actions Cache + +on: + workflow_call: # reusable + schedule: + - cron: '0 * * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + ubuntu-24-vulkan-cache: + runs-on: ubuntu-24.04 + + steps: + - name: Get latest Vulkan SDK version + id: vulkan_sdk_version + run: | + echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" + + - name: Cache Vulkan SDK + id: cache_vulkan_sdk + uses: actions/cache@v4 + with: + path: ./vulkan_sdk + key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} + + - name: Install Vulkan SDK + if: steps.cache_vulkan_sdk.outputs.cache-hit != 'true' + id: vulkan_sdk_install + run: | + mkdir -p vulkan_sdk + cd vulkan_sdk + curl --no-progress-meter https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz | tar -Jx --strip-components=1 + + ubuntu-24-spacemit-cache: + runs-on: ubuntu-24.04 + + env: + SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" + + steps: + - name: Cache SpacemiT Toolchain + uses: actions/cache@v4 + id: cache-spacemit-ime-cross-toolchain + with: + path: ./spacemit-toolchain + key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} + + - name: Setup SpacemiT Toolchain + if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true' + run: | + mkdir -p spacemit-toolchain + cd spacemit-toolchain + curl --no-progress-meter https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz | tar -Jx --strip-components=1 + + windows-2022-rocm-cache: + runs-on: windows-2022 + + env: + # The ROCm version must correspond to the version used in the HIP SDK. + ROCM_VERSION: "6.4.2" + HIPSDK_INSTALLER_VERSION: "25.Q3" + + steps: + - name: Cache ROCm Installation + id: cache-rocm + uses: actions/cache@v4 + with: + path: C:\Program Files\AMD\ROCm + key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} + + - name: Install ROCm + if: steps.cache-rocm.outputs.cache-hit != 'true' + id: depends + run: | + $ErrorActionPreference = "Stop" + write-host "Downloading AMD HIP SDK Installer" + Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-$%7B%7B%20env.HIPSDK_INSTALLER_VERSION%20%7D%7D-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe" + write-host "Installing AMD HIP SDK" + $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru + $completed = $proc.WaitForExit(600000) + if (-not $completed) { + Write-Error "ROCm installation timed out after 10 minutes. Killing the process" + $proc.Kill() + exit 1 + } + if ($proc.ExitCode -ne 0) { + Write-Error "ROCm installation failed with exit code $($proc.ExitCode)" + exit 1 + } + write-host "Completed AMD HIP SDK installation" + + - name: Verify ROCm + id: verify + run: | + # Find and test ROCm installation + $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1 + if (-not $clangPath) { + Write-Error "ROCm installation not found" + exit 1 + } + & $clangPath.FullName --version From 70bb81526aeca5aec8099d8a1ccfc64c9b17b82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 13:57:44 +0200 Subject: [PATCH 05/26] ws-- --- build-cache.yml | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 build-cache.yml diff --git a/build-cache.yml b/build-cache.yml new file mode 100644 index 0000000000000..05c5b7bf94fef --- /dev/null +++ b/build-cache.yml @@ -0,0 +1,104 @@ +name: Build Actions Cache + +on: + workflow_call: # reusable + schedule: + - cron: '0 * * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + ubuntu-24-vulkan-cache: + runs-on: ubuntu-24.04 + + steps: + - name: Get latest Vulkan SDK version + id: vulkan_sdk_version + run: | + echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" + + - name: Cache Vulkan SDK + id: cache_vulkan_sdk + uses: actions/cache@v4 + with: + path: ./vulkan_sdk + key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} + + - name: Install Vulkan SDK + if: steps.cache_vulkan_sdk.outputs.cache-hit != 'true' + id: vulkan_sdk_install + run: | + mkdir -p vulkan_sdk + cd vulkan_sdk + curl --no-progress-meter https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz | tar -Jx --strip-components=1 + + ubuntu-24-spacemit-cache: + runs-on: ubuntu-24.04 + + env: + SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" + + steps: + - name: Cache SpacemiT Toolchain + uses: actions/cache@v4 + id: cache-spacemit-ime-cross-toolchain + with: + path: ./spacemit-toolchain + key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} + + - name: Setup SpacemiT Toolchain + if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true' + run: | + mkdir -p spacemit-toolchain + cd spacemit-toolchain + curl --no-progress-meter https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz | tar -Jx --strip-components=1 + + windows-2022-rocm-cache: + runs-on: windows-2022 + + env: + # The ROCm version must correspond to the version used in the HIP SDK. + ROCM_VERSION: "6.4.2" + HIPSDK_INSTALLER_VERSION: "25.Q3" + + steps: + - name: Cache ROCm Installation + id: cache-rocm + uses: actions/cache@v4 + with: + path: C:\Program Files\AMD\ROCm + key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} + + - name: Install ROCm + if: steps.cache-rocm.outputs.cache-hit != 'true' + id: depends + run: | + $ErrorActionPreference = "Stop" + write-host "Downloading AMD HIP SDK Installer" + Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-$%7B%7B%20env.HIPSDK_INSTALLER_VERSION%20%7D%7D-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe" + write-host "Installing AMD HIP SDK" + $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru + $completed = $proc.WaitForExit(600000) + if (-not $completed) { + Write-Error "ROCm installation timed out after 10 minutes. Killing the process" + $proc.Kill() + exit 1 + } + if ($proc.ExitCode -ne 0) { + Write-Error "ROCm installation failed with exit code $($proc.ExitCode)" + exit 1 + } + write-host "Completed AMD HIP SDK installation" + + - name: Verify ROCm + id: verify + run: | + # Find and test ROCm installation + $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1 + if (-not $clangPath) { + Write-Error "ROCm installation not found" + exit 1 + } + & $clangPath.FullName --version From f20084787f83c87acac68bcf369bf4da70d37116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 14:01:26 +0200 Subject: [PATCH 06/26] Delete build-cache.yml --- build-cache.yml | 104 ------------------------------------------------ 1 file changed, 104 deletions(-) delete mode 100644 build-cache.yml diff --git a/build-cache.yml b/build-cache.yml deleted file mode 100644 index 05c5b7bf94fef..0000000000000 --- a/build-cache.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Build Actions Cache - -on: - workflow_call: # reusable - schedule: - - cron: '0 * * * *' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - ubuntu-24-vulkan-cache: - runs-on: ubuntu-24.04 - - steps: - - name: Get latest Vulkan SDK version - id: vulkan_sdk_version - run: | - echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" - - - name: Cache Vulkan SDK - id: cache_vulkan_sdk - uses: actions/cache@v4 - with: - path: ./vulkan_sdk - key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} - - - name: Install Vulkan SDK - if: steps.cache_vulkan_sdk.outputs.cache-hit != 'true' - id: vulkan_sdk_install - run: | - mkdir -p vulkan_sdk - cd vulkan_sdk - curl --no-progress-meter https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz | tar -Jx --strip-components=1 - - ubuntu-24-spacemit-cache: - runs-on: ubuntu-24.04 - - env: - SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" - - steps: - - name: Cache SpacemiT Toolchain - uses: actions/cache@v4 - id: cache-spacemit-ime-cross-toolchain - with: - path: ./spacemit-toolchain - key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} - - - name: Setup SpacemiT Toolchain - if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true' - run: | - mkdir -p spacemit-toolchain - cd spacemit-toolchain - curl --no-progress-meter https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz | tar -Jx --strip-components=1 - - windows-2022-rocm-cache: - runs-on: windows-2022 - - env: - # The ROCm version must correspond to the version used in the HIP SDK. - ROCM_VERSION: "6.4.2" - HIPSDK_INSTALLER_VERSION: "25.Q3" - - steps: - - name: Cache ROCm Installation - id: cache-rocm - uses: actions/cache@v4 - with: - path: C:\Program Files\AMD\ROCm - key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} - - - name: Install ROCm - if: steps.cache-rocm.outputs.cache-hit != 'true' - id: depends - run: | - $ErrorActionPreference = "Stop" - write-host "Downloading AMD HIP SDK Installer" - Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-$%7B%7B%20env.HIPSDK_INSTALLER_VERSION%20%7D%7D-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe" - write-host "Installing AMD HIP SDK" - $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru - $completed = $proc.WaitForExit(600000) - if (-not $completed) { - Write-Error "ROCm installation timed out after 10 minutes. Killing the process" - $proc.Kill() - exit 1 - } - if ($proc.ExitCode -ne 0) { - Write-Error "ROCm installation failed with exit code $($proc.ExitCode)" - exit 1 - } - write-host "Completed AMD HIP SDK installation" - - - name: Verify ROCm - id: verify - run: | - # Find and test ROCm installation - $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1 - if (-not $clangPath) { - Write-Error "ROCm installation not found" - exit 1 - } - & $clangPath.FullName --version From 0083ca91ecbc4a5a181a1aa375743f83a983c28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 14:05:27 +0200 Subject: [PATCH 07/26] allow manual run --- .github/workflows/build-cache.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index 9948e3f6c2ac0..53bfdc8287503 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -1,6 +1,7 @@ name: Build Actions Cache on: + workflow_dispatch: # allows manual triggering workflow_call: # reusable schedule: - cron: '0 * * * *' @@ -54,7 +55,7 @@ jobs: mkdir -p spacemit-toolchain cd spacemit-toolchain curl --no-progress-meter https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz | tar -Jx --strip-components=1 - + windows-2022-rocm-cache: runs-on: windows-2022 From 083a2dde5cf93d2f3106305c106b7004f990a7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 15:21:25 +0200 Subject: [PATCH 08/26] cache composites --- .github/actions/cache-from-exe/action.yml | 46 +++++++++++++++++++++++ .github/actions/cache-from-tar/action.yml | 29 ++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/actions/cache-from-exe/action.yml create mode 100644 .github/actions/cache-from-tar/action.yml diff --git a/.github/actions/cache-from-exe/action.yml b/.github/actions/cache-from-exe/action.yml new file mode 100644 index 0000000000000..3b261a2188017 --- /dev/null +++ b/.github/actions/cache-from-exe/action.yml @@ -0,0 +1,46 @@ +name: "Create cache from Windows exe" +description: "Download exe and install into cache" +inputs: + url: + description: "URL of the exe installer" + required: true + path: + description: "Directory installed into" + required: true + args: + description: "Installer arguments" + required: true + key: + description: "Cache key" + required: true + +runs: + using: "composite" + steps: + - name: Setup Cache + uses: actions/cache@v4 + id: cache-exe + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} + + - name: Install into cached directory + if: steps.cache-exe.cache-hit != 'true' + id: depends + run: | + $ErrorActionPreference = "Stop" + write-host "Downloading Installer EXE" + Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\cache-install.exe" + write-host "Installing" + $proc = Start-Process "${env:RUNNER_TEMP}\cache-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru + $completed = $proc.WaitForExit(600000) + if (-not $completed) { + Write-Error "Installer timed out after 10 minutes. Killing the process" + $proc.Kill() + exit 1 + } + if ($proc.ExitCode -ne 0) { + Write-Error "Installer failed with exit code $($proc.ExitCode)" + exit 1 + } + write-host "Completed installation" diff --git a/.github/actions/cache-from-tar/action.yml b/.github/actions/cache-from-tar/action.yml new file mode 100644 index 0000000000000..18def18759ce5 --- /dev/null +++ b/.github/actions/cache-from-tar/action.yml @@ -0,0 +1,29 @@ +name: "Create cache from tar" +description: "Download tar and unarchive into cache" +inputs: + url: + description: "URL of the tar archive" + required: true + path: + description: "Directory to unarchive into" + required: true + key: + description: "Cache key" + required: true + +runs: + using: "composite" + steps: + - name: Setup Cache + uses: actions/cache@v4 + id: cache-tar + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} + + - name: Unarchive to cached directory + if: steps.cache-tar.cache-hit != 'true' + run: | + mkdir -p ${{ inputs.path }} + cd ${{ inputs.path }} + curl --no-progress-meter ${{ inputs.url }} | tar -Jx --strip-components=1 From f93ef7d9316e354e159e597414c551c68de057fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 15:23:15 +0200 Subject: [PATCH 09/26] use composites --- .github/workflows/build-cache.yml | 57 ++++--------------------------- 1 file changed, 6 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index 53bfdc8287503..e3cee0047bfb7 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -21,20 +21,12 @@ jobs: echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" - name: Cache Vulkan SDK - id: cache_vulkan_sdk - uses: actions/cache@v4 + uses: ./.github/actions/cache-from-tar with: + url: https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz path: ./vulkan_sdk key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} - - name: Install Vulkan SDK - if: steps.cache_vulkan_sdk.outputs.cache-hit != 'true' - id: vulkan_sdk_install - run: | - mkdir -p vulkan_sdk - cd vulkan_sdk - curl --no-progress-meter https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz | tar -Jx --strip-components=1 - ubuntu-24-spacemit-cache: runs-on: ubuntu-24.04 @@ -43,19 +35,12 @@ jobs: steps: - name: Cache SpacemiT Toolchain - uses: actions/cache@v4 - id: cache-spacemit-ime-cross-toolchain + uses: ./.github/actions/cache-from-tar with: + url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz path: ./spacemit-toolchain key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} - - name: Setup SpacemiT Toolchain - if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true' - run: | - mkdir -p spacemit-toolchain - cd spacemit-toolchain - curl --no-progress-meter https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz | tar -Jx --strip-components=1 - windows-2022-rocm-cache: runs-on: windows-2022 @@ -69,37 +54,7 @@ jobs: id: cache-rocm uses: actions/cache@v4 with: + url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe path: C:\Program Files\AMD\ROCm + args: -install key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} - - - name: Install ROCm - if: steps.cache-rocm.outputs.cache-hit != 'true' - id: depends - run: | - $ErrorActionPreference = "Stop" - write-host "Downloading AMD HIP SDK Installer" - Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-$%7B%7B%20env.HIPSDK_INSTALLER_VERSION%20%7D%7D-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe" - write-host "Installing AMD HIP SDK" - $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru - $completed = $proc.WaitForExit(600000) - if (-not $completed) { - Write-Error "ROCm installation timed out after 10 minutes. Killing the process" - $proc.Kill() - exit 1 - } - if ($proc.ExitCode -ne 0) { - Write-Error "ROCm installation failed with exit code $($proc.ExitCode)" - exit 1 - } - write-host "Completed AMD HIP SDK installation" - - - name: Verify ROCm - id: verify - run: | - # Find and test ROCm installation - $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1 - if (-not $clangPath) { - Write-Error "ROCm installation not found" - exit 1 - } - & $clangPath.FullName --version From ded653843590b202bf46ae7c44a6b62f546e39ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 15:30:56 +0200 Subject: [PATCH 10/26] use composites --- .github/workflows/build-cache.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index e3cee0047bfb7..2942065cbc3ac 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -15,6 +15,10 @@ jobs: runs-on: ubuntu-24.04 steps: + - name: Clone + id: checkout + uses: actions/checkout@v4 + - name: Get latest Vulkan SDK version id: vulkan_sdk_version run: | @@ -34,6 +38,10 @@ jobs: SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" steps: + - name: Clone + id: checkout + uses: actions/checkout@v4 + - name: Cache SpacemiT Toolchain uses: ./.github/actions/cache-from-tar with: @@ -50,9 +58,13 @@ jobs: HIPSDK_INSTALLER_VERSION: "25.Q3" steps: + - name: Clone + id: checkout + uses: actions/checkout@v4 + - name: Cache ROCm Installation id: cache-rocm - uses: actions/cache@v4 + uses: ./.github/actions/cache-from-exe with: url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe path: C:\Program Files\AMD\ROCm From b643698269c8183a540036d9db952e3f062c358b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 15:44:10 +0200 Subject: [PATCH 11/26] set shell --- .github/actions/cache-from-exe/action.yml | 1 + .github/actions/cache-from-tar/action.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/cache-from-exe/action.yml b/.github/actions/cache-from-exe/action.yml index 3b261a2188017..1af4ca1676512 100644 --- a/.github/actions/cache-from-exe/action.yml +++ b/.github/actions/cache-from-exe/action.yml @@ -27,6 +27,7 @@ runs: - name: Install into cached directory if: steps.cache-exe.cache-hit != 'true' id: depends + shell: pwsh run: | $ErrorActionPreference = "Stop" write-host "Downloading Installer EXE" diff --git a/.github/actions/cache-from-tar/action.yml b/.github/actions/cache-from-tar/action.yml index 18def18759ce5..98241cb9caa4b 100644 --- a/.github/actions/cache-from-tar/action.yml +++ b/.github/actions/cache-from-tar/action.yml @@ -23,6 +23,7 @@ runs: - name: Unarchive to cached directory if: steps.cache-tar.cache-hit != 'true' + shell: bash run: | mkdir -p ${{ inputs.path }} cd ${{ inputs.path }} From 609999556baf67dea2a49e4d0fd7bc8ace52b637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 16:04:44 +0200 Subject: [PATCH 12/26] fix output --- .github/actions/cache-from-exe/action.yml | 57 ++++++++++++----------- .github/actions/cache-from-tar/action.yml | 30 ++++++------ 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/.github/actions/cache-from-exe/action.yml b/.github/actions/cache-from-exe/action.yml index 1af4ca1676512..c18990d9dc84f 100644 --- a/.github/actions/cache-from-exe/action.yml +++ b/.github/actions/cache-from-exe/action.yml @@ -13,35 +13,38 @@ inputs: key: description: "Cache key" required: true +outputs: + cache-hit: + description: "actions/cache output" + value: ${{ steps.cache-exe.outputs.cache-hit }} runs: using: "composite" steps: - - name: Setup Cache - uses: actions/cache@v4 - id: cache-exe - with: - path: ${{ inputs.path }} - key: ${{ inputs.key }} + - name: Setup Cache + uses: actions/cache@v4 + id: cache-exe + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} - - name: Install into cached directory - if: steps.cache-exe.cache-hit != 'true' - id: depends - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - write-host "Downloading Installer EXE" - Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\cache-install.exe" - write-host "Installing" - $proc = Start-Process "${env:RUNNER_TEMP}\cache-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru - $completed = $proc.WaitForExit(600000) - if (-not $completed) { - Write-Error "Installer timed out after 10 minutes. Killing the process" - $proc.Kill() - exit 1 - } - if ($proc.ExitCode -ne 0) { - Write-Error "Installer failed with exit code $($proc.ExitCode)" - exit 1 - } - write-host "Completed installation" + - name: Install into cached directory + if: steps.cache-exe.outputs.cache-hit != 'true' + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + write-host "Downloading Installer EXE" + Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\cache-install.exe" + write-host "Installing" + $proc = Start-Process "${env:RUNNER_TEMP}\cache-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru + $completed = $proc.WaitForExit(600000) + if (-not $completed) { + Write-Error "Installer timed out after 10 minutes. Killing the process" + $proc.Kill() + exit 1 + } + if ($proc.ExitCode -ne 0) { + Write-Error "Installer failed with exit code $($proc.ExitCode)" + exit 1 + } + write-host "Completed installation" diff --git a/.github/actions/cache-from-tar/action.yml b/.github/actions/cache-from-tar/action.yml index 98241cb9caa4b..8c837202b320a 100644 --- a/.github/actions/cache-from-tar/action.yml +++ b/.github/actions/cache-from-tar/action.yml @@ -10,21 +10,25 @@ inputs: key: description: "Cache key" required: true +outputs: + cache-hit: + description: "actions/cache output" + value: ${{ steps.cache-tar.outputs.cache-hit }} runs: using: "composite" steps: - - name: Setup Cache - uses: actions/cache@v4 - id: cache-tar - with: - path: ${{ inputs.path }} - key: ${{ inputs.key }} + - name: Setup Cache + uses: actions/cache@v4 + id: cache-tar + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} - - name: Unarchive to cached directory - if: steps.cache-tar.cache-hit != 'true' - shell: bash - run: | - mkdir -p ${{ inputs.path }} - cd ${{ inputs.path }} - curl --no-progress-meter ${{ inputs.url }} | tar -Jx --strip-components=1 + - name: Unarchive to cached directory + if: steps.cache-tar.outputs.cache-hit != 'true' + shell: bash + run: | + mkdir -p ${{ inputs.path }} + cd ${{ inputs.path }} + curl --no-progress-meter ${{ inputs.url }} | tar -Jx --strip-components=1 From dff6c5301adc095dfab1bbd68bcc79443d9e6788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 17:03:28 +0200 Subject: [PATCH 13/26] update actions --- .../actions/ubuntu-spacemit-cache/action.yml | 22 +++++++++++++++++++ .../actions/ubuntu-vulkan-cache/action.yml | 22 +++++++++++++++++++ .github/actions/windows-rocm-cache/action.yml | 22 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .github/actions/ubuntu-spacemit-cache/action.yml create mode 100644 .github/actions/ubuntu-vulkan-cache/action.yml create mode 100644 .github/actions/windows-rocm-cache/action.yml diff --git a/.github/actions/ubuntu-spacemit-cache/action.yml b/.github/actions/ubuntu-spacemit-cache/action.yml new file mode 100644 index 0000000000000..cd2694d68eb93 --- /dev/null +++ b/.github/actions/ubuntu-spacemit-cache/action.yml @@ -0,0 +1,22 @@ +name: "Create SpcemiT cache" +description: "Cache SpacemiT Toolchain" +inputs: + version: + description: "SpecemiT toolchain version (change the default, do not pass input)" + required: false + default: "1.1.2" +outputs: + cache-hit: + description: "actions/cache output" + value: ${{ steps.cache-spacemit.outputs.cache-hit }} + +runs: + using: "composite" + steps: + - name: Cache SpacemiT Toolchain + id: cache-spacemit + uses: ./.github/actions/cache-from-tar + with: + url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ inputs.version }}.tar.xz + path: ./spacemit_toolchain + key: spacemit-ime-toolchain-v${{ inputs.version }}-${{ runner.os }} diff --git a/.github/actions/ubuntu-vulkan-cache/action.yml b/.github/actions/ubuntu-vulkan-cache/action.yml new file mode 100644 index 0000000000000..1701538c3d287 --- /dev/null +++ b/.github/actions/ubuntu-vulkan-cache/action.yml @@ -0,0 +1,22 @@ +name: "Create Vulkan cache" +description: "Cache Vulkan SDK" +outputs: + cache-hit: + description: "actions/cache output" + value: ${{ steps.cache-vulkan.outputs.cache-hit }} + +runs: + using: "composite" + steps: + - name: Get latest Vulkan SDK version + id: vulkan_sdk_version + run: | + echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" + + - name: Cache Vulkan SDK + id: cache-vulkan + uses: ./.github/actions/cache-from-tar + with: + url: https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz + path: ./vulkan_sdk + key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} diff --git a/.github/actions/windows-rocm-cache/action.yml b/.github/actions/windows-rocm-cache/action.yml new file mode 100644 index 0000000000000..b7ef3c2631eb9 --- /dev/null +++ b/.github/actions/windows-rocm-cache/action.yml @@ -0,0 +1,22 @@ +name: "Create ROCm cache" +description: "Cache ROCm Installation" +inputs: + version: + description: "ROCm version (change the default, do not pass input)" + required: false + default: "25.Q3" +outputs: + cache-hit: + description: "actions/cache output" + value: ${{ steps.cache-rocm.outputs.cache-hit }} + +runs: + using: "composite" + steps: + - name: Cache ROCm Installation + uses: ./.github/actions/cache-from-exe + with: + url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-WinSvr2022-For-HIP.exe + path: C:\Program Files\AMD\ROCm + args: -install + key: rocm-${{ inputs.version }}-${{ runner.os }} From 09fbe8040fde3cda28fa4d427a915a3bac382c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 17:04:43 +0200 Subject: [PATCH 14/26] update build-cache --- .github/workflows/build-cache.yml | 34 +++---------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index 2942065cbc3ac..028329b06af0a 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -2,7 +2,6 @@ name: Build Actions Cache on: workflow_dispatch: # allows manual triggering - workflow_call: # reusable schedule: - cron: '0 * * * *' @@ -19,54 +18,27 @@ jobs: id: checkout uses: actions/checkout@v4 - - name: Get latest Vulkan SDK version - id: vulkan_sdk_version - run: | - echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" - - name: Cache Vulkan SDK - uses: ./.github/actions/cache-from-tar - with: - url: https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz - path: ./vulkan_sdk - key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} + uses: ./.github/actions/ubuntu-vulkan-cache ubuntu-24-spacemit-cache: runs-on: ubuntu-24.04 - env: - SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" - steps: - name: Clone id: checkout uses: actions/checkout@v4 - name: Cache SpacemiT Toolchain - uses: ./.github/actions/cache-from-tar - with: - url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz - path: ./spacemit-toolchain - key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} + uses: ./.github/actions/ubuntu-spacemit-cache windows-2022-rocm-cache: runs-on: windows-2022 - env: - # The ROCm version must correspond to the version used in the HIP SDK. - ROCM_VERSION: "6.4.2" - HIPSDK_INSTALLER_VERSION: "25.Q3" - steps: - name: Clone id: checkout uses: actions/checkout@v4 - name: Cache ROCm Installation - id: cache-rocm - uses: ./.github/actions/cache-from-exe - with: - url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe - path: C:\Program Files\AMD\ROCm - args: -install - key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} + uses: ./.github/actions/windows-rocm-cache From 231deeb72fc7d7e5840b41dff059a757188a0c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 17:10:13 +0200 Subject: [PATCH 15/26] update workflows --- .../actions/ubuntu-vulkan-cache/action.yml | 1 + .github/workflows/build-linux-cross.yml | 23 +---- .github/workflows/build.yml | 86 ++++++++----------- 3 files changed, 40 insertions(+), 70 deletions(-) diff --git a/.github/actions/ubuntu-vulkan-cache/action.yml b/.github/actions/ubuntu-vulkan-cache/action.yml index 1701538c3d287..d192bd9a41b53 100644 --- a/.github/actions/ubuntu-vulkan-cache/action.yml +++ b/.github/actions/ubuntu-vulkan-cache/action.yml @@ -10,6 +10,7 @@ runs: steps: - name: Get latest Vulkan SDK version id: vulkan_sdk_version + shell: bash run: | echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" diff --git a/.github/workflows/build-linux-cross.yml b/.github/workflows/build-linux-cross.yml index 2b101876c5abf..5dd1f034c7a00 100644 --- a/.github/workflows/build-linux-cross.yml +++ b/.github/workflows/build-linux-cross.yml @@ -257,32 +257,15 @@ jobs: ubuntu-24-riscv64-cpu-spacemit-ime-cross: runs-on: ubuntu-24.04 - env: - SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" - SPACEMIT_IME_TOOLCHAIN_PATH: "spacemit-toolchain-linux-glibc-x86_64" - steps: - uses: actions/checkout@v4 - - name: Cache Toolchain - uses: actions/cache@v4 - id: cache-spacemit-ime-cross-toolchain - with: - path: ./${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} - key: ${{ runner.os }}-spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }} - - - name: Setup Toolchain - if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true' - run: | - wget --quiet --no-check-certificate https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz -O ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz - rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} - mkdir -p ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} - tar xf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz -C ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} --strip-components=1 - rm -rf ${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }}.tar.xz + - name: Use SpacemiT Toolchain Cache + uses: ./.github/actions/ubuntu-spacemit-cache - name: Build run: | - export RISCV_ROOT_PATH=${PWD}/${{ env.SPACEMIT_IME_TOOLCHAIN_PATH }} + export RISCV_ROOT_PATH=${PWD}/spacemit_toolchain cmake -B build -DLLAMA_CURL=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DGGML_OPENMP=OFF \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9844485218d8a..4abfd86d48c4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,7 +97,7 @@ jobs: ctest -L 'main|curl' --verbose --timeout 900 macOS-latest-cmake-x64: - runs-on: macos-13 + runs-on: macos-15-intel steps: - name: Clone @@ -207,7 +207,7 @@ jobs: - name: ccache uses: ggml-org/ccache-action@v1.2.16 with: - key: ubuntu-cpu-cmake + key: ubuntu-cpu-cmake-${{ matrix.build }} evict-old-files: 1d - name: Build Dependencies @@ -362,11 +362,11 @@ jobs: id: checkout uses: actions/checkout@v4 - - name: ccache - uses: ggml-org/ccache-action@v1.2.16 - with: - key: ubuntu-latest-cmake-rpc - evict-old-files: 1d + # - name: ccache + # uses: ggml-org/ccache-action@v1.2.16 + # with: + # key: ubuntu-latest-cmake-rpc + # evict-old-files: 1d - name: Dependencies id: depends @@ -387,8 +387,9 @@ jobs: cd build ctest -L main --verbose - ubuntu-22-cmake-vulkan: - runs-on: ubuntu-22.04 + ubuntu-24-cmake-vulkan: + runs-on: ubuntu-24.04 + needs: build-cache steps: - name: Clone @@ -398,20 +399,24 @@ jobs: - name: ccache uses: ggml-org/ccache-action@v1.2.16 with: - key: ubuntu-22-cmake-vulkan + key: ubuntu-24-cmake-vulkan evict-old-files: 1d - name: Dependencies id: depends run: | - wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - - sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list + sudo add-apt-repository -y ppa:kisak/kisak-mesa sudo apt-get update -y - sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev + sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libcurl4-openssl-dev + + - name: Use Vulkan SDK Cache + id: cache_vulkan_sdk + uses: ./.github/actions/ubuntu-vulkan-cache - name: Build id: cmake_build run: | + source ./vulkan_sdk/setup-env.sh cmake -B build \ -DGGML_VULKAN=ON cmake --build build --config Release -j $(nproc) @@ -421,6 +426,7 @@ jobs: run: | cd build export GGML_VK_VISIBLE_DEVICES=0 + export GGML_VK_DISABLE_F16=1 # This is using llvmpipe and runs slower than other backends ctest -L main --verbose --timeout 4200 @@ -487,7 +493,7 @@ jobs: id: depends run: | sudo apt-get update - sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev + sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev rocwmma-dev - name: ccache uses: ggml-org/ccache-action@v1.2.16 @@ -1059,7 +1065,7 @@ jobs: shell: bash env: - WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7cd9bba0-7aab-4e30-b3ae-2221006a4a05/intel-oneapi-base-toolkit-2025.1.1.34_offline.exe + WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/24751ead-ddc5-4479-b9e6-f9fe2ff8b9f2/intel-deep-learning-essentials-2025.2.1.25_offline.exe WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI" steps: @@ -1097,38 +1103,16 @@ jobs: id: checkout uses: actions/checkout@v4 - - name: Clone rocWMMA repository - id: clone_rocwmma + - name: Grab rocWMMA package + id: grab_rocwmma run: | - git clone https://github.com/rocm/rocwmma --branch rocm-${{ env.ROCM_VERSION }} --depth 1 + curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/$%7B%7B%20env.ROCM_VERSION%20%7D%7D/pool/main/r/rocwmma-dev/rocwmma-dev_1.7.0.60402-120~24.04_amd64.deb" + 7z x rocwmma.deb + 7z x data.tar - - name: Cache ROCm Installation + - name: Use ROCm Installation Cache id: cache-rocm - uses: actions/cache@v4 - with: - path: C:\Program Files\AMD\ROCm - key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} - - - name: Install ROCm - if: steps.cache-rocm.outputs.cache-hit != 'true' - id: depends - run: | - $ErrorActionPreference = "Stop" - write-host "Downloading AMD HIP SDK Installer" - Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-$%7B%7B%20env.HIPSDK_INSTALLER_VERSION%20%7D%7D-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe" - write-host "Installing AMD HIP SDK" - $proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru - $completed = $proc.WaitForExit(600000) - if (-not $completed) { - Write-Error "ROCm installation timed out after 10 minutes. Killing the process" - $proc.Kill() - exit 1 - } - if ($proc.ExitCode -ne 0) { - Write-Error "ROCm installation failed with exit code $($proc.ExitCode)" - exit 1 - } - write-host "Completed AMD HIP SDK installation" + uses: ./.github/actions/windows-rocm-cache - name: Verify ROCm id: verify @@ -1161,8 +1145,9 @@ jobs: cmake -G "Unix Makefiles" -B build -S . ` -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" ` -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" ` - -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" ` + -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-${{ env.ROCM_VERSION }}/include/" ` -DCMAKE_BUILD_TYPE=Release ` + -DROCM_DIR="${env:HIP_PATH}" ` -DGGML_HIP=ON ` -DGGML_HIP_ROCWMMA_FATTN=ON ` -DGGML_RPC=ON ` @@ -1222,11 +1207,12 @@ jobs: - name: Clone uses: actions/checkout@v4 - - name: ccache - uses: ggml-org/ccache-action@v1.2.16 - with: - key: android-build - evict-old-files: 1d + # Disabled due to size (400MB) and always 0 cache hits + # - name: ccache + # uses: ggml-org/ccache-action@v1.2.16 + # with: + # key: android-build + # evict-old-files: 1d - name: Set up JDK uses: actions/setup-java@v3 From 9c429527400a9f0d08f6f2d00482ae3254b19aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 17:12:40 +0200 Subject: [PATCH 16/26] fix build --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4abfd86d48c4a..10919ef4920ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -389,7 +389,6 @@ jobs: ubuntu-24-cmake-vulkan: runs-on: ubuntu-24.04 - needs: build-cache steps: - name: Clone From 2879406a9e8b427f9fa421b8e2a9d69573530137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:22:24 +0200 Subject: [PATCH 17/26] update actions --- .github/actions/install-exe/action.yml | 36 +++++++++++++++++++ .../actions/linux-setup-spacemit/action.yml | 16 +++++++++ .github/actions/linux-setup-vulkan/action.yml | 19 ++++++++++ .github/actions/unarchive-tar/action.yml | 27 ++++++++++++++ .github/actions/windows-setup-rocm/action.yml | 15 ++++++++ 5 files changed, 113 insertions(+) create mode 100644 .github/actions/install-exe/action.yml create mode 100644 .github/actions/linux-setup-spacemit/action.yml create mode 100644 .github/actions/linux-setup-vulkan/action.yml create mode 100644 .github/actions/unarchive-tar/action.yml create mode 100644 .github/actions/windows-setup-rocm/action.yml diff --git a/.github/actions/install-exe/action.yml b/.github/actions/install-exe/action.yml new file mode 100644 index 0000000000000..002bec83c7749 --- /dev/null +++ b/.github/actions/install-exe/action.yml @@ -0,0 +1,36 @@ +name: "Install exe" +description: "Download and install exe" +inputs: + url: + description: "URL of the exe installer" + required: true + args: + description: "Installer arguments" + required: true + timeout: + description: "Timeout (in ms)" + required: false + default: "600000" + +runs: + using: "composite" + steps: + - name: Install EXE + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + write-host "Downloading Installer EXE" + Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\temp-install.exe" + write-host "Installing" + $proc = Start-Process "${env:RUNNER_TEMP}\temp-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru + $completed = $proc.WaitForExit(${{ inputs.timeout }}) + if (-not $completed) { + Write-Error "Installer timed out. Killing the process" + $proc.Kill() + exit 1 + } + if ($proc.ExitCode -ne 0) { + Write-Error "Installer failed with exit code $($proc.ExitCode)" + exit 1 + } + write-host "Completed installation" diff --git a/.github/actions/linux-setup-spacemit/action.yml b/.github/actions/linux-setup-spacemit/action.yml new file mode 100644 index 0000000000000..274ba097cb056 --- /dev/null +++ b/.github/actions/linux-setup-spacemit/action.yml @@ -0,0 +1,16 @@ +name: "Linux - Setup SpacemiT Toolchain" +description: "Setup SpacemiT Toolchain for Linux" +inputs: + version: + description: "SpacemiT toolchain version" + required: true + +runs: + using: "composite" + steps: + - name: Setup SpacemiT Toolchain + id: setup + uses: ./.github/actions/unarchive-tar + with: + url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ inputs.version }}.tar.xz + path: ${{ inputs.path }} diff --git a/.github/actions/linux-setup-vulkan/action.yml b/.github/actions/linux-setup-vulkan/action.yml new file mode 100644 index 0000000000000..5708e1f3ba9ab --- /dev/null +++ b/.github/actions/linux-setup-vulkan/action.yml @@ -0,0 +1,19 @@ +name: "Linux - Setup Vulkan SDK" +description: "Setup Vulkan SDK for Linux" +inputs: + path: + description: "Installation path" + required: true + version: + description: "Vulkan SDK version" + required: true + +runs: + using: "composite" + steps: + - name: Setup Vulkan SDK + id: setup + uses: ./.github/actions/unarchive-tar + with: + url: https://sdk.lunarg.com/sdk/download/${{ inputs.version }}/linux/vulkan_sdk.tar.xz + path: ${{ inputs.path }} diff --git a/.github/actions/unarchive-tar/action.yml b/.github/actions/unarchive-tar/action.yml new file mode 100644 index 0000000000000..b97e402f46a8a --- /dev/null +++ b/.github/actions/unarchive-tar/action.yml @@ -0,0 +1,27 @@ +name: "Unarchive tar" +description: "Download and unarchive tar into directory" +inputs: + url: + description: "URL of the tar archive" + required: true + path: + description: "Directory to unarchive into" + required: true + type: + description: "Compression type (tar option)" + required: false + default: "J" + strip: + description: "Strip components" + required: false + default: "0" + +runs: + using: "composite" + steps: + - name: Unarchive into directory + shell: bash + run: | + mkdir -p ${{ inputs.path }} + cd ${{ inputs.path }} + curl --no-progress-meter ${{ inputs.url }} | tar -${{ inputs.type }}x --strip-components=${{ inputs.strip }} diff --git a/.github/actions/windows-setup-rocm/action.yml b/.github/actions/windows-setup-rocm/action.yml new file mode 100644 index 0000000000000..b83e6e295bf00 --- /dev/null +++ b/.github/actions/windows-setup-rocm/action.yml @@ -0,0 +1,15 @@ +name: "Windows - Setup ROCm" +description: "Setup ROCm for Windows" +inputs: + version: + description: "ROCm version" + required: true + +runs: + using: "composite" + steps: + - name: Setup ROCm + uses: ./.github/actions/install-exe + with: + url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-WinSvr2022-For-HIP.exe + args: -install From 63a4cdb39924f7b3bab5d58d1c4a6a641cd7db87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:23:22 +0200 Subject: [PATCH 18/26] Delete .github/actions/ubuntu-spacemit-cache directory --- .../actions/ubuntu-spacemit-cache/action.yml | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/actions/ubuntu-spacemit-cache/action.yml diff --git a/.github/actions/ubuntu-spacemit-cache/action.yml b/.github/actions/ubuntu-spacemit-cache/action.yml deleted file mode 100644 index cd2694d68eb93..0000000000000 --- a/.github/actions/ubuntu-spacemit-cache/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Create SpcemiT cache" -description: "Cache SpacemiT Toolchain" -inputs: - version: - description: "SpecemiT toolchain version (change the default, do not pass input)" - required: false - default: "1.1.2" -outputs: - cache-hit: - description: "actions/cache output" - value: ${{ steps.cache-spacemit.outputs.cache-hit }} - -runs: - using: "composite" - steps: - - name: Cache SpacemiT Toolchain - id: cache-spacemit - uses: ./.github/actions/cache-from-tar - with: - url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ inputs.version }}.tar.xz - path: ./spacemit_toolchain - key: spacemit-ime-toolchain-v${{ inputs.version }}-${{ runner.os }} From 7439cf519d81b44cbc11d1e36b3be5fa9f7570b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:23:41 +0200 Subject: [PATCH 19/26] Delete .github/actions/ubuntu-vulkan-cache directory --- .../actions/ubuntu-vulkan-cache/action.yml | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/actions/ubuntu-vulkan-cache/action.yml diff --git a/.github/actions/ubuntu-vulkan-cache/action.yml b/.github/actions/ubuntu-vulkan-cache/action.yml deleted file mode 100644 index d192bd9a41b53..0000000000000 --- a/.github/actions/ubuntu-vulkan-cache/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Create Vulkan cache" -description: "Cache Vulkan SDK" -outputs: - cache-hit: - description: "actions/cache output" - value: ${{ steps.cache-vulkan.outputs.cache-hit }} - -runs: - using: "composite" - steps: - - name: Get latest Vulkan SDK version - id: vulkan_sdk_version - shell: bash - run: | - echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" - - - name: Cache Vulkan SDK - id: cache-vulkan - uses: ./.github/actions/cache-from-tar - with: - url: https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz - path: ./vulkan_sdk - key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} From f0c7b9aaf4cca25873af2e705cb0d5255adc7657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:23:58 +0200 Subject: [PATCH 20/26] Delete .github/actions/cache-from-exe directory --- .github/actions/cache-from-exe/action.yml | 50 ----------------------- 1 file changed, 50 deletions(-) delete mode 100644 .github/actions/cache-from-exe/action.yml diff --git a/.github/actions/cache-from-exe/action.yml b/.github/actions/cache-from-exe/action.yml deleted file mode 100644 index c18990d9dc84f..0000000000000 --- a/.github/actions/cache-from-exe/action.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: "Create cache from Windows exe" -description: "Download exe and install into cache" -inputs: - url: - description: "URL of the exe installer" - required: true - path: - description: "Directory installed into" - required: true - args: - description: "Installer arguments" - required: true - key: - description: "Cache key" - required: true -outputs: - cache-hit: - description: "actions/cache output" - value: ${{ steps.cache-exe.outputs.cache-hit }} - -runs: - using: "composite" - steps: - - name: Setup Cache - uses: actions/cache@v4 - id: cache-exe - with: - path: ${{ inputs.path }} - key: ${{ inputs.key }} - - - name: Install into cached directory - if: steps.cache-exe.outputs.cache-hit != 'true' - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - write-host "Downloading Installer EXE" - Invoke-WebRequest -Uri "${{ inputs.url }}" -OutFile "${env:RUNNER_TEMP}\cache-install.exe" - write-host "Installing" - $proc = Start-Process "${env:RUNNER_TEMP}\cache-install.exe" -ArgumentList '${{ inputs.args }}' -NoNewWindow -PassThru - $completed = $proc.WaitForExit(600000) - if (-not $completed) { - Write-Error "Installer timed out after 10 minutes. Killing the process" - $proc.Kill() - exit 1 - } - if ($proc.ExitCode -ne 0) { - Write-Error "Installer failed with exit code $($proc.ExitCode)" - exit 1 - } - write-host "Completed installation" From 23125b5813622c794d9892a2b51079521ad56585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:24:08 +0200 Subject: [PATCH 21/26] Delete .github/actions/cache-from-tar directory --- .github/actions/cache-from-tar/action.yml | 34 ----------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/actions/cache-from-tar/action.yml diff --git a/.github/actions/cache-from-tar/action.yml b/.github/actions/cache-from-tar/action.yml deleted file mode 100644 index 8c837202b320a..0000000000000 --- a/.github/actions/cache-from-tar/action.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "Create cache from tar" -description: "Download tar and unarchive into cache" -inputs: - url: - description: "URL of the tar archive" - required: true - path: - description: "Directory to unarchive into" - required: true - key: - description: "Cache key" - required: true -outputs: - cache-hit: - description: "actions/cache output" - value: ${{ steps.cache-tar.outputs.cache-hit }} - -runs: - using: "composite" - steps: - - name: Setup Cache - uses: actions/cache@v4 - id: cache-tar - with: - path: ${{ inputs.path }} - key: ${{ inputs.key }} - - - name: Unarchive to cached directory - if: steps.cache-tar.outputs.cache-hit != 'true' - shell: bash - run: | - mkdir -p ${{ inputs.path }} - cd ${{ inputs.path }} - curl --no-progress-meter ${{ inputs.url }} | tar -Jx --strip-components=1 From 0eee26a49ca44c66dff2c0ff69a3578413cbbc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:24:32 +0200 Subject: [PATCH 22/26] Delete .github/actions/windows-rocm-cache directory --- .github/actions/windows-rocm-cache/action.yml | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/actions/windows-rocm-cache/action.yml diff --git a/.github/actions/windows-rocm-cache/action.yml b/.github/actions/windows-rocm-cache/action.yml deleted file mode 100644 index b7ef3c2631eb9..0000000000000 --- a/.github/actions/windows-rocm-cache/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Create ROCm cache" -description: "Cache ROCm Installation" -inputs: - version: - description: "ROCm version (change the default, do not pass input)" - required: false - default: "25.Q3" -outputs: - cache-hit: - description: "actions/cache output" - value: ${{ steps.cache-rocm.outputs.cache-hit }} - -runs: - using: "composite" - steps: - - name: Cache ROCm Installation - uses: ./.github/actions/cache-from-exe - with: - url: https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ inputs.version }}-WinSvr2022-For-HIP.exe - path: C:\Program Files\AMD\ROCm - args: -install - key: rocm-${{ inputs.version }}-${{ runner.os }} From 1e73d87c029ba265c717dbcf15f1c49028e411bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:25:16 +0200 Subject: [PATCH 23/26] update build-cache --- .github/workflows/build-cache.yml | 58 +++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index 028329b06af0a..63d9839f25065 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -18,27 +18,73 @@ jobs: id: checkout uses: actions/checkout@v4 - - name: Cache Vulkan SDK - uses: ./.github/actions/ubuntu-vulkan-cache + - name: Get latest Vulkan SDK version + id: vulkan_sdk_version + run: | + echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" + + - name: Setup Cache + uses: actions/cache@v4 + id: cache-sdk + with: + path: ./vulkan_sdk + key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} + + - name: Setup Vulkan SDK + if: steps.cache-sdk.outputs.cache-hit != 'true' + uses: ./.github/actions/linux-setup-vulkan + with: + path: ./vulkan_sdk + version: ${{ env.VULKAN_SDK_VERSION }} ubuntu-24-spacemit-cache: runs-on: ubuntu-24.04 + env: + # Make sure this is in sync with build-linux-cross.yml + SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" + steps: - name: Clone id: checkout uses: actions/checkout@v4 - - name: Cache SpacemiT Toolchain - uses: ./.github/actions/ubuntu-spacemit-cache + - name: Setup Cache + uses: actions/cache@v4 + id: cache-toolchain + with: + path: ./spacemit_toolchain + key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} + + - name: Setup SpacemiT Toolchain + if: steps.cache-toolchain.outputs.cache-hit != 'true' + uses: ./.github/actions/linux-setup-spacemit + with: + path: ./spacemit_toolchain + version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }} windows-2022-rocm-cache: runs-on: windows-2022 + env: + # Make sure this is in sync with build.yml + HIPSDK_INSTALLER_VERSION: "25.Q3" + steps: - name: Clone id: checkout uses: actions/checkout@v4 - - name: Cache ROCm Installation - uses: ./.github/actions/windows-rocm-cache + - name: Setup Cache + uses: actions/cache@v4 + id: cache-rocm + with: + path: C:\Program Files\AMD\ROCm + key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} + + - name: Setup ROCm + if: steps.cache-rocm.outputs.cache-hit != 'true' + uses: ./.github/actions/windows-setup-rocm + with: + path: C:\Program Files\AMD\ROCm + version: ${{ env.HIPSDK_INSTALLER_VERSION }} From bfb2aaaf4beaef6d247f57046182b8537886e85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:33:26 +0200 Subject: [PATCH 24/26] update workflows --- .../actions/linux-setup-spacemit/action.yml | 3 ++ .github/workflows/build-cache.yml | 1 - .github/workflows/build-linux-cross.yml | 17 +++++++++- .github/workflows/build.yml | 31 +++++++++++++++++-- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/actions/linux-setup-spacemit/action.yml b/.github/actions/linux-setup-spacemit/action.yml index 274ba097cb056..f052e359dd7a3 100644 --- a/.github/actions/linux-setup-spacemit/action.yml +++ b/.github/actions/linux-setup-spacemit/action.yml @@ -1,6 +1,9 @@ name: "Linux - Setup SpacemiT Toolchain" description: "Setup SpacemiT Toolchain for Linux" inputs: + path: + description: "Installation path" + required: true version: description: "SpacemiT toolchain version" required: true diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index 63d9839f25065..6a22e41c3b590 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -86,5 +86,4 @@ jobs: if: steps.cache-rocm.outputs.cache-hit != 'true' uses: ./.github/actions/windows-setup-rocm with: - path: C:\Program Files\AMD\ROCm version: ${{ env.HIPSDK_INSTALLER_VERSION }} diff --git a/.github/workflows/build-linux-cross.yml b/.github/workflows/build-linux-cross.yml index 5dd1f034c7a00..937306f7afae7 100644 --- a/.github/workflows/build-linux-cross.yml +++ b/.github/workflows/build-linux-cross.yml @@ -257,11 +257,26 @@ jobs: ubuntu-24-riscv64-cpu-spacemit-ime-cross: runs-on: ubuntu-24.04 + env: + # Make sure this is in sync with build-cache.yml + SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2" + steps: - uses: actions/checkout@v4 - name: Use SpacemiT Toolchain Cache - uses: ./.github/actions/ubuntu-spacemit-cache + uses: actions/cache@v4 + id: cache-toolchain + with: + path: ./spacemit_toolchain + key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }} + + - name: Setup SpacemiT Toolchain + if: steps.cache-toolchain.outputs.cache-hit != 'true' + uses: ./.github/actions/linux-setup-spacemit + with: + path: ./spacemit_toolchain + version: ${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }} - name: Build run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10919ef4920ba..8e431e3e7ff25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -408,9 +408,24 @@ jobs: sudo apt-get update -y sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libcurl4-openssl-dev + - name: Get latest Vulkan SDK version + id: vulkan_sdk_version + run: | + echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV" + - name: Use Vulkan SDK Cache - id: cache_vulkan_sdk - uses: ./.github/actions/ubuntu-vulkan-cache + uses: actions/cache@v4 + id: cache-sdk + with: + path: ./vulkan_sdk + key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }} + + - name: Setup Vulkan SDK + if: steps.cache-sdk.outputs.cache-hit != 'true' + uses: ./.github/actions/linux-setup-vulkan + with: + path: ./vulkan_sdk + version: ${{ env.VULKAN_SDK_VERSION }} - name: Build id: cmake_build @@ -1095,6 +1110,7 @@ jobs: env: # The ROCm version must correspond to the version used in the HIP SDK. ROCM_VERSION: "6.4.2" + # Make sure this is in sync with build-cache.yml HIPSDK_INSTALLER_VERSION: "25.Q3" steps: @@ -1110,8 +1126,17 @@ jobs: 7z x data.tar - name: Use ROCm Installation Cache + uses: actions/cache@v4 id: cache-rocm - uses: ./.github/actions/windows-rocm-cache + with: + path: C:\Program Files\AMD\ROCm + key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }} + + - name: Setup ROCm + if: steps.cache-rocm.outputs.cache-hit != 'true' + uses: ./.github/actions/linux-setup-spacemit + with: + version: ${{ env.HIPSDK_INSTALLER_VERSION }} - name: Verify ROCm id: verify From 4289aa87f1a8679dafe9e9bb782af0c380e4ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 19:46:38 +0200 Subject: [PATCH 25/26] set correct strip components level --- .github/actions/linux-setup-spacemit/action.yml | 1 + .github/actions/linux-setup-vulkan/action.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/linux-setup-spacemit/action.yml b/.github/actions/linux-setup-spacemit/action.yml index f052e359dd7a3..e2193e8931d09 100644 --- a/.github/actions/linux-setup-spacemit/action.yml +++ b/.github/actions/linux-setup-spacemit/action.yml @@ -17,3 +17,4 @@ runs: with: url: https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ inputs.version }}.tar.xz path: ${{ inputs.path }} + strip: 1 diff --git a/.github/actions/linux-setup-vulkan/action.yml b/.github/actions/linux-setup-vulkan/action.yml index 5708e1f3ba9ab..4d29837feb9c7 100644 --- a/.github/actions/linux-setup-vulkan/action.yml +++ b/.github/actions/linux-setup-vulkan/action.yml @@ -17,3 +17,4 @@ runs: with: url: https://sdk.lunarg.com/sdk/download/${{ inputs.version }}/linux/vulkan_sdk.tar.xz path: ${{ inputs.path }} + strip: 1 From 0be0dd488339b2fa6725d272ae36a2535aeb0396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Fri, 3 Oct 2025 20:07:13 +0200 Subject: [PATCH 26/26] use correct action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e431e3e7ff25..6463ad42562bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1134,7 +1134,7 @@ jobs: - name: Setup ROCm if: steps.cache-rocm.outputs.cache-hit != 'true' - uses: ./.github/actions/linux-setup-spacemit + uses: ./.github/actions/windows-setup-rocm with: version: ${{ env.HIPSDK_INSTALLER_VERSION }}