diff --git a/.github/workflows/sycl-containers-igc-dev.yaml b/.github/workflows/sycl-containers-igc-dev.yaml index 8a8f73285ae15..ae2a660a79e93 100644 --- a/.github/workflows/sycl-containers-igc-dev.yaml +++ b/.github/workflows/sycl-containers-igc-dev.yaml @@ -33,7 +33,7 @@ jobs: imagefile: ubuntu2404_intel_drivers tag: devigc build_args: | - "use_latest=false" + "use_unstable_driver=false" "use_igc_dev=true" steps: - name: Checkout diff --git a/.github/workflows/sycl-containers.yaml b/.github/workflows/sycl-containers.yaml index c80e344719238..2a77631d5f653 100644 --- a/.github/workflows/sycl-containers.yaml +++ b/.github/workflows/sycl-containers.yaml @@ -54,22 +54,22 @@ jobs: - name: Intel Drivers Ubuntu 22.04 Docker image file: ubuntu2204_intel_drivers tag: latest - build_args: "use_latest=false" + build_args: "use_unstable_driver=false" - name: Intel Drivers Ubuntu 24.04 Docker image file: ubuntu2404_intel_drivers tag: latest - build_args: "use_latest=false" + build_args: "use_unstable_driver=false" - name: Intel Drivers (unstable) Ubuntu 24.04 Docker image file: ubuntu2404_intel_drivers tag: unstable - build_args: "use_latest=true" + build_args: "use_unstable_driver=true" - name: Build + Intel Drivers Ubuntu 22.04 Docker image file: ubuntu2204_intel_drivers tag: alldeps build_args: | base_image=ghcr.io/intel/llvm/ubuntu2204_build base_tag=latest - use_latest=false + use_unstable_driver=false steps: - name: Checkout uses: actions/checkout@v4 @@ -82,7 +82,6 @@ jobs: file: ${{ matrix.file }} username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - sycl_ci_passwd: ${{ secrets.DOCKER_SUDO_PASSWORD }} tags: | ghcr.io/${{ github.repository }}/${{ matrix.file }}:${{ matrix.tag }}-${{ github.sha }} ghcr.io/${{ github.repository }}/${{ matrix.file }}:${{ matrix.tag }} diff --git a/.github/workflows/sycl-linux-precommit.yml b/.github/workflows/sycl-linux-precommit.yml index cf1a488c87c81..8baa70e8b878b 100644 --- a/.github/workflows/sycl-linux-precommit.yml +++ b/.github/workflows/sycl-linux-precommit.yml @@ -72,6 +72,53 @@ jobs: else echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT" fi + + build_e2e_tests: + needs: [build] + if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }} + uses: ./.github/workflows/sycl-linux-run-tests.yml + with: + name: Build e2e tests + runner: '["Linux", "build"]' + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest + image_options: -u 1001 + ref: ${{ github.sha }} + merge_ref: '' + sycl_toolchain_artifact: sycl_linux_default + sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }} + sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }} + e2e_testing_mode: 'build-only' + run_prebuilt_e2e_tests: + needs: [build, build_e2e_tests] + if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }} + strategy: + fail-fast: false + matrix: + include: + - name: Intel + runner: '["Linux", "gen12"]' + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest + 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;opencl:gpu;opencl:cpu + reset_intel_gpu: true + extra_lit_opts: --param gpu-intel-gen12=True + uses: ./.github/workflows/sycl-linux-run-tests.yml + with: + name: ${{ matrix.name }} + runner: ${{ matrix.runner }} + image: ${{ matrix.image }} + image_options: ${{ matrix.image_options }} + target_devices: ${{ matrix.target_devices }} + extra_lit_opts: --param fallback-to-build-if-requires-build-and-run=True ${{ matrix.extra_lit_opts }} + reset_intel_gpu: ${{ matrix.reset_intel_gpu }} + ref: ${{ github.sha }} + merge_ref: '' + sycl_toolchain_artifact: sycl_linux_default + sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }} + sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }} + e2e_binaries_artifact: sycl_e2e_bin_default + e2e_testing_mode: 'run-only' + test: needs: [build, detect_changes, determine_arc_tests] if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }} @@ -90,16 +137,9 @@ jobs: image_options: -u 1001 --device=/dev/dri --device=/dev/kfd target_devices: ext_oneapi_hip:gpu reset_intel_gpu: false - - name: Intel - runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest - 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;opencl:gpu;opencl:cpu - reset_intel_gpu: true - extra_lit_opts: --param gpu-intel-gen12=True - name: E2E tests on Intel Arc A-Series Graphics runner: '["Linux", "arc"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest 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;opencl:gpu reset_intel_gpu: true @@ -161,12 +201,12 @@ jobs: include: - name: Intel GEN12 Graphics system runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_extra_opts: --device=/dev/dri reset_intel_gpu: true - name: Intel Arc A-Series Graphics system runner: '["Linux", "arc"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_extra_opts: --device=/dev/dri reset_intel_gpu: true - name: AMD system diff --git a/.github/workflows/sycl-linux-run-tests.yml b/.github/workflows/sycl-linux-run-tests.yml index a1062dbbdd5ad..4eff7a47c6c15 100644 --- a/.github/workflows/sycl-linux-run-tests.yml +++ b/.github/workflows/sycl-linux-run-tests.yml @@ -19,7 +19,7 @@ on: target_devices: type: string - required: True + required: False extra_cmake_args: type: string required: False @@ -59,6 +59,30 @@ on: default: '' required: False + e2e_binaries_artifact: + description: | + By setting this the E2E binaries folder will not be created, rather it + will be downloaded and extracted from the specified artifact. When + running tests in `run-only` mode this must be provided. + type: string + default: '' + required: False + e2e_testing_mode: + description: | + Testing mode to run E2E tests in, can be either `full`, `build-only` + or `run-only`. In `build-only` mode an artifact of the E2E binaries + will be uploaded. + type: string + default: 'full' + artifact_suffix: + description: 'Suffix for E2E binaries artifact that is output when in `build-only`.' + type: string + default: 'default' + retention-days: + description: 'E2E binaries artifact retention period.' + type: string + default: 1 + reset_intel_gpu: type: string required: False @@ -87,6 +111,7 @@ on: - '["amdgpu"]' - '["Linux", "arc"]' - '["cts-cpu"]' + - '["Linux", "build"]' image: description: | Use option ending with ":build" for AMDGPU, ":latest" for the rest. @@ -142,6 +167,11 @@ on: options: - false - true + e2e_testing_mode: + type: choice + options: + - "full" + - "build-only" permissions: contents: read @@ -159,8 +189,8 @@ jobs: - name: Reset Intel GPU if: inputs.reset_intel_gpu == 'true' run: | - cat /run/secrets/sycl_passwd | sudo -S mount -t debugfs none /sys/kernel/debug - cat /run/secrets/sycl_passwd | sudo -S bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged' + sudo mount -t debugfs none /sys/kernel/debug + sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged' - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} @@ -196,9 +226,9 @@ jobs: run: | if [ "${{ inputs.install_dev_igc_driver }}" = "true" ]; then # If libllvm14 is already installed (dev igc docker), still return true. - cat /run/secrets/sycl_passwd | sudo -S apt-get install -yqq libllvm14 || true; + sudo apt-get install -yqq libllvm14 || true; fi - cat /run/secrets/sycl_passwd | sudo -S -E bash devops/scripts/install_drivers.sh llvm/devops/dependencies.json ${{ inputs.install_dev_igc_driver == 'true' && 'llvm/devops/dependencies-igc-dev.json --use-dev-igc' || '' }} --all + sudo -E bash devops/scripts/install_drivers.sh llvm/devops/dependencies.json ${{ inputs.install_dev_igc_driver == 'true' && 'llvm/devops/dependencies-igc-dev.json --use-dev-igc' || '' }} --all - name: Source OneAPI TBB vars.sh shell: bash run: | @@ -270,8 +300,19 @@ jobs: cat /usr/local/lib/igc/IGCTAG.txt fi + - name: Download E2E Binaries + if: inputs.e2e_binaries_artifact != '' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.e2e_binaries_artifact }} + - name: Extract E2E Binaries + if: inputs.e2e_binaries_artifact != '' + run: | + mkdir build-e2e + tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e + - name: Deduce E2E CMake options - if: inputs.tests_selector == 'e2e' + if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == '' id: cmake_opts shell: bash env: @@ -281,14 +322,14 @@ jobs: echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT fi - name: Configure E2E tests - if: inputs.tests_selector == 'e2e' + if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == '' run: | - cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.target_devices }}" -DCMAKE_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="$(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} if: inputs.tests_selector == 'e2e' env: - LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests ${{ inputs.extra_lit_opts }} + LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param test-mode=${{ inputs.e2e_testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }} run: | ninja -C build-e2e check-sycl-e2e > e2e.log 2>&1 exit_code=$? @@ -375,3 +416,13 @@ jobs: grep 'exit code: [^0]' -r logs >> $GITHUB_STEP_SUMMARY exit $ret + - name: Pack E2E binaries + if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}} + run: tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C ./build-e2e . + - name: Upload E2E binaries + if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}} + uses: actions/upload-artifact@v4 + with: + name: sycl_e2e_bin_${{ inputs.artifact_suffix }} + path: e2e_binaries.tar.zst + retention-days: ${{ inputs.retention-days }} diff --git a/.github/workflows/sycl-nightly.yml b/.github/workflows/sycl-nightly.yml index 74129a444d2c7..1c1c5c6d1f398 100644 --- a/.github/workflows/sycl-nightly.yml +++ b/.github/workflows/sycl-nightly.yml @@ -52,7 +52,7 @@ jobs: - name: Intel L0 GPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest 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 @@ -61,7 +61,7 @@ jobs: - name: Intel OCL GPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest 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 @@ -70,35 +70,35 @@ jobs: - name: OCL CPU (AMD) runner: '["Linux", "amdgpu"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 target_devices: opencl:cpu tests_selector: e2e - name: OCL CPU (Intel/GEN12) runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 --privileged --cap-add SYS_ADMIN target_devices: opencl:cpu tests_selector: e2e - name: OCL CPU (Intel/Arc) runner: '["Linux", "arc"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 target_devices: opencl:cpu tests_selector: e2e - name: SYCL-CTS on OCL CPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN target_devices: opencl:cpu tests_selector: cts - name: SYCL-CTS on L0 gen12 runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu tests_selector: cts @@ -229,7 +229,7 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} build-args: | - base_image=ghcr.io/intel/llvm/ubuntu2204_intel_drivers + base_image=ghcr.io/intel/llvm/ubuntu2404_intel_drivers base_tag=latest tags: | ghcr.io/${{ github.repository }}/sycl_ubuntu2204_nightly:${{ github.sha }} diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index 89e293736a1bd..98bb914c3f83a 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -82,7 +82,7 @@ jobs: with: name: ${{ matrix.name }} runner: ${{ matrix. runner }} - image: ${{ matrix.image || 'ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest' }} + image: ${{ matrix.image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest' }} image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN' }} target_devices: ${{ matrix.target_devices || 'level_zero:gpu' }} reset_intel_gpu: ${{ matrix.reset_intel_gpu }} diff --git a/.github/workflows/sycl-rel-nightly.yml b/.github/workflows/sycl-rel-nightly.yml index 01ecd64882b74..3563b14bcb88c 100644 --- a/.github/workflows/sycl-rel-nightly.yml +++ b/.github/workflows/sycl-rel-nightly.yml @@ -54,14 +54,14 @@ jobs: include: - name: AMD/HIP runner: '["Linux", "amdgpu"]' - image: ghcr.io/intel/llvm/ubuntu2204_build:latest + image: ghcr.io/intel/llvm/ubuntu2404_build:latest image_options: -u 1001 --device=/dev/dri --device=/dev/kfd target_devices: ext_oneapi_hip:gpu tests_selector: e2e - name: Intel L0 GPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest 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 @@ -70,7 +70,7 @@ jobs: - name: Intel OCL GPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest 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 @@ -79,21 +79,21 @@ jobs: - name: Intel OCL CPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 --privileged --cap-add SYS_ADMIN target_devices: opencl:cpu tests_selector: e2e - name: SYCL-CTS on OCL CPU runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN target_devices: opencl:cpu tests_selector: cts - name: SYCL-CTS on L0 gen12 runner: '["Linux", "gen12"]' - image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest + image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu tests_selector: cts diff --git a/devops/actions/build_container/action.yml b/devops/actions/build_container/action.yml index 8b992b5a2c050..5ff5f3e209bff 100644 --- a/devops/actions/build_container/action.yml +++ b/devops/actions/build_container/action.yml @@ -21,9 +21,6 @@ inputs: file: description: "Dockerfile" required: true - sycl_ci_passwd: - description: "Password to assign to sycl_ci user within a container" - required: true runs: using: "composite" @@ -44,4 +41,3 @@ runs: file: ${{ github.workspace }}/devops/containers/${{ inputs.file }}.Dockerfile secrets: | github_token=${{ github.token }} - sycl_ci_passwd=${{ inputs.sycl_ci_passwd }} diff --git a/devops/containers/ubuntu2204_base.Dockerfile b/devops/containers/ubuntu2204_base.Dockerfile index b694124c26f13..d08b6025e9908 100644 --- a/devops/containers/ubuntu2204_base.Dockerfile +++ b/devops/containers/ubuntu2204_base.Dockerfile @@ -9,13 +9,13 @@ COPY scripts/install_build_tools.sh /install.sh RUN /install.sh COPY scripts/create-sycl-user.sh /user-setup.sh -RUN --mount=type=secret,id=sycl_ci_passwd /user-setup.sh +RUN /user-setup.sh COPY actions/cached_checkout /actions/cached_checkout COPY actions/cleanup /actions/cleanup COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh COPY scripts/install_drivers.sh /opt/install_drivers.sh -USER sycl_ci +USER sycl ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2204_build.Dockerfile b/devops/containers/ubuntu2204_build.Dockerfile index ee8a32411f742..1aa814aaa775c 100644 --- a/devops/containers/ubuntu2204_build.Dockerfile +++ b/devops/containers/ubuntu2204_build.Dockerfile @@ -31,11 +31,11 @@ RUN apt update && apt install -yqq rocm-dev && \ rm -rf /var/lib/apt/lists/* COPY scripts/create-sycl-user.sh /user-setup.sh -RUN --mount=type=secret,id=sycl_ci_passwd /user-setup.sh +RUN /user-setup.sh COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh -USER sycl_ci +USER sycl ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index 951a5d3c854c0..58ec09bb5feb2 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -5,7 +5,7 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive -ARG use_latest=true +ARG use_unstable_driver=true USER root @@ -18,7 +18,7 @@ COPY dependencies.json / RUN mkdir /runtimes ENV INSTALL_LOCATION=/runtimes RUN --mount=type=secret,id=github_token \ - if [ "$use_latest" = "true" ]; then \ + if [ "$use_unstable_driver" = "true" ]; then \ install_driver_opt=" --use-latest"; \ else \ install_driver_opt=" dependencies.json"; \ diff --git a/devops/containers/ubuntu2404_base.Dockerfile b/devops/containers/ubuntu2404_base.Dockerfile index adc1695ded6f7..7af9ccfec1e5f 100644 --- a/devops/containers/ubuntu2404_base.Dockerfile +++ b/devops/containers/ubuntu2404_base.Dockerfile @@ -9,13 +9,13 @@ COPY scripts/install_build_tools.sh /install.sh RUN /install.sh COPY scripts/create-sycl-user.sh /user-setup.sh -RUN --mount=type=secret,id=sycl_ci_passwd /user-setup.sh +RUN /user-setup.sh COPY actions/cached_checkout /actions/cached_checkout COPY actions/cleanup /actions/cleanup COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh COPY scripts/install_drivers.sh /opt/install_drivers.sh -USER sycl_ci +USER sycl ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2404_build_oneapi.Dockerfile b/devops/containers/ubuntu2404_build_oneapi.Dockerfile index 8f0d0b5d27bb3..48e617328539d 100644 --- a/devops/containers/ubuntu2404_build_oneapi.Dockerfile +++ b/devops/containers/ubuntu2404_build_oneapi.Dockerfile @@ -39,11 +39,11 @@ RUN apt update && apt install -yqq rocm-dev intel-oneapi-compiler-dpcpp-cpp && \ rm -rf /var/lib/apt/lists/* COPY scripts/create-sycl-user.sh /user-setup.sh -RUN --mount=type=secret,id=sycl_ci_passwd /user-setup.sh +RUN /user-setup.sh COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh -USER sycl_ci +USER sycl ENTRYPOINT ["/docker_entrypoint.sh"] diff --git a/devops/containers/ubuntu2404_intel_drivers.Dockerfile b/devops/containers/ubuntu2404_intel_drivers.Dockerfile index 1cb8857fecc5e..2e9997c3a3770 100644 --- a/devops/containers/ubuntu2404_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2404_intel_drivers.Dockerfile @@ -5,7 +5,7 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive -ARG use_latest=true +ARG use_unstable_driver=true USER root @@ -18,7 +18,7 @@ COPY dependencies.json / RUN mkdir /runtimes ENV INSTALL_LOCATION=/runtimes RUN --mount=type=secret,id=github_token \ - if [ "$use_latest" = "true" ]; then \ + if [ "$use_unstable_driver" = "true" ]; then \ install_driver_opt=" --use-latest"; \ else \ install_driver_opt=" dependencies.json"; \ diff --git a/devops/dependencies.json b/devops/dependencies.json index 755a1f10625fb..fc9003ec4ad54 100644 --- a/devops/dependencies.json +++ b/devops/dependencies.json @@ -1,15 +1,15 @@ { "linux": { "compute_runtime": { - "github_tag": "24.39.31294.12", - "version": "24.39.31294.12", - "url": "https://github.com/intel/compute-runtime/releases/tag/24.39.31294.12", + "github_tag": "24.45.31740.9", + "version": "24.45.31740.9", + "url": "https://github.com/intel/compute-runtime/releases/tag/24.45.31740.9", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "igc": { - "github_tag": "igc-1.0.17791.9", - "version": "1.0.17791.9", - "url": "https://github.com/intel/intel-graphics-compiler/releases/tag/igc-1.0.17791.9", + "github_tag": "v2.1.12", + "version": "2.1.12", + "url": "https://github.com/intel/intel-graphics-compiler/releases/tag/v2.1.12", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "cm": { @@ -19,9 +19,9 @@ "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "level_zero": { - "github_tag": "v1.18.5", - "version": "v1.18.5", - "url": "https://github.com/oneapi-src/level-zero/releases/tag/v1.18.5", + "github_tag": "v1.19.2", + "version": "v1.19.2", + "url": "https://github.com/oneapi-src/level-zero/releases/tag/v1.19.2", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "tbb": { diff --git a/devops/scripts/create-sycl-user.sh b/devops/scripts/create-sycl-user.sh index 43633f4499adc..7199f1eaf10cd 100755 --- a/devops/scripts/create-sycl-user.sh +++ b/devops/scripts/create-sycl-user.sh @@ -2,28 +2,13 @@ set -e -if [[ $# -eq 0 ]]; then - # When launched without arguments, we assume that it was launched as part of - # CI workflow and therefore a different kind of user is created - USER_NAME=sycl_ci - SET_PASSWD=true +USER_NAME=sycl - # By default Ubuntu sets an arbitrary UID value, that is different from host - # system. When CI passes default UID value of 1001, some of LLVM tools fail to - # discover user home directory and fail a few LIT tests. Fixes UID and GID to - # 1001, that is used as default by GitHub Actions. - USER_ID=1001 -else - if [[ "${1:-}" != "--regular" ]]; then - echo "The only supported argument is --regular!" - exit 1 - fi - USER_NAME=sycl - SET_PASSWD=false - - # Some user id which is different from the one assigned to sycl_ci user - USER_ID=1234 -fi +# By default Ubuntu sets an arbitrary UID value, that is different from host +# system. When CI passes default UID value of 1001, some of LLVM tools fail to +# discover user home directory and fail a few LIT tests. Fixes UID and GID to +# 1001, that is used as default by GitHub Actions. +USER_ID=1001 groupadd -g $USER_ID $USER_NAME && useradd $USER_NAME -u $USER_ID -g $USER_ID -m -s /bin/bash # Add user to video/irc groups so that it can access GPU @@ -34,17 +19,5 @@ usermod -aG irc $USER_NAME groupadd -f -g 109 render usermod -aG render $USER_NAME -if [[ $SET_PASSWD == true ]]; then - if [[ ! -f /run/secrets/sycl_ci_passwd ]]; then - echo "Password is requested, but /run/secrets/sycl_ci_passwd doesn't exist!" - exit 2 - fi - - # Set password for user - echo "$USER_NAME:$(cat /run/secrets/sycl_ci_passwd)" | chpasswd - - # Allow user to run as sudo, but only with password - echo "$USER_NAME ALL=(ALL) PASSWD:ALL" >> /etc/sudoers -else - echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers -fi +# Allow user to run as sudo (without a password) +echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers diff --git a/devops/scripts/install_drivers.sh b/devops/scripts/install_drivers.sh index e790691462d94..570f78091d9f2 100755 --- a/devops/scripts/install_drivers.sh +++ b/devops/scripts/install_drivers.sh @@ -120,10 +120,7 @@ InstallIGFX () { # # Of course, this also installed the libopencl-clang so that we can copy and use later as a temporariy workaround. IS_IGC_DEV=$(CheckIGCdevTag $IGCTAG) - UBUNTU_VER="u22\.04" - if [ "$IS_IGC_DEV" == "Yes" ] || [ "$L0_TAG" == "latest" ]; then - UBUNTU_VER="u24\.04" - fi + UBUNTU_VER="u24\.04" get_release intel/intel-graphics-compiler $IGC_TAG \ | grep ".*deb" \ | wget -qi - @@ -143,7 +140,7 @@ InstallIGFX () { get_release oneapi-src/level-zero $L0_TAG \ | grep ".*$UBUNTU_VER.*deb" \ | wget -qi - - dpkg -i *.deb && rm *.deb *.sum + dpkg -i --force-overwrite *.deb && rm *.deb *.sum mkdir -p /usr/local/lib/igc/ echo "$IGC_TAG" > /usr/local/lib/igc/IGCTAG.txt if [ "$IS_IGC_DEV" == "Yes" ]; then diff --git a/sycl/doc/developer/DockerBKMs.md b/sycl/doc/developer/DockerBKMs.md index e36585c335090..83ced6fbbf220 100644 --- a/sycl/doc/developer/DockerBKMs.md +++ b/sycl/doc/developer/DockerBKMs.md @@ -143,23 +143,12 @@ instructions. ## Changing Docker user -By default all processes within our containers are run as the `sycl_ci` user. -Note: it **does not** have password-less `root` access. +By default all processes within our containers are run as the `sycl` user which +has password-less `sudo` access. If you want to change the user, you can do that by specifying the `-u <username or uid>` option when running the container. -All containers come with the `/user-setup.sh` script which can used to create -the `sycl` user which has all the same groups as the `sycl_ci` user, but also -has password-less access to `root`. Use the script as follows: - -```bash -# Note: the script requires root permissions to create a new user -/user-setup.sh --regular -# Switch to the newly created user -su - sycl -``` - ## Managing downloaded Docker images List local images: diff --git a/sycl/test-e2e/AOT/cpu.cpp b/sycl/test-e2e/AOT/cpu.cpp index f0c71be2d481e..e7bedc04b07ba 100644 --- a/sycl/test-e2e/AOT/cpu.cpp +++ b/sycl/test-e2e/AOT/cpu.cpp @@ -7,6 +7,7 @@ //===---------------------------------------------------------------------===// // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/AOT/double.cpp b/sycl/test-e2e/AOT/double.cpp index ead41bfc8c741..4d48f5c7b57ec 100644 --- a/sycl/test-e2e/AOT/double.cpp +++ b/sycl/test-e2e/AOT/double.cpp @@ -2,6 +2,7 @@ // using fp64 can be compiled AOT. // REQUIRES: ocloc, opencl-aot, any-device-is-cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s // RUN: %if cpu %{ %{run} %t.x86.out %} diff --git a/sycl/test-e2e/AOT/half.cpp b/sycl/test-e2e/AOT/half.cpp index e843ee65bbeef..5711b21735f72 100644 --- a/sycl/test-e2e/AOT/half.cpp +++ b/sycl/test-e2e/AOT/half.cpp @@ -2,6 +2,7 @@ // using fp16 can be compiled AOT. // REQUIRES: ocloc, opencl-aot, any-device-is-cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s // RUN: %if cpu %{ %{run} %t.x86.out %} diff --git a/sycl/test-e2e/Adapters/sycl-ls-gpu-default-any.cpp b/sycl/test-e2e/Adapters/sycl-ls-gpu-default-any.cpp index 046a41494370b..1c90ea9f1e32f 100644 --- a/sycl/test-e2e/Adapters/sycl-ls-gpu-default-any.cpp +++ b/sycl/test-e2e/Adapters/sycl-ls-gpu-default-any.cpp @@ -1,4 +1,5 @@ // REQUIRES: gpu +// REQUIRES: build-and-run-mode // TODO: Remove unsetting SYCL_DEVICE_FILTER when feature is dropped // RUN: env --unset=SYCL_DEVICE_FILTER --unset=ONEAPI_DEVICE_SELECTOR sycl-ls --verbose >%t.default.out diff --git a/sycl/test-e2e/Adapters/sycl-ls-gpu-default-level-zero.cpp b/sycl/test-e2e/Adapters/sycl-ls-gpu-default-level-zero.cpp index 6f144553fff7b..cd6ece996d9f8 100644 --- a/sycl/test-e2e/Adapters/sycl-ls-gpu-default-level-zero.cpp +++ b/sycl/test-e2e/Adapters/sycl-ls-gpu-default-level-zero.cpp @@ -1,4 +1,5 @@ // REQUIRES: gpu, level-zero +// REQUIRES: build-and-run-mode // TODO: Remove unsetting SYCL_DEVICE_FILTER when feature is dropped // RUN: env --unset=SYCL_DEVICE_FILTER --unset=ONEAPI_DEVICE_SELECTOR sycl-ls --verbose >%t.default.out diff --git a/sycl/test-e2e/Adapters/sycl-ls-gpu-level-zero.cpp b/sycl/test-e2e/Adapters/sycl-ls-gpu-level-zero.cpp index 36eb621e923a6..f20ea34182833 100644 --- a/sycl/test-e2e/Adapters/sycl-ls-gpu-level-zero.cpp +++ b/sycl/test-e2e/Adapters/sycl-ls-gpu-level-zero.cpp @@ -1,4 +1,5 @@ // REQUIRES: gpu, level_zero +// REQUIRES: build-and-run-mode // RUN: sycl-ls --verbose >%t.default.out // RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.default.out diff --git a/sycl/test-e2e/Adapters/sycl-ls-gpu-opencl.cpp b/sycl/test-e2e/Adapters/sycl-ls-gpu-opencl.cpp index fa764d0629a0f..fda84100fecd6 100644 --- a/sycl/test-e2e/Adapters/sycl-ls-gpu-opencl.cpp +++ b/sycl/test-e2e/Adapters/sycl-ls-gpu-opencl.cpp @@ -1,4 +1,5 @@ // REQUIRES: gpu, opencl +// REQUIRES: build-and-run-mode // RUN: env ONEAPI_DEVICE_SELECTOR="opencl:*" sycl-ls --verbose >%t.opencl.out // RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.opencl.out diff --git a/sycl/test-e2e/Adapters/sycl-ls-uuid-subdevs.cpp b/sycl/test-e2e/Adapters/sycl-ls-uuid-subdevs.cpp index b7f83f8f337cd..f5d155d15ee5b 100644 --- a/sycl/test-e2e/Adapters/sycl-ls-uuid-subdevs.cpp +++ b/sycl/test-e2e/Adapters/sycl-ls-uuid-subdevs.cpp @@ -1,4 +1,5 @@ /* Test to check that sycl-ls is outputting UUID and number of sub and sub-sub +// REQUIRES: build-and-run-mode * devices. */ // REQUIRES: gpu, level_zero diff --git a/sycl/test-e2e/AddressSanitizer/nullpointer/private_nullptr.cpp b/sycl/test-e2e/AddressSanitizer/nullpointer/private_nullptr.cpp index 27b4b5a6fab17..fd7cae43dd3ea 100644 --- a/sycl/test-e2e/AddressSanitizer/nullpointer/private_nullptr.cpp +++ b/sycl/test-e2e/AddressSanitizer/nullpointer/private_nullptr.cpp @@ -7,7 +7,7 @@ // RUN: %{run} not %t3.out 2>&1 | FileCheck %s // FIXME: There's an issue in gfx driver, so this test pending here. -// XFAIL: * +// XFAIL: run-mode #include <sycl/detail/core.hpp> #include <sycl/ext/oneapi/experimental/address_cast.hpp> diff --git a/sycl/test-e2e/BFloat16/bfloat16_example_aot.cpp b/sycl/test-e2e/BFloat16/bfloat16_example_aot.cpp index 8337716c3191e..32c6c3aae8f06 100644 --- a/sycl/test-e2e/BFloat16/bfloat16_example_aot.cpp +++ b/sycl/test-e2e/BFloat16/bfloat16_example_aot.cpp @@ -4,6 +4,7 @@ /// // REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64 %s -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/BFloat16/bfloat16_example_aot_cpu.cpp b/sycl/test-e2e/BFloat16/bfloat16_example_aot_cpu.cpp index 2f6d893768c4e..9231a62428272 100644 --- a/sycl/test-e2e/BFloat16/bfloat16_example_aot_cpu.cpp +++ b/sycl/test-e2e/BFloat16/bfloat16_example_aot_cpu.cpp @@ -4,6 +4,7 @@ /// // REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out // RUN: %if cpu %{ %{run} %t.out %} diff --git a/sycl/test-e2e/Basic/build_log.cpp b/sycl/test-e2e/Basic/build_log.cpp index ae63b0bb5b287..69f039dde80db 100644 --- a/sycl/test-e2e/Basic/build_log.cpp +++ b/sycl/test-e2e/Basic/build_log.cpp @@ -1,5 +1,5 @@ // REQUIRES: opencl || level_zero, gpu, ocloc -// UNSUPPORTED: gpu-intel-dg1 +// UNSUPPORTED: arch-intel_gpu_dg1 // // RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out // RUN: env SYCL_RT_WARNING_LEVEL=2 %{run} %t.out 2>&1 | FileCheck %s diff --git a/sycl/test-e2e/Basic/query.cpp b/sycl/test-e2e/Basic/query.cpp index 01576c78d2587..12a64a2e4452c 100644 --- a/sycl/test-e2e/Basic/query.cpp +++ b/sycl/test-e2e/Basic/query.cpp @@ -1,5 +1,5 @@ // RUN: %{build} -o %t.out // RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="*:gpu" %t.out -// REQUIRES: gpu-intel-dg1 +// REQUIRES: arch-intel_gpu_dg1 #include "query.hpp" diff --git a/sycl/test-e2e/Compression/compression_aot.cpp b/sycl/test-e2e/Compression/compression_aot.cpp index b8293f1c79351..ba95974fde781 100644 --- a/sycl/test-e2e/Compression/compression_aot.cpp +++ b/sycl/test-e2e/Compression/compression_aot.cpp @@ -1,5 +1,6 @@ // End-to-End test for testing device image compression in AOT. // REQUIRES: zstd, opencl-aot, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %O0 --offload-compress --offload-compression-level=3 %S/Inputs/single_kernel.cpp -o %t_compress.out // RUN: %{run} %t_compress.out diff --git a/sycl/test-e2e/Compression/compression_separate_compile.cpp b/sycl/test-e2e/Compression/compression_separate_compile.cpp index dab17e3506b4e..afbe442230e29 100644 --- a/sycl/test-e2e/Compression/compression_separate_compile.cpp +++ b/sycl/test-e2e/Compression/compression_separate_compile.cpp @@ -2,6 +2,7 @@ // seperatly compile and link device images. // REQUIRES: zstd, opencl-aot, cpu, linux +// REQUIRES: build-and-run-mode ////////////////////// Compile device images // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL1' -DENABLE_KERNEL1 -c %s -o %t_kernel1_aot.o diff --git a/sycl/test-e2e/DeviceArchitecture/device_architecture_on_device_aot.cpp b/sycl/test-e2e/DeviceArchitecture/device_architecture_on_device_aot.cpp index a62ae965683ae..1d4c41f117136 100644 --- a/sycl/test-e2e/DeviceArchitecture/device_architecture_on_device_aot.cpp +++ b/sycl/test-e2e/DeviceArchitecture/device_architecture_on_device_aot.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %s -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/DeviceCodeSplit/aot-cpu.cpp b/sycl/test-e2e/DeviceCodeSplit/aot-cpu.cpp index d2937b796fe63..319c69af0faef 100644 --- a/sycl/test-e2e/DeviceCodeSplit/aot-cpu.cpp +++ b/sycl/test-e2e/DeviceCodeSplit/aot-cpu.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-device-code-split=per_source -fsycl-targets=spir64_x86_64 -I %S/Inputs -o %t.out %S/split-per-source-main.cpp %S/Inputs/split-per-source-second-file.cpp \ // RUN: -fsycl-dead-args-optimization diff --git a/sycl/test-e2e/DeviceLib/assert-aot.cpp b/sycl/test-e2e/DeviceLib/assert-aot.cpp index ccff887e80adf..f5c8c61f07d78 100644 --- a/sycl/test-e2e/DeviceLib/assert-aot.cpp +++ b/sycl/test-e2e/DeviceLib/assert-aot.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu, linux +// REQUIRES: build-and-run-mode // RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=spir64_x86_64 %S/assert.cpp -o %t.aot.out // RUN: env EXPECTED_SIGNAL=SIGABRT SHOULD_CRASH=1 %{run} %t.aot.out 2>&1 | FileCheck %S/assert.cpp --check-prefixes=CHECK-MESSAGE diff --git a/sycl/test-e2e/DeviceLib/cmath-aot.cpp b/sycl/test-e2e/DeviceLib/cmath-aot.cpp index bb9e201de9282..c9897f652f034 100644 --- a/sycl/test-e2e/DeviceLib/cmath-aot.cpp +++ b/sycl/test-e2e/DeviceLib/cmath-aot.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // UNSUPPORTED: windows // DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%} diff --git a/sycl/test-e2e/ESIMD/PerformanceTests/invoke_simd_smoke.cpp b/sycl/test-e2e/ESIMD/PerformanceTests/invoke_simd_smoke.cpp index c6d419f486a9b..8c148091356fa 100644 --- a/sycl/test-e2e/ESIMD/PerformanceTests/invoke_simd_smoke.cpp +++ b/sycl/test-e2e/ESIMD/PerformanceTests/invoke_simd_smoke.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// XFAIL: igc-dev +// XFAIL: gpu-intel-dg2 // XFAIL-TRACKER: https://github.com/intel/llvm/issues/16388 // REQUIRES: gpu-intel-dg2 && level_zero // UNSUPPORTED: windows diff --git a/sycl/test-e2e/ESIMD/dp4a.cpp b/sycl/test-e2e/ESIMD/dp4a.cpp index 129e7bdb702d6..0b99016d06a23 100644 --- a/sycl/test-e2e/ESIMD/dp4a.cpp +++ b/sycl/test-e2e/ESIMD/dp4a.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // TODO enable on Windows -// REQUIRES: linux && gpu-intel-dg1 +// REQUIRES: linux && arch-intel_gpu_dg1 // RUN: %{build} -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/InvokeSimd/Regression/ImplicitSubgroup/dp4a.cpp b/sycl/test-e2e/InvokeSimd/Regression/ImplicitSubgroup/dp4a.cpp index 72bad9c621b8e..078a02eed1f9b 100644 --- a/sycl/test-e2e/InvokeSimd/Regression/ImplicitSubgroup/dp4a.cpp +++ b/sycl/test-e2e/InvokeSimd/Regression/ImplicitSubgroup/dp4a.cpp @@ -1,4 +1,4 @@ -// REQUIRES: gpu-intel-dg1 || gpu-intel-dg2 || arch-intel_gpu_pvc +// REQUIRES: arch-intel_gpu_dg1 || gpu-intel-dg2 || arch-intel_gpu_pvc // // Check that full compilation works: // RUN: %clangxx -DIMPL_SUBGROUP -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %S/../dp4a.cpp -o %t.out diff --git a/sycl/test-e2e/InvokeSimd/Regression/dp4a.cpp b/sycl/test-e2e/InvokeSimd/Regression/dp4a.cpp index 15be55f7dde64..1b7a728a925a1 100644 --- a/sycl/test-e2e/InvokeSimd/Regression/dp4a.cpp +++ b/sycl/test-e2e/InvokeSimd/Regression/dp4a.cpp @@ -1,4 +1,4 @@ -// REQUIRES: gpu-intel-dg1 || gpu-intel-dg2 || arch-intel_gpu_pvc +// REQUIRES: arch-intel_gpu_dg1 || gpu-intel-dg2 || arch-intel_gpu_pvc // // Check that full compilation works: // RUN: %{build} -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr -o %t.out diff --git a/sycl/test-e2e/Matrix/get_coordinate_ops.cpp b/sycl/test-e2e/Matrix/get_coordinate_ops.cpp index b32145b954422..ed404612a9ff3 100644 --- a/sycl/test-e2e/Matrix/get_coordinate_ops.cpp +++ b/sycl/test-e2e/Matrix/get_coordinate_ops.cpp @@ -6,9 +6,6 @@ // //===----------------------------------------------------------------------===// // REQUIRES: aspect-ext_intel_matrix - -// XFAIL: !igc-dev -// XFAIL-TRACKER: GSD-6376 // REQUIRES-INTEL-DRIVER: lin: 30049 // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/Matrix/get_coordinate_ops_impl.hpp b/sycl/test-e2e/Matrix/get_coordinate_ops_impl.hpp index a21f3daa47b1a..8cbd24b302171 100644 --- a/sycl/test-e2e/Matrix/get_coordinate_ops_impl.hpp +++ b/sycl/test-e2e/Matrix/get_coordinate_ops_impl.hpp @@ -11,6 +11,23 @@ template <typename T, size_t Rows, size_t Cols, layout Layout, use Use> class matrix_process; +template <typename TResult, typename AccessorType> +void reduce_and_accumulate(sub_group sg, size_t sg_size, size_t global_idy, + AccessorType &global_acc, TResult *local_sums, + size_t count) { + for (size_t i = 0; i < count; i++) { + local_sums[i] = reduce_over_group(sg, local_sums[i], sycl::plus<>()); + + // Only the subgroup leader performs the global accumulation + if (global_idy % sg_size == 0) { + sycl::atomic_ref<TResult, sycl::memory_order::relaxed, + sycl::memory_scope::device> + aref(global_acc[i]); + aref.fetch_add(local_sums[i]); + } + } +} + template <typename T, typename TResult, size_t NUM_ROWS, size_t NUM_COLS, size_t SROWS, size_t SCOLS, use Use, layout Layout, size_t VF> void matrix_sum(big_matrix<T, NUM_ROWS / VF, NUM_COLS * VF> &M, @@ -32,7 +49,7 @@ void matrix_sum(big_matrix<T, NUM_ROWS / VF, NUM_COLS * VF> &M, {1, 1 * sg_size}), [=](nd_item<2> spmd_item) #ifdef SG_SZ - [[intel::reqd_sub_group_size(SG_SZ)]] + [[sycl::reqd_sub_group_size(SG_SZ)]] #endif { // The submatrix API has to be accessed by all the workitems in a @@ -83,29 +100,10 @@ void matrix_sum(big_matrix<T, NUM_ROWS / VF, NUM_COLS * VF> &M, }); } - for (int i = 0; i < NUM_ROWS; i++) { - sum_local_rows[i] = - reduce_over_group(sg, sum_local_rows[i], sycl::plus<>()); - // only Groups leader perform the global reduction - if (global_idy % sg_size == 0) { - sycl::atomic_ref<TResult, sycl::memory_order::relaxed, - sycl::memory_scope::device> - aref(v_rows[i]); - aref.fetch_add(sum_local_rows[i]); - } - } - - for (int i = 0; i < NUM_COLS; i++) { - sum_local_cols[i] = - reduce_over_group(sg, sum_local_cols[i], sycl::plus<>()); - // only Groups leader perform the global reduction - if (global_idy % sg_size == 0) { - sycl::atomic_ref<TResult, sycl::memory_order::relaxed, - sycl::memory_scope::device> - aref(v_cols[i]); - aref.fetch_add(sum_local_cols[i]); - } - } + reduce_and_accumulate(sg, sg_size, global_idy, v_rows, + sum_local_rows, NUM_ROWS); + reduce_and_accumulate(sg, sg_size, global_idy, v_cols, + sum_local_cols, NUM_COLS); }); // parallel for }).wait(); } @@ -124,11 +122,7 @@ void test_get_coord_op() { TResult sum_cols[Cols] = {0}; TResult sum_cols_ref[Cols] = {0}; - for (int i = 0; i < Rows; i++) { - for (int j = 0; j < Cols; j++) { - M[i][j] = i + j; - } - } + matrix_fill(Rows, Cols, (T *)M, [](int i, int j) { return T(i + j); }); matrix_vnni<T>(Rows, Cols, *M, *Mvnni, VF); big_matrix<T, Rows / VF, Cols * VF> MM((T *)&Mvnni); diff --git a/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_arg_dim.cpp b/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_arg_dim.cpp index 8d26fd5e5a432..bd30efe1b217c 100644 --- a/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_arg_dim.cpp +++ b/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_arg_dim.cpp @@ -14,7 +14,7 @@ // Waiting for the commit in IGC to be pulled into the driver to resolve the // test. -// XFAIL: !igc-dev || gpu-intel-dg2 +// XFAIL: (!igc-dev || gpu-intel-dg2) && run-mode // XFAIL-TRACKER: GSD-10510 #include "common.hpp" diff --git a/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_runtime_dim.cpp b/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_runtime_dim.cpp index 4e790109eaff2..ff30d4c40f6a7 100644 --- a/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_runtime_dim.cpp +++ b/sycl/test-e2e/Matrix/joint_matrix_bf16_fill_k_cache_runtime_dim.cpp @@ -14,7 +14,7 @@ // Waiting for the commit in IGC to be pulled into the driver to resolve the // test. -// XFAIL: !igc-dev || gpu-intel-dg2 +// XFAIL: (!igc-dev || gpu-intel-dg2) && run-mode // XFAIL-TRACKER: GSD-10510 #include "common.hpp" diff --git a/sycl/test-e2e/NewOffloadDriver/aot-cpu.cpp b/sycl/test-e2e/NewOffloadDriver/aot-cpu.cpp index 585b368641d6e..0016e8498bd9d 100644 --- a/sycl/test-e2e/NewOffloadDriver/aot-cpu.cpp +++ b/sycl/test-e2e/NewOffloadDriver/aot-cpu.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // Test with `--offload-new-driver` // RUN: %clangxx -fsycl -fsycl-device-code-split=per_source -fsycl-targets=spir64_x86_64 -I %S/Inputs -o %t.out %S/split-per-source-main.cpp %S/Inputs/split-per-source-second-file.cpp \ diff --git a/sycl/test-e2e/NewOffloadDriver/cpu.cpp b/sycl/test-e2e/NewOffloadDriver/cpu.cpp index ef93d69f8693b..943ea71c3386e 100644 --- a/sycl/test-e2e/NewOffloadDriver/cpu.cpp +++ b/sycl/test-e2e/NewOffloadDriver/cpu.cpp @@ -7,6 +7,7 @@ //===---------------------------------------------------------------------===// // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // Test with `--offload-new-driver` // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 --offload-new-driver %S/Inputs/aot.cpp -o %t.out diff --git a/sycl/test-e2e/NonUniformGroups/ballot_group.cpp b/sycl/test-e2e/NonUniformGroups/ballot_group.cpp index f24bffb81526a..1532c54879ecc 100644 --- a/sycl/test-e2e/NonUniformGroups/ballot_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/ballot_group.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // UNSUPPORTED: hip diff --git a/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp index 8f6b6a8f17197..14e976edc8492 100644 --- a/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/ballot_group_algorithms.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_ballot_group diff --git a/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp b/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp index 939be57799dd4..5d2b98b58ddc2 100644 --- a/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/fixed_size_group.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // UNSUPPORTED: hip // REQUIRES: sg-32 diff --git a/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp index c1c172c4189c3..dfed10e9f587e 100644 --- a/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/fixed_size_group_algorithms.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fsycl-device-code-split=per_kernel -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_fixed_size_group diff --git a/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp b/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp index 18d42487b7768..2069113c3f939 100644 --- a/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/opportunistic_group.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // UNSUPPORTED: hip diff --git a/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp index af4d45cee862f..8e7626650e01c 100644 --- a/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/opportunistic_group_algorithms.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_opportunistic_group diff --git a/sycl/test-e2e/NonUniformGroups/tangle_group.cpp b/sycl/test-e2e/NonUniformGroups/tangle_group.cpp index 44191955048f3..686d1b34c6185 100644 --- a/sycl/test-e2e/NonUniformGroups/tangle_group.cpp +++ b/sycl/test-e2e/NonUniformGroups/tangle_group.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fno-sycl-early-optimizations -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // UNSUPPORTED: cuda || hip diff --git a/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp b/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp index 7033c4c9e4df5..51070ed1731e4 100644 --- a/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp +++ b/sycl/test-e2e/NonUniformGroups/tangle_group_algorithms.cpp @@ -4,6 +4,7 @@ // RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fno-sycl-early-optimizations -o %t.x86.out %s %} // RUN: %if cpu %{ %{run} %t.x86.out %} // +// REQUIRES: build-and-run-mode // REQUIRES: cpu || gpu // REQUIRES: sg-32 // REQUIRES: aspect-ext_oneapi_tangle_group diff --git a/sycl/test-e2e/OneapiDeviceSelector/illegal_input.cpp b/sycl/test-e2e/OneapiDeviceSelector/illegal_input.cpp index 79675bbac23cf..35430c7b12ff6 100644 --- a/sycl/test-e2e/OneapiDeviceSelector/illegal_input.cpp +++ b/sycl/test-e2e/OneapiDeviceSelector/illegal_input.cpp @@ -1,15 +1,15 @@ // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %S/Inputs/trivial.cpp -o %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="macaroni:*" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR=":" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="level_zero:." %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="macaroni_level_zero:." %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="level_zero:macaroni_gpu" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="level_zero:0..0" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="level_zero:" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="level_zero:::gpu" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="level_zero:.1" %{run-unfiltered-devices} %t.out -// RUN: not env ONEAPI_DEVICE_SELECTOR="" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="macaroni:*" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR=":" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:." %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="macaroni_level_zero:." %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:macaroni_gpu" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:0..0" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:::gpu" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:.1" %{run-unfiltered-devices} %t.out +// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="" %{run-unfiltered-devices} %t.out // Calling ONEAPI_DEVICE_SELECTOR with an illegal input should result in an // error. diff --git a/sycl/test-e2e/OnlineCompiler/online_compiler_L0.cpp b/sycl/test-e2e/OnlineCompiler/online_compiler_L0.cpp index 64a902bcbb1a4..4de91a66941aa 100644 --- a/sycl/test-e2e/OnlineCompiler/online_compiler_L0.cpp +++ b/sycl/test-e2e/OnlineCompiler/online_compiler_L0.cpp @@ -1,5 +1,6 @@ // REQUIRES: level_zero, level_zero_dev_kit, cm-compiler - +// XFAIL: gpu +// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16406 // RUN: %{build} -Wno-error=deprecated-declarations -DRUN_KERNELS %level_zero_options -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/OnlineCompiler/online_compiler_OpenCL.cpp b/sycl/test-e2e/OnlineCompiler/online_compiler_OpenCL.cpp index 161eb65478653..aa56fcfe93d70 100644 --- a/sycl/test-e2e/OnlineCompiler/online_compiler_OpenCL.cpp +++ b/sycl/test-e2e/OnlineCompiler/online_compiler_OpenCL.cpp @@ -1,5 +1,6 @@ // REQUIRES: opencl, opencl_icd, cm-compiler - +// XFAIL: gpu || cpu +// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16406 // RUN: %{build} -Wno-error=deprecated-declarations -DRUN_KERNELS %opencl_lib -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-1.cpp b/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-1.cpp index 988f014c2d8b4..1f61e1b4bec0f 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-1.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-1.cpp @@ -17,7 +17,7 @@ // UNSUPPORTED: cuda, hip // UNSUPPORTED-REASON: FP64 emulation is an Intel specific feature. -// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10,intel_gpu_dg2_g11,intel_gpu_dg2_g12,intel_gpu_pvc,intel_gpu_mtl_h,intel_gpu_mtl_u -fsycl-fp64-conv-emu -O0 %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10,intel_gpu_dg2_g11,intel_gpu_dg2_g12,intel_gpu_pvc,intel_gpu_mtl_h,intel_gpu_mtl_u -fsycl-fp64-conv-emu %O0 %s -o %t.out // RUN: %{run} %t.out // Tests that aspect::fp64 is not emitted correctly when -fsycl-fp64-conv-emu diff --git a/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-2.cpp b/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-2.cpp index 4dccf2f0f5a1b..eeb69159dd006 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-2.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/fp64-conv-emu-2.cpp @@ -20,7 +20,7 @@ // UNSUPPORTED: cuda, hip // UNSUPPORTED-REASON: FP64 emulation is an Intel specific feature. -// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10,intel_gpu_dg2_g11,intel_gpu_dg2_g12,intel_gpu_pvc,intel_gpu_mtl_h,intel_gpu_mtl_u -fsycl-fp64-conv-emu -O0 %s -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10,intel_gpu_dg2_g11,intel_gpu_dg2_g12,intel_gpu_pvc,intel_gpu_mtl_h,intel_gpu_mtl_u -fsycl-fp64-conv-emu %O0 %s -o %t.out // RUN: %{run} %t.out #include <sycl/detail/core.hpp> diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp index 465a79056906a..fcf6affb809fb 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp @@ -1,4 +1,5 @@ // REQUIRES: cuda, opencl, gpu, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64 %S/Inputs/is_compatible_with_env.cpp -o %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_fpga.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_fpga.cpp index 57366482e7082..1372c352c09ea 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_fpga.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_fpga.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, accelerator, gpu, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga %S/Inputs/is_compatible_with_env.cpp -o %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp index 5adb27e0ae697..c6a01b3a6dc18 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp @@ -1,4 +1,5 @@ // REQUIRES: ocloc, gpu, level_zero, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp index 0a6f2c39df8af..5de21b8984d71 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu, gpu, level_zero +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out diff --git a/sycl/test-e2e/ProgramManager/multi_device_bundle/device_libs_and_caching.cpp b/sycl/test-e2e/ProgramManager/multi_device_bundle/device_libs_and_caching.cpp index d596518165762..1534b2330f552 100644 --- a/sycl/test-e2e/ProgramManager/multi_device_bundle/device_libs_and_caching.cpp +++ b/sycl/test-e2e/ProgramManager/multi_device_bundle/device_libs_and_caching.cpp @@ -1,4 +1,5 @@ // REQUIRES: ocloc && gpu && linux && (opencl || level_zero) +// REQUIRES: build-and-run-mode // Test to check several use cases for multi-device kernel bundles. // Test covers AOT and JIT cases. Kernel is using some math functions to enforce diff --git a/sycl/test-e2e/README.md b/sycl/test-e2e/README.md index 1df9e685968f9..09e763a29e792 100644 --- a/sycl/test-e2e/README.md +++ b/sycl/test-e2e/README.md @@ -242,7 +242,6 @@ place. No new tests should use these features: * **gpu-intel-gen11** - Intel GPU Gen11 availability; * **gpu-intel-gen12** - Intel GPU Gen12 availability; - * **gpu-intel-dg1** - Intel GPU DG1 availability; * **gpu-intel-dg2** - Intel GPU DG2 availability; * **gpu-intel-pvc** - Intel GPU PVC availability; * **gpu-intel-pvc-vg** - Intel GPU PVC-VG availability; @@ -268,12 +267,6 @@ configure specific single test execution in the command line: * **gpu_aot_target_opts** - defines additional options which are passed to AOT compilation command line for GPU device. It can be also set by CMake variable GPU_AOT_TARGET_OPTS. If not specified "-device *" value is used. - * **gpu-intel-dg1** - tells LIT infra that Intel GPU DG1 is present in the - system. It is developer / CI infra responsibility to make sure that the - device is available in the system. Tests requiring DG1 to run must use proper - device selector to ensure that. Use SYCL_DEVICE_ALLOWLIST or - ONEAPI_DEVICE_SELECTOR to get proper configuration (see - [EnvironmentVariables.md](https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md)); * **gpu-intel-dg2** - tells LIT infra that Intel GPU DG2 is present in the system. It is developer / CI infra responsibility to make sure that the device is available in the system. @@ -379,3 +372,112 @@ Note: please avoid using `REQUIRES: TEMPORARY_DISABLED` for this purpose, it's a non-standard mechanism. Use `UNSUPPORTED: true` instead, we track `UNSUPPORTED` tests using the mechanism described above. Otherwise the test risks remaining untraceable. + +## Compiling and executing tests on separate systems + +The execution of e2e tests can be separated into compilation and execution +stages via the `test-mode` lit parameter. This allows us to reduce testing time +by compiling tests on more powerful systems and reusing the binaries on other +machines. By default the `test-mode` parameter is set to `full`, indicating +that both stages will run. This parameter can be set to `build-only`, or +`run-only`, to only run the compilation stage, or the execution stage +respectively. + +**NOTE:** This feature is a work-in-progress and current limitations are expected +to be addressed in the near future. + +The modes work as follow: +### `--param test-mode=full` +This is the default mode tests run in. Tests are marked as unsupported if no +device on the machine can fulfill the `REQUIRES`/`UNSUPPORTED` statements. In +this mode all `RUN:` lines are executed normally, and two extra features are +added: the `build-and-run-mode` and `run-mode`. + +To make a test only run in `full` mode add a `REQUIRES: build-and-run-mode` line. + +### `--param test-mode=build-only` +This mode can be used to compile all test binaries. To do this all `UNSUPPORTED` +and `REQUIRES` statements are ignored unless they contain `UNSUPPORTED: true` or +`REQUIRES: build-and-run-mode`. All `RUN:` lines within a test are ran in this +mode unless they contain the following expansions: `%{run}`, +`%{run-unfiltered-devices}`, or `%if run-mode`. + +Currently, the only triple supported for `build-only` mode is `spir64`. + +#### `build-only` future work +Note, the fact that `build-only` ignores general `UNSUPPORTED`/`REQUIRES` +statements is a current limitation. The logic for taking into account the +features that affect compilation, and ignoring those that are only relevant to +the execution of the program is currently being worked on. + +### `--param test-mode=run-only` +In this mode, tests will not be compiled, they will only run. To do this only the +`RUN:` lines that contain `%{run}`, `%{run-unfiltered-devices}` or `%if run-mode` +are executed. Tests are marked as unsupported in the same manner as `full` mode. +Since tests are not compiled in this mode, for any test to pass the test +binaries should already be in the `test_exec_root` directory, either by having +ran `full` or `build-only` modes previously on the system, or having +transferred the test binaries into that directory. The `run-mode` feature is +added when in this mode. + +### Resolving common Issues with separate compilation and execution: +A number of extra considerations need to be taken to write tests that are able +to be compiled and executed on separate machines. + +- Tests that build and execute multiple binaries need to be written such that +the output of each compilation has a different name. This way no files are +overwritten, and all the necessary binaries can be transferred to the running +system. + +- Two scenarios need to be considered for tests that expectedly fail: + - Tests that are expected to fail on compilation, and thus also during + execution, need to be marked as `XFAIL` with a feature that is device + agnostic, or with `XFAIL: *`. Device agnostic features are those which are + added added through a method other than processing the output of sycl-ls, for + example the OS, or the presence of a library. This needs to be done because + sycl-ls is not ran in `build-only` mode. + - If the expected failure occurs during run-time we will need to mark the test + with `XFAIL` on a device specific feature (A feature that we add through + processing sycl-ls output), or if its expected to always fail on run-time we + can use `XFAIL: run-mode`. This is because otherwise the test would compile + and pass on `build-only` mode and be reported as an `XPASS`. + +- To separate compilation and execution of tests, we classify `RUN:` directives +as being either build or run lines. If a line contains `%{run}`, +`%{run-unfiltered-devices}` or `%if run-mode` it is classified as a run line, +otherwise it is classified as a build line. + - All `RUN:` lines that execute test binaries should be marked with either + `%{run}` or `%{run-unfiltered-devices}`. Otherwise they will be incorrectly + marked as a build line, likely causing a failure at the `build-only` stage as + we try to execute the program without having the appropriate devices. + - The vast majority of `RUN:` lines that do not execute the test binaries are + needed to either set up files prior to compilation, or to compile the binary, + as such `RUN:` lines are by default considered as build lines. In the case + that we need to run a line on the `run-only` system, and it does not make + sense to mark them with `%{run}` or `%{run-unfiltered-devices}`, we can mark + a line with `%if run-mode` to specifically make the line a run line. This + situation usually appears when we need to run a command in response to the + execution of the test binary. + +- Currently the `build-only` mode does not support logic to properly assess the +features in `REQUIRES`/`UNSUPPORTED` to know if a test can be built in the +system environment, or for `spir64`. Only tests that are marked with +`REQUIRES: build-and-run-mode` or `UNSUPPORTED: true` are skipped. Thus if a +test will fail building for the build environment we have on CI or for `spir64` +we will need to mark this as `REQUIRES: build-and-run-mode`. This is only +temporary solution, until further work is done to properly mark tests as +unsupported on `build-only` based on features. + +- CPU and FPGA AOT tests are currently expected to fail when compiling and +executing on separate machines. These failures occur on the `run-only` side, +because during compilation the host machine's CPU architecture is targeted, +which may be different than that of the running machine. These tests are marked +as `REQUIRES: build-and-run-mode` as a result, until they can be refactored to +compile for the architectures that will be used on the run side. + +### Falling back to `full` testing mode on `run-only` +To not lose coverage of tests marked as `REQUIRES: build-and-run-mode` when +using `run-only` mode, lit can be called using +`--param fallback-to-build-if-requires-build-and-run=True`. When this option is +enabled in `run-only` mode, tests marked as requiring `build-and-run-mode` will +fallback to running on `full` mode, instead of being reported as unsupported. diff --git a/sycl/test-e2e/SpecConstants/2020/native_specialization_constant.cpp b/sycl/test-e2e/SpecConstants/2020/native_specialization_constant.cpp index 170e0aad6b33f..c15c4ba892ed7 100644 --- a/sycl/test-e2e/SpecConstants/2020/native_specialization_constant.cpp +++ b/sycl/test-e2e/SpecConstants/2020/native_specialization_constant.cpp @@ -4,6 +4,7 @@ // FIXME: This set is never satisfied all at once in our infrastructure. // REQUIRES: opencl, level-zero, cpu, gpu, opencl-aot, ocloc +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -DJIT %s -o %t.out // RUN: %{run} %t.out diff --git a/sycl/test-e2e/SpecConstants/2020/non_native/SpecConstBuffer.cpp b/sycl/test-e2e/SpecConstants/2020/non_native/SpecConstBuffer.cpp index 3ee1d4bd2490b..bc7145049ddcb 100644 --- a/sycl/test-e2e/SpecConstants/2020/non_native/SpecConstBuffer.cpp +++ b/sycl/test-e2e/SpecConstants/2020/non_native/SpecConstBuffer.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/common.cpp -o %t.out \ // RUN: -fsycl-dead-args-optimization diff --git a/sycl/test-e2e/SpecConstants/2020/non_native/cpu.cpp b/sycl/test-e2e/SpecConstants/2020/non_native/cpu.cpp index 8453a6556ffec..f6b7b836e873c 100644 --- a/sycl/test-e2e/SpecConstants/2020/non_native/cpu.cpp +++ b/sycl/test-e2e/SpecConstants/2020/non_native/cpu.cpp @@ -1,4 +1,5 @@ // REQUIRES: opencl-aot, cpu +// REQUIRES: build-and-run-mode // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/common.cpp -o %t.out \ // RUN: -fsycl-dead-args-optimization diff --git a/sycl/test-e2e/Tracing/usm/queue_copy_released_pointer.cpp b/sycl/test-e2e/Tracing/usm/queue_copy_released_pointer.cpp index 9585a9dc485ed..a37e5b8f4238c 100644 --- a/sycl/test-e2e/Tracing/usm/queue_copy_released_pointer.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_copy_released_pointer.cpp @@ -1,6 +1,6 @@ // UNSUPPORTED: windows || hip_amd // RUN: %{build} -o %t.out -// RUN: not env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s +// RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM function diff --git a/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp b/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp index 6d19f88dd5487..4c4299dd93d8e 100644 --- a/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp @@ -1,6 +1,6 @@ // UNSUPPORTED: windows || hip_amd // RUN: %{build} -o %t.out -// RUN: not env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s +// RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM usage diff --git a/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp b/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp index f87717c8efc28..61e27b7927f7b 100644 --- a/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp @@ -1,6 +1,6 @@ // UNSUPPORTED: windows || hip_amd // RUN: %{build} -o %t.out -// RUN: not env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s +// RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM usage diff --git a/sycl/test-e2e/format.py b/sycl/test-e2e/format.py index 74573007a681e..a69810145507d 100644 --- a/sycl/test-e2e/format.py +++ b/sycl/test-e2e/format.py @@ -248,7 +248,7 @@ def get_extra_env(sycl_devices): (is_run_line and test.config.test_mode == "build-only") or (not is_run_line and test.config.test_mode == "run-only") ): - directive.command = "" + continue if "%{run}" not in directive.command: new_script.append(directive) @@ -300,7 +300,13 @@ def get_extra_env(sycl_devices): conditions, recursion_limit=test.config.recursiveExpansionLimit, ) - useExternalSh = False + + # TODO: workaround for lit hanging when executing non-existent binary + # inside our containers + if len(script) == 0: + return lit.Test.Result(lit.Test.UNSUPPORTED, "Lit script is empty") + useExternalSh = test.config.test_mode == "run-only" + result = lit.TestRunner._runShTest( test, litConfig, useExternalSh, script, tmpBase ) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 9e1d2d903c058..a1da5ff46b5ff 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -168,8 +168,6 @@ config.available_features.add("gpu-intel-gen12") # Intel GPU DEVICE availability -if lit_config.params.get("gpu-intel-dg1", False): - config.available_features.add("gpu-intel-dg1") if lit_config.params.get("gpu-intel-dg2", False): config.available_features.add("gpu-intel-dg2") if lit_config.params.get("gpu-intel-pvc-vg", False): diff --git a/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp b/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp index a9c37c00b562c..ba72facd2b45a 100644 --- a/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp +++ b/sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp @@ -449,6 +449,9 @@ TEST_P(PersistentDeviceCodeCache, CorruptedCacheFiles) { << "Item with corrupted binary file was read"; ASSERT_NO_ERROR(llvm::sys::fs::remove_directories(ItemDir)); +// Death tests (ASSERT_DEATH) rely on assert which is not available in release +// mode. +#ifndef NDEBUG // Unexpected 2 binaries in a single file. detail::PersistentDeviceCodeCache::putItemToDisc({Dev}, {&Img}, {}, BuildOptions, NativeProg); @@ -465,6 +468,7 @@ TEST_P(PersistentDeviceCodeCache, CorruptedCacheFiles) { {Dev}, {&Img}, {}, BuildOptions), "NumBinaries == 1"); ASSERT_NO_ERROR(llvm::sys::fs::remove_directories(ItemDir)); +#endif } /* Checks that lock file affects cache operations as expected: