diff --git a/.github/workflows/sycl-hardening-check.yml b/.github/workflows/sycl-hardening-check.yml new file mode 100644 index 0000000000000..3d243c638ce35 --- /dev/null +++ b/.github/workflows/sycl-hardening-check.yml @@ -0,0 +1,90 @@ +name: SYCL hardening check + +permissions: read-all + +on: + workflow_call: + inputs: + sycl_linux_artifact: + type: string + sycl_linux_archive: + type: string + sycl_linux_decompress_command: + type: string + + sycl_windows_artifact: + type: string + sycl_windows_archive: + type: string + +jobs: + hardening_check: + runs-on: ubuntu-latest + + steps: + - name: Install hardening-check + run: | + sudo apt update + sudo apt install -y devscripts + + - name: Download SYCL toolchain + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.sycl_linux_artifact }} + + - name: Extract SYCL toolchain + run: | + mkdir toolchain + tar -I '${{ inputs.sycl_linux_decompress_command }}' -xf ${{ inputs.sycl_linux_archive }} -C toolchain + + - name: Perform checks + run: | + for file in ./toolchain/bin/*; do + hardening-check "$file" | tee -a "./hardening-check.txt" + done + + for file in $(find ./toolchain/lib/ -type f -name "*.so*"); do + hardening-check "$file" | tee -a "./hardening-check.txt" + done + + - uses: actions/upload-artifact@v4 + with: + name: hardening-check + path: hardening-check.txt + + winchecksec: + runs-on: windows-latest + + steps: + - name: Install winchecksec + run: | + curl -LO https://github.com/trailofbits/winchecksec/releases/download/v3.1.0/windows.x64.Release.zip + mkdir winchecksec + unzip "windows.x64.Release.zip" -d winchecksec + + - name: Download SYCL toolchain + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.sycl_windows_artifact }} + + - name: Extract SYCL toolchain + shell: bash + run: | + mkdir toolchain + tar -xf ${{ inputs.sycl_windows_archive }} -C toolchain + + - name: Download and check Windows artifacts + shell: bash + run: | + for file in $(find ./toolchain/bin/ -type f -name "*.exe"); do + ./winchecksec/build/Release/winchecksec.exe "$file" | tee -a "./winchecksec.txt" + done + + for file in $(find ./toolchain/bin/ -type f -name "*.dll"); do + ./winchecksec/build/Release/winchecksec.exe "$file" | tee -a "./winchecksec.txt" + done + + - uses: actions/upload-artifact@v4 + with: + name: winchecksec + path: winchecksec.txt diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index b76609f9d66bd..a230fdad40ad4 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -32,6 +32,10 @@ on: build_artifact_suffix: type: string required: true + build_target: + type: string + required: false + default: sycl-toolchain artifact_archive_name: type: string default: llvm_sycl.tar.zst @@ -46,7 +50,10 @@ on: default: 3 e2e_binaries_artifact: type: string - required: False + required: false + pack_release: + type: string + required: false outputs: build_conclusion: @@ -100,6 +107,10 @@ on: options: - 3 + pack_release: + type: string + required: false + permissions: read-all jobs: @@ -170,7 +181,8 @@ jobs: -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV - name: Compile id: build - run: cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain + # Emulate default value for manual dispatch as we've run out of available arguments. + run: cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }} - name: check-llvm if: always() && !cancelled() && contains(inputs.changes, 'llvm') run: | @@ -215,11 +227,26 @@ jobs: # TODO consider moving this to Dockerfile. export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH LIT_OPTS="--allow-empty-runs" LIT_FILTER="e2e_test_requirements" cmake --build $GITHUB_WORKSPACE/build --target check-sycl - - name: Install + - name: Install sycl-toolchain if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} - # TODO replace utility installation with a single CMake target run: | cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain + + - name: Pack toolchain release + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }} + run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install . + - name: Upload toolchain release + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: sycl_linux_release + path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} + retention-days: ${{ inputs.retention-days }} + + - name: Install utilities + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} + # TODO replace utility installation with a single CMake target + run: | cmake --build $GITHUB_WORKSPACE/build --target utils/FileCheck/install cmake --build $GITHUB_WORKSPACE/build --target utils/count/install cmake --build $GITHUB_WORKSPACE/build --target utils/not/install @@ -278,7 +305,7 @@ jobs: testing_mode: build-only target_devices: all binaries_artifact: ${{ inputs.e2e_binaries_artifact }} - cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ + sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd" - name: Remove E2E tests before spirv-backend run @@ -293,5 +320,20 @@ jobs: testing_mode: build-only target_devices: all binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_spirv_backend - cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ + sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ extra_lit_opts: --param spirv-backend=True + + - name: Remove E2E tests before preview-mode run + if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + run: rm -rf build-e2e + + - name: Build E2E tests in Preview Mode + if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + uses: ./devops/actions/run-tests/e2e + with: + ref: ${{ inputs.ref || github.sha }} + testing_mode: build-only + target_devices: all + binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_preview + sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ + extra_lit_opts: --param test-preview-mode=True diff --git a/.github/workflows/sycl-linux-run-tests.yml b/.github/workflows/sycl-linux-run-tests.yml index 2f3c02bf334ed..025e93b9037e7 100644 --- a/.github/workflows/sycl-linux-run-tests.yml +++ b/.github/workflows/sycl-linux-run-tests.yml @@ -25,7 +25,7 @@ on: required: False tests_selector: description: | - Three possible options: "e2e", "cts", and "compute-benchmarks". + Three possible options: "e2e", "cts", and "benchmarks". type: string default: "e2e" @@ -82,9 +82,6 @@ on: type: string default: 1 - reset_intel_gpu: - type: string - required: False install_igc_driver: type: string required: False @@ -114,6 +111,33 @@ on: default: '' required: False + benchmark_upload_results: + description: | + Set to true to upload results to git repository storing benchmarking + results. + type: string + default: 'false' + required: False + benchmark_save_name: + description: | + Save name to use for benchmark results: Save names are stored in + metadata of result file, and are used to identify benchmark results in + the same series (e.g. same configuration, same device, etc.). + + Note: Currently, benchmark result filenames are in the format of + ___YYYYMMDD_HHMMSS.json + type: string + default: '' + required: False + benchmark_preset: + description: | + Name of benchmark preset to run. + + See /devops/scripts/benchmarks/presets.py for all presets available. + type: string + default: 'Minimal' + required: False + workflow_dispatch: inputs: runner: @@ -153,7 +177,7 @@ on: options: - e2e - cts - - compute-benchmarks + - benchmarks env: description: | @@ -171,14 +195,6 @@ on: Extra options to be added to LIT_OPTS. default: '' - reset_intel_gpu: - description: | - Reset Intel GPUs - type: choice - options: - - false - - true - e2e_testing_mode: type: choice options: @@ -199,24 +215,6 @@ jobs: options: ${{ inputs.image_options }} env: ${{ fromJSON(inputs.env) }} steps: - - name: Reset Intel GPU - if: inputs.reset_intel_gpu == 'true' - shell: bash - run: | - if [[ '${{ inputs.runner }}' == '["Linux", "bmg"]' ]]; then - sudo bash -c 'echo 0000:05:00.0 > /sys/bus/pci/drivers/xe/unbind' - sudo bash -c 'echo 1 > /sys/bus/pci/devices/0000:05:00.0/reset' - sudo bash -c 'echo 0000:05:00.0 > /sys/bus/pci/drivers/xe/bind' - else - sudo mount -t debugfs none /sys/kernel/debug - base_dir="/sys/kernel/debug/dri" - - for dir in "$base_dir"/*; do - if [ -f "$dir/i915_wedged" ]; then - sudo bash -c 'echo 1 > $0/i915_wedged' $dir - fi - done - fi - uses: actions/checkout@v4 with: ref: ${{ inputs.devops_ref || inputs.repo_ref }} @@ -224,6 +222,8 @@ jobs: devops - name: Register cleanup after job is finished uses: ./devops/actions/cleanup + - name: Reset Intel GPU + uses: ./devops/actions/reset_gpu - name: Install drivers if: inputs.install_igc_driver == 'true' || inputs.install_dev_igc_driver == 'true' env: @@ -308,6 +308,7 @@ jobs: - name: Run E2E Tests if: inputs.tests_selector == 'e2e' uses: ./devops/actions/run-tests/e2e + timeout-minutes: 60 with: ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }} binaries_artifact: ${{ inputs.e2e_binaries_artifact }} @@ -320,6 +321,9 @@ jobs: - name: Run SYCL CTS Tests if: inputs.tests_selector == 'cts' uses: ./devops/actions/run-tests/cts + # Normally this job takes less than 10m. But sometimes it hangs up and + # reaches the 360m limit. Set a lower limit to free up the runner earlier. + timeout-minutes: 35 with: ref: ${{ inputs.tests_ref || 'main' }} cts_exclude_ref: ${{ inputs.repo_ref }} @@ -329,11 +333,14 @@ jobs: target_devices: ${{ inputs.target_devices }} retention-days: ${{ inputs.retention-days }} - - name: Run compute-benchmarks on SYCL - if: inputs.tests_selector == 'compute-benchmarks' + - name: Run benchmarks + if: inputs.tests_selector == 'benchmarks' uses: ./devops/actions/run-tests/benchmark with: target_devices: ${{ inputs.target_devices }} + upload_results: ${{ inputs.benchmark_upload_results }} + save_name: ${{ inputs.benchmark_save_name }} + preset: ${{ inputs.benchmark_preset }} env: RUNNER_TAG: ${{ inputs.runner }} GITHUB_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }} diff --git a/.github/workflows/sycl-rel-nightly.yml b/.github/workflows/sycl-rel-nightly.yml index 3c37796e749f7..2675ca361e898 100644 --- a/.github/workflows/sycl-rel-nightly.yml +++ b/.github/workflows/sycl-rel-nightly.yml @@ -2,45 +2,19 @@ name: SYCL Release Branch Nightly on: workflow_dispatch: - schedule: - - cron: '0 3 * * *' permissions: read-all jobs: - # To avoid unnecessary scheduled runs this job checks if there are new commits - # since the last run. More precisely, it checks if the last commit is older - # than 24h. That means the previous Nightly already tested this commit. - check_for_new_commits: - if: github.repository == 'intel/llvm' - runs-on: ubuntu-latest - name: Check for new commits - outputs: - is_new_commit: ${{ steps.is_new_commit.outputs.is_new_commit }} - steps: - - uses: actions/checkout@v4 - with: - ref: sycl-rel-6_0_0 - - run: git show --quiet | tee -a $GITHUB_STEP_SUMMARY - - - id: is_new_commit - if: ${{ github.event_name == 'schedule' }} - run: | - if [ -z "$(git rev-list --after="24 hours" HEAD)" ]; then - echo "is_new_commit=false" >> $GITHUB_OUTPUT - fi - ubuntu2204_build: - needs: [check_for_new_commits] - if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }} uses: ./.github/workflows/sycl-linux-build.yml secrets: inherit with: build_cache_root: "/__w/" build_artifact_suffix: default - build_configure_extra_args: '--hip --cuda' + build_configure_extra_args: '--disable-jit --no-assertions --add_security_flags=sanitize --hip --cuda' build_image: ghcr.io/intel/llvm/ubuntu2204_build:latest - build_ref: sycl-rel-6_0_0 + pack_release: 'true' # We upload the build for people to download/use, override its name and # prefer widespread gzip compression. @@ -57,50 +31,46 @@ jobs: runner: '["Linux", "amdgpu"]' image_options: -u 1001 --device=/dev/dri --device=/dev/kfd target_devices: hip:gpu - tests_selector: e2e - - name: Intel L0 GPU + - name: Intel L0 Gen12 GPU runner: '["Linux", "gen12"]' image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu - reset_intel_gpu: true - tests_selector: e2e extra_lit_opts: --param gpu-intel-gen12=True - - name: Intel OCL GPU + - name: Intel L0 Battlemage GPU + runner: '["Linux", "bmg"]' + image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN + target_devices: level_zero:gpu + + - name: Intel OCL Gen12 GPU runner: '["Linux", "gen12"]' image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: opencl:gpu - reset_intel_gpu: true - tests_selector: e2e extra_lit_opts: --param gpu-intel-gen12=True - name: Intel OCL CPU runner: '["Linux", "gen12"]' image_options: -u 1001 --privileged --cap-add SYS_ADMIN target_devices: opencl:cpu - tests_selector: e2e uses: ./.github/workflows/sycl-linux-run-tests.yml with: name: ${{ matrix.name }} runner: ${{ matrix.runner }} image_options: ${{ matrix.image_options }} target_devices: ${{ matrix.target_devices }} - tests_selector: ${{ matrix.tests_selector }} + tests_selector: e2e extra_lit_opts: ${{ matrix.extra_lit_opts }} - reset_intel_gpu: ${{ matrix.reset_intel_gpu }} - repo_ref: sycl-rel-6_0_0 - devops_ref: sycl + repo_ref: ${{ github.sha }} sycl_toolchain_artifact: sycl_linux_default sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }} sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }} build-win: - needs: [check_for_new_commits] - if: ${{ github.repository == 'intel/llvm' && needs.check_for_new_commits.outputs.is_new_commit != 'false' }} uses: ./.github/workflows/sycl-windows-build.yml with: - ref: sycl-rel-6_0_0 + build_configure_extra_args: '--disable-jit --no-assertions --add_security_flags=sanitize' + pack_release: 'true' # We upload both Linux/Windows build via Github's "Releases" # functionality, make sure Linux/Windows names follow the same pattern. @@ -113,14 +83,23 @@ jobs: always() && !cancelled() && needs.build-win.outputs.build_conclusion == 'success' + strategy: + fail-fast: false + matrix: + include: + - name: Intel GEN12 Graphics with Level Zero + runner: '["Windows","gen12"]' + + - name: Intel Battlemage Graphics with Level Zero + runner: '["Windows","bmg"]' uses: ./.github/workflows/sycl-windows-run-tests.yml with: - name: Intel GEN12 Graphics with Level Zero - runner: '["Windows","gen12"]' + name: ${{ matrix.name }} + runner: ${{ matrix.runner }} + target_devices: level_zero:gpu sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }} - extra_lit_opts: --param gpu-intel-gen12=True - ref: sycl-rel-6_0_0 - devops_ref: sycl + extra_lit_opts: ${{ matrix.extra_lit_opts }} + repo_ref: ${{ github.sha }} cuda-aws-start: needs: [ubuntu2204_build] @@ -129,7 +108,7 @@ jobs: secrets: inherit with: mode: start - ref: sycl-rel-6_0_0 + ref: ${{ github.sha }} cuda-run-tests: needs: [ubuntu2204_build, cuda-aws-start] @@ -141,8 +120,7 @@ jobs: image: ghcr.io/intel/llvm/ubuntu2204_build:latest image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1 target_devices: cuda:gpu - repo_ref: sycl-rel-6_0_0 - devops_ref: sycl + repo_ref: ${{ github.sha }} sycl_toolchain_artifact: sycl_linux_default sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }} @@ -150,12 +128,12 @@ jobs: cuda-aws-stop: needs: [cuda-aws-start, cuda-run-tests] - if: always() + if: always() && ${{ needs.cuda-aws-start.result != 'skipped' }} uses: ./.github/workflows/sycl-aws.yml secrets: inherit with: mode: stop - ref: sycl-rel-6_0_0 + ref: ${{ github.sha }} build-sycl-cts: needs: ubuntu2204_build @@ -167,11 +145,16 @@ jobs: cts_testing_mode: 'build-only' image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN tests_selector: cts - repo_ref: sycl-rel-6_0_0 - devops_ref: sycl + repo_ref: ${{ github.sha }} + # Author: Tom Deakin + # Date: Thu Mar 20 15:31:29 2025 +0000 + # Merge pull request #1052 from dyniols/cts_test_for_shorthand_aliases_address_spaces + # Add tests for the new shorthand aliases of address spaces + tests_ref: 87f8677c4b67cfe56ad6f09246036f10c306c977 sycl_toolchain_artifact: sycl_linux_default sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }} sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }} + sycl_cts_artifact: sycl_cts_bin_linux run-sycl-cts: needs: [ubuntu2204_build, build-sycl-cts] @@ -197,9 +180,24 @@ jobs: image_options: ${{ matrix.image_options }} target_devices: ${{ matrix.target_devices }} tests_selector: cts - repo_ref: ${{ github.sha }} - devops_ref: sycl + repo_ref: ${{ github.sha }} sycl_toolchain_artifact: sycl_linux_default sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }} sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }} - sycl_cts_artifact: sycl_cts_bin + sycl_cts_artifact: sycl_cts_bin_linux + + hardening-check: + needs: [ubuntu2204_build, build-win] + if: | + always() + && !cancelled() + && needs.ubuntu2204_build.outputs.build_conclusion == 'success' + && needs.build-win.outputs.build_conclusion == 'success' + uses: ./.github/workflows/sycl-hardening-check.yml + with: + sycl_linux_artifact: sycl_linux_release + sycl_linux_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }} + sycl_linux_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }} + + sycl_windows_artifact: sycl_windows_release + sycl_windows_archive: ${{ needs.build-win.outputs.artifact_archive_name }} diff --git a/.github/workflows/sycl-windows-build.yml b/.github/workflows/sycl-windows-build.yml index dbf4bfd88922c..50a736c6ef067 100644 --- a/.github/workflows/sycl-windows-build.yml +++ b/.github/workflows/sycl-windows-build.yml @@ -10,6 +10,10 @@ on: build_configure_extra_args: type: string required: false + build_target: + type: string + required: false + default: sycl-toolchain changes: type: string description: 'Filter matches for the changed files in the PR' @@ -25,10 +29,16 @@ on: description: 'Artifacts retention period' type: string default: 3 - compiler: + e2e_binaries_artifact: + type: string + required: false + cxx: type: string required: false default: "cl" + pack_release: + type: string + required: false outputs: build_conclusion: @@ -52,6 +62,11 @@ on: build_configure_extra_args: type: string required: false + build_target: + type: choice + options: + - "sycl-toolchain" + - "all" artifact_archive_name: type: choice options: @@ -61,11 +76,14 @@ on: type: choice options: - 3 - compiler: + cxx: type: choice options: - cl - icx + pack_release: + type: string + required: false permissions: read-all @@ -80,9 +98,8 @@ jobs: - name: Detect hung tests if: always() shell: powershell - continue-on-error: true run: | - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"} powershell.exe -File windows_detect_hung_tests.ps1 $exitCode = $LASTEXITCODE Remove-Item -Path "windows_detect_hung_tests.ps1" @@ -96,7 +113,7 @@ jobs: arch: amd64 - name: Setup oneAPI env uses: ./devops/actions/setup_windows_oneapi_env - if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }} + if: ${{ always() && !cancelled() && inputs.cxx == 'icx' }} - name: Set env run: | git config --system core.longpaths true @@ -124,8 +141,8 @@ jobs: IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}} python.exe src/buildbot/configure.py -o build ^ --ci-defaults %ARGS% ^ - "-DCMAKE_C_COMPILER=${{inputs.compiler}}" ^ - "-DCMAKE_CXX_COMPILER=${{inputs.compiler}}" ^ + "-DCMAKE_C_COMPILER=${{inputs.cxx}}" ^ + "-DCMAKE_CXX_COMPILER=${{inputs.cxx}}" ^ "-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^ -DCMAKE_C_COMPILER_LAUNCHER=ccache ^ @@ -135,7 +152,7 @@ jobs: id: build shell: bash run: | - cmake --build build --target sycl-toolchain + cmake --build build --target ${{ inputs.build_target }} - name: check-llvm if: always() && !cancelled() && contains(inputs.changes, 'llvm') shell: bash @@ -179,12 +196,27 @@ jobs: name: sycl_windows_abi_symbols path: build/new_sycl_symbols_windows.dump retention-days: ${{ inputs.retention-days }} - - name: Install + - name: Install sycl-toolchain + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} + run: | + cmake --build build --target deploy-sycl-toolchain + + - name: Pack toolchain release + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }} + run: tar -czf ${{ inputs.artifact_archive_name }} -C install . + - name: Upload toolchain release + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: sycl_windows_release + path: ${{ inputs.artifact_archive_name }} + retention-days: ${{ inputs.retention-days }} + + - name: Install utilities if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} shell: bash # TODO replace utility installation with a single CMake target run: | - cmake --build build --target deploy-sycl-toolchain cmake --build build --target utils/FileCheck/install cmake --build build --target utils/count/install cmake --build build --target utils/not/install @@ -206,11 +238,29 @@ jobs: name: sycl_windows_default path: ${{ inputs.artifact_archive_name }} retention-days: ${{ inputs.retention-days }} + + - name: Setup SYCL toolchain + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} + run: | + echo "PATH=$env:GITHUB_WORKSPACE\\install\\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "LIB=$env:GITHUB_WORKSPACE\\install\\lib;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Build E2E tests + if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + uses: ./devops/actions/run-tests/windows/e2e + with: + ref: ${{ inputs.ref || github.sha }} + testing_mode: build-only + target_devices: all + binaries_artifact: ${{ inputs.e2e_binaries_artifact }} + extra_lit_opts: --param sycl_build_targets="spir" + cxx: ${{ inputs.cxx }} + - name: Detect hung tests if: always() shell: powershell run: | - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"} powershell.exe -File windows_detect_hung_tests.ps1 $exitCode = $LASTEXITCODE Remove-Item -Path "windows_detect_hung_tests.ps1" diff --git a/.github/workflows/sycl-windows-run-tests.yml b/.github/workflows/sycl-windows-run-tests.yml index 91b30a4f3bc33..3dc57a80e0634 100644 --- a/.github/workflows/sycl-windows-run-tests.yml +++ b/.github/workflows/sycl-windows-run-tests.yml @@ -6,6 +6,7 @@ on: name: type: string required: True + runner: type: string required: True @@ -27,19 +28,17 @@ on: Extra options to be added to LIT_OPTS. type: string default: '' - ref: + + repo_ref: type: string required: False + description: | + Commit SHA or branch to checkout the intel/llvm repo. devops_ref: type: string required: False description: | - By default we checkout the devops directory from "inputs.ref" branch. - devops_ref may be specified to checkout the devops dir from different - branch. - Note: it doesn't affect ./devops/actions/run-tests/* as these actions - call checkout again and therefore override the devops directory, so - configs/dependecies from input.ref are used. + Commit SHA or branch to checkout the devops directory. tests_ref: type: string required: False @@ -59,11 +58,20 @@ on: default: '{}' required: False - compiler: + cxx: type: string required: false default: "cl" + e2e_testing_mode: + type: string + default: "full" + + e2e_binaries_artifact: + type: string + default: '' + required: False + cts_testing_mode: description: | Testing mode to run SYCL-CTS in, can be either `full`, `build-only` @@ -93,9 +101,8 @@ jobs: - name: Detect hung tests if: always() shell: powershell - continue-on-error: true run: | - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"} powershell.exe -File windows_detect_hung_tests.ps1 $exitCode = $LASTEXITCODE Remove-Item -Path "windows_detect_hung_tests.ps1" @@ -104,13 +111,13 @@ jobs: with: sparse-checkout: | devops/actions - ref: ${{ inputs.devops_ref|| inputs.ref || github.sha }} + ref: ${{ inputs.devops_ref|| inputs.repo_ref || github.sha }} - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 with: arch: amd64 - name: Setup oneAPI env uses: ./devops/actions/setup_windows_oneapi_env - if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }} + if: ${{ always() && !cancelled() && inputs.cxx == 'icx' }} - name: Set env run: | git config --system core.longpaths true @@ -118,12 +125,14 @@ jobs: echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Register cleanup after job is finished uses: ./devops/actions/cleanup - - uses: ./devops/actions/cached_checkout + - uses: actions/checkout@v4 if: inputs.tests_selector == 'e2e' with: path: llvm - ref: ${{ inputs.ref || github.sha }} - cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\" + ref: ${{ inputs.repo_ref || github.sha }} + sparse-checkout: | + llvm/utils/lit + sycl/test-e2e - name: Download compiler toolchain uses: actions/download-artifact@v4 with: @@ -142,22 +151,20 @@ jobs: sycl-ls - run: | sycl-ls --verbose - - name: Configure E2E with Level Zero target - if: inputs.tests_selector == 'e2e' - shell: cmd - run: | - mkdir build-e2e - cmake -GNinja -B build-e2e -S.\llvm\sycl\test-e2e -DSYCL_TEST_E2E_TARGETS="level_zero:gpu" -DCMAKE_CXX_COMPILER="clang++" -DLEVEL_ZERO_LIBS_DIR="D:\\github\\level-zero_win-sdk\\lib" -DLEVEL_ZERO_INCLUDE="D:\\github\\level-zero_win-sdk\\include" -DLLVM_LIT="..\\llvm\\llvm\\utils\\lit\\lit.py" - - name: Run End-to-End tests + + - name: Run E2E Tests if: inputs.tests_selector == 'e2e' - shell: bash - run: | - # Run E2E tests. - if [[ ${{inputs.compiler}} == 'icx' ]]; then - export LIT_FILTER_OUT="compile_on_win_with_mdd" - fi - export LIT_OPTS="-v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests ${{ inputs.extra_lit_opts }}" - cmake --build build-e2e --target check-sycl-e2e + uses: ./devops/actions/run-tests/windows/e2e + timeout-minutes: 60 + with: + ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }} + binaries_artifact: ${{ inputs.e2e_binaries_artifact }} + testing_mode: ${{ inputs.e2e_testing_mode }} + extra_cmake_args: ${{ inputs.extra_cmake_args }} + target_devices: ${{ inputs.target_devices }} + extra_lit_opts: ${{ inputs.extra_lit_opts }} + retention-days: ${{ inputs.artifact_retention_days }} + cxx: ${{ inputs.cxx }} - name: Run SYCL CTS Tests if: inputs.tests_selector == 'cts' @@ -175,7 +182,7 @@ jobs: if: always() shell: powershell run: | - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"} powershell.exe -File windows_detect_hung_tests.ps1 $exitCode = $LASTEXITCODE Remove-Item -Path "windows_detect_hung_tests.ps1" diff --git a/devops/actions/cached_checkout/action.yml b/devops/actions/cached_checkout/action.yml index 6f58f1de825bf..9e492f902e27f 100644 --- a/devops/actions/cached_checkout/action.yml +++ b/devops/actions/cached_checkout/action.yml @@ -31,7 +31,7 @@ runs: mkdir -p ${{ inputs.cache_path }}/${{ inputs.repository }} cd ${{ inputs.cache_path }}/${{ inputs.repository }} if [ -d ./.git ]; then - git pull --prune + git pull --prune --rebase else git clone https://github.com/${{ inputs.repository }}.git . git gc diff --git a/devops/actions/reset_gpu/action.yml b/devops/actions/reset_gpu/action.yml new file mode 100644 index 0000000000000..7fca091828385 --- /dev/null +++ b/devops/actions/reset_gpu/action.yml @@ -0,0 +1,32 @@ +name: Reset Intel GPU + +runs: + using: "composite" + steps: + - name: Reset Intel GPU + shell: bash + run: | + # First reset all xe devices. + driver_path="/sys/bus/pci/drivers/xe" + + if [ -d "$driver_path" ]; then + # Extract PCI paths of devices bound to xe + for device in $(ls "$driver_path" | grep -E '^[0-9a-f]{4}:[0-9a-f]{2}:[0-9a-f]{2}\.[0-9]$'); do + sysfs_path="/sys/bus/pci/devices/$device" + sudo bash -c 'echo $0 > $1/unbind' $device $driver_path + sudo bash -c 'echo 1 > $0/reset' $sysfs_path + sudo bash -c 'echo $0 > $1/bind' $device $driver_path + echo "Reset $device" + done + fi + + # Then reset all i915 devices. We don't do a PCI FLR because + # it seems to fail on some older GPUs. + sudo mount -t debugfs none /sys/kernel/debug || true + dirs=$(sudo bash -c 'ls -d /sys/kernel/debug/dri/*') || true + for dir in $dirs; do + if sudo test -e "${dir}/i915_wedged"; then + sudo bash -c 'echo 1 > ${dir}/i915_wedged' $dir + echo "Reset $(basename $dir)" + fi + done diff --git a/devops/actions/run-tests/cts/action.yml b/devops/actions/run-tests/cts/action.yml index 93fd2770e166d..e70c4d292576b 100644 --- a/devops/actions/run-tests/cts/action.yml +++ b/devops/actions/run-tests/cts/action.yml @@ -67,7 +67,7 @@ runs: # SYCL_CTS_EXCLUDE_TEST_CATEGORIES - Optional file specifying a list # of test categories to be excluded from the build. echo "::group::Excluded test categories" - cat $cts_exclude_filter + [ -f "$cts_exclude_filter" ] && cat "$cts_exclude_filter" echo "::endgroup::" fi @@ -134,11 +134,13 @@ runs: cts_exclude_filter=$PWD/sycl/cts_exclude_filter/L0_GPU fi - while IFS= read -r line; do - if [[ $line != \#* ]]; then - rm "./build-cts/bin/test_$line" - fi - done < "$cts_exclude_filter" + if [ -f "$cts_exclude_filter" ]; then + while IFS= read -r line; do + if [[ $line != \#* ]]; then + rm "./build-cts/bin/test_$line" + fi + done < "$cts_exclude_filter" + fi - name: Run SYCL CTS tests # Proceed with execution even if the previous two steps did not succeed. diff --git a/devops/actions/run-tests/e2e/action.yml b/devops/actions/run-tests/e2e/action.yml index 47fc75599ccdb..6baacc86451c0 100644 --- a/devops/actions/run-tests/e2e/action.yml +++ b/devops/actions/run-tests/e2e/action.yml @@ -10,12 +10,13 @@ inputs: extra_cmake_args: required: false target_devices: - required: true + required: false + default: all extra_lit_opts: required: false retention-days: required: false - cxx_compiler: + sycl_compiler: required: false @@ -23,11 +24,13 @@ runs: using: "composite" steps: - name: Checkout E2E tests - uses: ./devops/actions/cached_checkout + uses: actions/checkout@v4 with: path: llvm ref: ${{ inputs.ref || github.sha }} - cache_path: "/__w/repo_cache/" + sparse-checkout: | + llvm/utils/lit + sycl/test-e2e - name: Download E2E Binaries if: inputs.testing_mode == 'run-only' @@ -55,7 +58,7 @@ runs: if: inputs.testing_mode != 'run-only' shell: bash run: | - cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler || '$(which clang++)'}}" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }} + cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.sycl_compiler || '$(which clang++)'}}" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }} - name: SYCL End-to-end tests shell: bash {0} env: @@ -65,6 +68,7 @@ runs: exit_code=$? cat e2e.log if [ $exit_code -ne 0 ]; then + # This is duplicated between lin/win, updates must change both. awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Timed Out Tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY fi exit $exit_code diff --git a/devops/actions/run-tests/windows/cts/action.yml b/devops/actions/run-tests/windows/cts/action.yml index 4d4d7aa7f9f46..7404e09ca2bd2 100644 --- a/devops/actions/run-tests/windows/cts/action.yml +++ b/devops/actions/run-tests/windows/cts/action.yml @@ -67,7 +67,7 @@ runs: # SYCL_CTS_EXCLUDE_TEST_CATEGORIES - Optional file specifying a list # of test categories to be excluded from the build. echo "::group::Excluded test categories" - cat $cts_exclude_filter + [ -f "$cts_exclude_filter" ] && cat "$cts_exclude_filter" echo "::endgroup::" fi @@ -136,11 +136,13 @@ runs: cts_exclude_filter=$PWD/sycl/cts_exclude_filter/L0_GPU fi - while IFS= read -r line; do - if [[ $line != \#* ]]; then - rm "./build-cts/bin/test_$line" - fi - done < "$cts_exclude_filter" + if [ -f "$cts_exclude_filter" ]; then + while IFS= read -r line; do + if [[ $line != \#* ]]; then + rm "./build-cts/bin/test_$line" + fi + done < "$cts_exclude_filter" + fi - name: Run SYCL CTS tests # Proceed with execution even if the previous two steps did not succeed. diff --git a/devops/actions/run-tests/windows/e2e/action.yml b/devops/actions/run-tests/windows/e2e/action.yml new file mode 100644 index 0000000000000..3bfd75bde3784 --- /dev/null +++ b/devops/actions/run-tests/windows/e2e/action.yml @@ -0,0 +1,112 @@ +name: 'Run SYCL E2E tests on Windows' + +inputs: + ref: + required: false + binaries_artifact: + required: false + testing_mode: + required: true + extra_cmake_args: + required: false + target_devices: + required: false + default: all + extra_lit_opts: + required: false + retention-days: + required: false + sycl_compiler: + required: false + cxx: + required: false + default: "cl" + +runs: + using: "composite" + steps: + - name: Checkout E2E tests + uses: actions/checkout@v4 + with: + path: llvm + ref: ${{ inputs.ref || github.sha }} + sparse-checkout: | + llvm/utils/lit + sycl/test-e2e + - name: Download E2E Binaries + if: inputs.testing_mode == 'run-only' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.binaries_artifact }} + - name: Extract E2E Binaries + if: inputs.testing_mode == 'run-only' + shell: bash + run: | + mkdir build-e2e + tar -xf e2e_bin.tar.gz -C build-e2e + + - name: Deduce E2E CMake options + id: cmake_opts + shell: bash + env: + CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }} + run: | + if [ -n "$CMAKE_EXTRA_ARGS" ]; then + echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT + fi + + - name: Make E2E folder + if: inputs.testing_mode != 'run-only' + shell: bash + run: | + mkdir build-e2e + + - name: Configure E2E tests + shell: bash + run: | + cmake -GNinja -B build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.sycl_compiler || '$(which clang++).exe' }}" -DLEVEL_ZERO_LIBS_DIR="D:\\github\\level-zero_win-sdk\\lib" -DLEVEL_ZERO_INCLUDE="D:\\github\\level-zero_win-sdk\\include" -DLLVM_LIT="..\\llvm\\llvm\\utils\\lit\\lit.py" ${{ steps.cmake_opts.outputs.opts }} + + - name: Keep track of files after configuring E2E step + if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}} + shell: bash + run: ls build-e2e > e2econf_files.txt + + - name: Run End-to-End tests + shell: bash {0} + env: + LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time ${{ inputs.e2e_testing_mode == 'run-only' && 1200 || 3600 }} --time-tests --param print_features=True --param test-mode=${{ inputs.testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }} + run: | + # Run E2E tests. + cmake --build build-e2e --target check-sycl-e2e > e2e.log 2>&1 + + exit_code=$? + cat e2e.log + if [ $exit_code -ne 0 ]; then + # This is duplicated between lin/win, updates must change both. + awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Timed Out Tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY + fi + exit $exit_code + + # Github CI doesn't support containers on Windows, so we cannot guarantee + # that paths are the same between building and running systems. To avoid + # CMake issues related to absolute paths we reconfigure the build-e2e + # folder on the run system. + - name: Remove E2E configuration files + if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}} + shell: bash + run: | + for FILE in $(cat e2econf_files.txt); do rm -r build-e2e/$FILE; done + rm e2econf_files.txt + + - name: Pack E2E test binaries + if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}} + shell: bash + run: | + tar -czf e2e_bin.tar.gz -C build-e2e . + - name: Upload E2E test binaries + if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.binaries_artifact }} + path: e2e_bin.tar.gz + retention-days: ${{ inputs.retention-days }} diff --git a/devops/containers/ubuntu2204_build.Dockerfile b/devops/containers/ubuntu2204_build.Dockerfile index 1aa814aaa775c..ff26dc7761772 100644 --- a/devops/containers/ubuntu2204_build.Dockerfile +++ b/devops/containers/ubuntu2204_build.Dockerfile @@ -22,7 +22,7 @@ RUN mkdir --parents --mode=0755 /etc/apt/keyrings RUN wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null && \ # Add rocm repo -echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.1.1 jammy main" \ +echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3 jammy main" \ | tee --append /etc/apt/sources.list.d/rocm.list && \ printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 # Install the kernel driver diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index b27aee1b633b0..d8eb12fa5c82f 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -5,8 +5,6 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive -ARG use_unstable_driver=true - USER root RUN apt update && apt install -yqq wget @@ -18,12 +16,7 @@ COPY dependencies.json / RUN mkdir /runtimes ENV INSTALL_LOCATION=/runtimes RUN --mount=type=secret,id=github_token \ - if [ "$use_unstable_driver" = "true" ]; then \ - install_driver_opt=" --use-latest"; \ - else \ - install_driver_opt=" dependencies.json"; \ - fi && \ - GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all + GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh dependencies.json --all COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh diff --git a/devops/containers/ubuntu2404_base.Dockerfile b/devops/containers/ubuntu2404_base.Dockerfile index 3cdad5b74366e..6890a42dcc95a 100644 --- a/devops/containers/ubuntu2404_base.Dockerfile +++ b/devops/containers/ubuntu2404_base.Dockerfile @@ -4,6 +4,11 @@ ENV DEBIAN_FRONTEND=noninteractive USER root +# Configure LLVM nightly repo +RUN apt-get update -qq && apt-get install --no-install-recommends -yqq curl ca-certificates +RUN curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key -o /etc/apt/trusted.gpg.d/apt.llvm.org.asc +RUN echo 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble main' > /etc/apt/sources.list.d/llvm.list + # Install SYCL prerequisites COPY scripts/install_build_tools.sh /install.sh RUN /install.sh diff --git a/devops/containers/ubuntu2404_intel_drivers.Dockerfile b/devops/containers/ubuntu2404_intel_drivers.Dockerfile index a0970f3900141..b61a2a5c10162 100644 --- a/devops/containers/ubuntu2404_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers.Dockerfile @@ -5,8 +5,6 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive -ARG use_unstable_driver=true - USER root RUN apt update && apt install -yqq wget @@ -18,12 +16,7 @@ COPY dependencies.json / RUN mkdir /runtimes ENV INSTALL_LOCATION=/runtimes RUN --mount=type=secret,id=github_token \ - if [ "$use_unstable_driver" = "true" ]; then \ - install_driver_opt=" --use-latest"; \ - else \ - install_driver_opt=" dependencies.json"; \ - fi && \ - GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all + GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh dependencies.json --all COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh diff --git a/devops/dependencies.json b/devops/dependencies.json index 1096ddfc9094b..605fcedd72c85 100644 --- a/devops/dependencies.json +++ b/devops/dependencies.json @@ -1,49 +1,40 @@ { "linux": { "compute_runtime": { - "github_tag": "25.13.33276.19", - "version": "25.13.33276.19", - "url": "https://github.com/intel/compute-runtime/releases/tag/25.13.33276.19", + "github_tag": "25.18.33578.6", + "version": "25.18.33578.6", + "url": "https://github.com/intel/compute-runtime/releases/tag/25.18.33578.6", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "igc": { - "github_tag": "v2.10.10", - "version": "v2.10.10", - "url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.10.10", + "github_tag": "v2.11.7", + "version": "v2.11.7", + "url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.11.7", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "cm": { - "github_tag": "cmclang-1.0.144", - "version": "1.0.144", - "url": "https://github.com/intel/cm-compiler/releases/tag/cmclang-1.0.144", + "github_tag": "cmclang-1.0.119", + "version": "1.0.119", + "url": "https://github.com/intel/cm-compiler/releases/tag/cmclang-1.0.119", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "level_zero": { - "github_tag": "v1.20.2", - "version": "v1.20.2", - "url": "https://github.com/oneapi-src/level-zero/releases/tag/v1.20.2", + "github_tag": "v1.21.9", + "version": "v1.21.9", + "url": "https://github.com/oneapi-src/level-zero/releases/tag/v1.21.9", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "tbb": { - "github_tag": "v2022.0.0", - "version": "2022.0.0", - "url": "https://github.com/oneapi-src/oneTBB/releases/download/v2022.0.0/oneapi-tbb-2022.0.0-lin.tgz", + "github_tag": "v2022.1.0", + "version": "2022.1.0", + "url": "https://github.com/uxlfoundation/oneTBB/releases/download/v2022.1.0/oneapi-tbb-2022.1.0-lin.tgz", "root": "{DEPS_ROOT}/tbb/lin" }, "oclcpu": { - "github_tag": "2024-WW43", - "version": "2024.18.10.0.08", - "url": "https://github.com/intel/llvm/releases/download/2024-WW43/oclcpuexp-2024.18.10.0.08_rel.tar.gz", + "github_tag": "2025-WW13", + "version": "2025.19.3.0.17_230222", + "url": "https://github.com/intel/llvm/releases/download/2025-WW13/oclcpuexp-2025.19.3.0.17_230222_rel.tar.gz", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclcpu" - }, - "fpgaemu": { - "github_tag": "2024-WW43", - "version": "2024.18.10.0.08", - "url": "https://github.com/intel/llvm/releases/download/2024-WW43/fpgaemu-2024.18.10.0.08_rel.tar.gz", - "root": "{DEPS_ROOT}/opencl/runtime/linux/oclfpgaemu" - }, - "fpga": { - "root": "{ARCHIVE_ROOT}/comp/oclfpga/linux" } }, "windows": { @@ -53,25 +44,16 @@ "root": "" }, "tbb": { - "github_tag": "v2022.0.0", - "version": "2022.0.0", - "url": "https://github.com/oneapi-src/oneTBB/releases/download/v2022.0.0/oneapi-tbb-2022.0.0-win.zip", + "github_tag": "v2022.1.0", + "version": "2022.1.0", + "url": "https://github.com/uxlfoundation/oneTBB/releases/download/v2022.1.0/oneapi-tbb-2022.1.0-win.zip", "root": "{DEPS_ROOT}/tbb/win" }, "oclcpu": { - "github_tag": "2024-WW43", - "version": "2024.18.10.0.08", - "url": "https://github.com/intel/llvm/releases/download/2024-WW43/win-oclcpuexp-2024.18.10.0.08_rel.zip", + "github_tag": "2025-WW13", + "version": "2025.19.3.0.17_230222", + "url": "https://github.com/intel/llvm/releases/download/2025-WW13/win-oclcpuexp-2025.19.3.0.17_230222_rel.zip", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclcpu" - }, - "fpgaemu": { - "github_tag": "2024-WW43", - "version": "2024.18.10.0.08", - "url": "https://github.com/intel/llvm/releases/download/2024-WW43/win-fpgaemu-2024.18.10.0.08_rel.zip", - "root": "{DEPS_ROOT}/opencl/runtime/linux/oclfpgaemu" - }, - "fpga": { - "root": "{ARCHIVE_ROOT}/comp/oclfpga/win" } } } diff --git a/devops/scripts/install_build_tools.sh b/devops/scripts/install_build_tools.sh index 6c47fce4bdd06..7b86af3b24b9b 100755 --- a/devops/scripts/install_build_tools.sh +++ b/devops/scripts/install_build_tools.sh @@ -10,6 +10,7 @@ apt update && apt install -yqq \ python3-psutil \ python-is-python3 \ python3-pip \ + python3-venv \ ocl-icd-opencl-dev \ vim \ libffi-dev \ diff --git a/devops/scripts/install_drivers.sh b/devops/scripts/install_drivers.sh index 01c2dde54d6d0..cb2ebb4775264 100755 --- a/devops/scripts/install_drivers.sh +++ b/devops/scripts/install_drivers.sh @@ -2,6 +2,7 @@ set -e set -x +set -o pipefail if [ -f "$1" ]; then # Read data from the dependencies.json passed as the first argument. @@ -19,14 +20,6 @@ if [ -f "$1" ]; then IGC_DEV_VER=$(jq -r '.linux.igc_dev.version' $CONFIG_FILE_IGC_DEV) IGC_DEV_URL=$(jq -r '.linux.igc_dev.url' $CONFIG_FILE_IGC_DEV) fi -elif [[ "$*" == *"--use-latest"* ]]; then - CR_TAG=latest - IGC_TAG=latest - CM_TAG=latest - L0_TAG=latest - TBB_TAG=latest - FPGA_TAG=latest - CPU_TAG=latest else CR_TAG=$compute_runtime_tag IGC_TAG=$igc_tag @@ -43,11 +36,7 @@ fi function get_release() { REPO=$1 TAG=$2 - if [ "$TAG" == "latest" ]; then - URL="https://api.github.com/repos/${REPO}/releases/latest" - else - URL="https://api.github.com/repos/${REPO}/releases/tags/${TAG}" - fi + URL="https://api.github.com/repos/${REPO}/releases/tags/${TAG}" HEADER="" if [ "$GITHUB_TOKEN" != "" ]; then HEADER="Authorization: Bearer $GITHUB_TOKEN" @@ -149,7 +138,7 @@ InstallIGFX () { # Backup and install it from release igc as a temporarily workaround # while we working to resolve the issue. echo "Backup libopencl-clang" - cp -d /usr/local/lib/libopencl-clang2.so.14* . + cp -d /usr/local/lib/libopencl-clang2.so.15* . echo "Download IGC dev git hash $IGC_DEV_VER" get_pre_release_igfx $IGC_DEV_URL $IGC_DEV_VER echo "Install IGC dev git hash $IGC_DEV_VER" @@ -158,12 +147,12 @@ InstallIGFX () { dpkg -i --force-all *.deb echo "Install libopencl-clang" # Workaround only, will download deb and install with dpkg once fixed. - cp -d libopencl-clang2.so.14* /usr/local/lib/ + cp -d libopencl-clang2.so.15* /usr/local/lib/ rm /usr/local/lib/libigc.so /usr/local/lib/libigc.so.1* && \ ln -s /usr/local/lib/libigc.so.2 /usr/local/lib/libigc.so && \ ln -s /usr/local/lib/libigc.so.2 /usr/local/lib/libigc.so.1 echo "Clean up" - rm *.deb libopencl-clang2.so.14* + rm *.deb libopencl-clang2.so.15* echo "$IGC_DEV_TAG" > /usr/local/lib/igc/IGCTAG.txt fi } @@ -215,7 +204,6 @@ if [[ $# -eq 0 ]] ; then echo "--use-dev-igc - Install development version of Intel Graphics drivers instead" echo "--cpu - Install Intel CPU OpenCL runtime" echo "--fpga-emu - Install Intel FPGA Fast emulator" - echo "--use-latest - Use latest for all tags" echo "Set INSTALL_LOCATION env variable to specify install location" exit 0 fi diff --git a/devops/scripts/update_drivers.py b/devops/scripts/update_drivers.py index 41ea70aeaf089..5f66ae231a0f2 100644 --- a/devops/scripts/update_drivers.py +++ b/devops/scripts/update_drivers.py @@ -6,10 +6,18 @@ import argparse -def get_latest_release(repo): - releases = urlopen("https://api.github.com/repos/" + repo + "/releases").read() - return json.loads(releases)[0] - +def get_latest_release(repo, allow_prerelease=True): + url = "https://api.github.com/repos/" + repo + "/releases" + releases_raw = urlopen(url).read() + releases = json.loads(releases_raw) + if allow_prerelease: + return releases[0] + # The GitHub API doesn't allow us to filter prereleases + # in the query so do it manually. + for release in releases: + if release["prerelease"] == False: + return release + raise ValueError("No prereleases required but no releases found") def get_latest_workflow_runs(repo, workflow_name): action_runs = urlopen( @@ -38,7 +46,7 @@ def uplift_linux_igfx_driver(config, platform_tag, igc_dev_only): config[platform_tag]["igc_dev"]["version"] = igcdevver config[platform_tag]["igc_dev"]["updated_at"] = igc_dev["updated_at"] config[platform_tag]["igc_dev"]["url"] = get_artifacts_download_url( - "intel/intel-graphics-compiler", "IGC_Ubuntu24.04_llvm14_clang-" + igcdevver + "intel/intel-graphics-compiler", "IGC_Ubuntu24.04_llvm15_clang-" + igcdevver ) return config @@ -61,15 +69,20 @@ def uplift_linux_igfx_driver(config, platform_tag, igc_dev_only): "https://github.com/intel/intel-graphics-compiler/releases/tag/" + ver ) - cm = get_latest_release('intel/cm-compiler') - config[platform_tag]['cm']['github_tag'] = cm['tag_name'] - config[platform_tag]['cm']['version'] = cm['tag_name'].replace('cmclang-', '') - config[platform_tag]['cm']['url'] = 'https://github.com/intel/cm-compiler/releases/tag/' + cm['tag_name'] + cm = get_latest_release("intel/cm-compiler", allow_prerelease=False) + config[platform_tag]["cm"]["github_tag"] = cm["tag_name"] + config[platform_tag]["cm"]["version"] = cm["tag_name"].replace("cmclang-", "") + config[platform_tag]["cm"]["url"] = ( + "https://github.com/intel/cm-compiler/releases/tag/" + cm["tag_name"] + ) - level_zero = get_latest_release('oneapi-src/level-zero') - config[platform_tag]['level_zero']['github_tag'] = level_zero['tag_name'] - config[platform_tag]['level_zero']['version'] = level_zero['tag_name'] - config[platform_tag]['level_zero']['url'] = 'https://github.com/oneapi-src/level-zero/releases/tag/' + level_zero['tag_name'] + level_zero = get_latest_release("oneapi-src/level-zero", allow_prerelease=False) + config[platform_tag]["level_zero"]["github_tag"] = level_zero["tag_name"] + config[platform_tag]["level_zero"]["version"] = level_zero["tag_name"] + config[platform_tag]["level_zero"]["url"] = ( + "https://github.com/oneapi-src/level-zero/releases/tag/" + + level_zero["tag_name"] + ) return config