diff --git a/.github/actions/calc_vars/action.yml b/.github/actions/calc_vars/action.yml index f3cb4a79b..a6f6bf134 100644 --- a/.github/actions/calc_vars/action.yml +++ b/.github/actions/calc_vars/action.yml @@ -34,7 +34,7 @@ runs: CMAKE_TOOLCHAIN="--toolchain $TOOLCHAIN" elif [[ "${{inputs.target}}" = "host_riscv64_linux" ]]; then ARCH=riscv64 >> $GITHUB_OUTPUT - TOOLCHAIN=$GITHUB_WORKSPACE/platform/riscv64-linux/riscv64-toolchain.cmake + TOOLCHAIN=$GITHUB_WORKSPACE/platform/riscv64-linux/riscv64-gcc-toolchain.cmake CMAKE_TOOLCHAIN="--toolchain $TOOLCHAIN" else echo Unknown target ${{inputs.target}} diff --git a/.github/actions/do_build_icd/action.yml b/.github/actions/do_build_icd/action.yml index d779e5b8a..afdc79bb7 100644 --- a/.github/actions/do_build_icd/action.yml +++ b/.github/actions/do_build_icd/action.yml @@ -31,11 +31,13 @@ runs: - name: cmake headers shell: bash - run: - cmake headers -Bheaders/build_${{steps.calc_vars.outputs.arch}} - -DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }} - -DCMAKE_INSTALL_PREFIX=$PWD/headers_install_${{steps.calc_vars.outputs.arch}} + run: | + set -x + cmake headers -Bheaders/build_${{steps.calc_vars.outputs.arch}} \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }} \ + -DCMAKE_INSTALL_PREFIX=$PWD/headers_install_${{steps.calc_vars.outputs.arch}} \ -GNinja + - name: ninja install headers shell: bash run: @@ -56,13 +58,14 @@ runs: - name: icd cmake shell: bash - run: - cmake icd -B icd/build_${{steps.calc_vars.outputs.arch}} - -DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }} - -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install_icd_${{steps.calc_vars.outputs.arch}} - -DOpenCLHeaders_DIR=$GITHUB_WORKSPACE/headers_install_${{steps.calc_vars.outputs.arch}}/share/cmake/OpenCLHeaders - -GNinja + run: | + set -x + cmake icd -B icd/build_${{steps.calc_vars.outputs.arch}} \ + -DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }} \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \ + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install_icd_${{steps.calc_vars.outputs.arch}} \ + -DOpenCLHeaders_DIR=$GITHUB_WORKSPACE/headers_install_${{steps.calc_vars.outputs.arch}}/share/cmake/OpenCLHeaders \ + -GNinja - name: icd build shell: bash diff --git a/.github/actions/do_build_ock_artefact/action.yml b/.github/actions/do_build_ock_artefact/action.yml index 07e589022..ba8d0c5eb 100644 --- a/.github/actions/do_build_ock_artefact/action.yml +++ b/.github/actions/do_build_ock_artefact/action.yml @@ -9,6 +9,9 @@ inputs: default: '19' target: description: 'target architecture' + vulkan_sdk_install: + description: 'vulkan install flag' + default: true # TODO: This has not been tested yet on windows so would likely need some updating. runs: @@ -33,6 +36,7 @@ runs: llvm_version: ${{ inputs.llvm_version }} llvm_build_type: RelAssert cross_arch: ${{ steps.calc_vars.outputs.arch == 'x86_64' && 'none' || steps.calc_vars.outputs.arch }} + vulkan_sdk_install: ${{ inputs.vulkan_sdk_install }} os: ${{ contains(inputs.target, 'windows') && 'windows' || 'ubuntu' }} - name: build ock x86 diff --git a/.github/actions/do_build_opencl_cts/action.yml b/.github/actions/do_build_opencl_cts/action.yml index bae51173d..a5d92bda2 100644 --- a/.github/actions/do_build_opencl_cts/action.yml +++ b/.github/actions/do_build_opencl_cts/action.yml @@ -35,13 +35,27 @@ runs: repository: KhronosGroup/OpenCL-CTS path: OpenCL-CTS - - name: build opencl cts + - name: aarch64 set-up # TODO: update if/when qemu no longer used + if: steps.calc_vars.outputs.arch == 'aarch64' shell: bash + run: | + set -x + sudo sed -i -e '/^deb /{h;s|deb |&[arch=amd64,i386] |p;g;s|deb http://[^ ]*|deb [arch=arm64,riscv64] http://ports.ubuntu.com/ubuntu-ports|p;d}' /etc/apt/sources.list + sudo dpkg --add-architecture arm64 + sudo apt-get install --yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + sudo apt-get update + if [[ "${{inputs.target}}" =~ .*aarch64.* ]] ; then + # TODO: Only needed for run - could be moved to corresponding run action + echo QEMU INSTALL MATCH FOR ${{inputs.target}} + sudo apt-get install --yes qemu-user + fi + + - name: build opencl cts + shell: bash env: - # TODO: host-x86_64-linux 'toolchain' - expand for other targets - CMAKE_TOOLCHAIN: "-DCMAKE_C_COMPILER=gcc -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_COMPILER=g++ \ - -DCMAKE_CXX_FLAGS=-m64 -DPKG_CONFIG_EXECUTABLE=pkg-config" + CMAKE_TOOLCHAIN: "${{ steps.calc_vars.outputs.cmake_toolchain }}" run: | + echo CMAKE_TOOLCHAIN is: $CMAKE_TOOLCHAIN # get spirv-as sudo apt-get update sudo apt-get install -y spirv-tools diff --git a/.github/actions/run_opencl_cts/action.yml b/.github/actions/run_opencl_cts/action.yml index 975a67586..50210bf47 100644 --- a/.github/actions/run_opencl_cts/action.yml +++ b/.github/actions/run_opencl_cts/action.yml @@ -23,19 +23,27 @@ runs: shell: bash env: CTS_CSV_FILE: opencl_conformance_tests_${{inputs.test_type}}.csv - # TODO: host-x86_64-linux filter - expand for other targets + # TODO: expand filter for other targets CTS_FILTER: cts-3.0-online-ignore-linux-host.csv CTS_TIMEOUT: 18:00:00 # OK for github? run: | cd "$GITHUB_WORKSPACE/OpenCL-CTS" echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER" + export QEMU_SETTING="" + if [[ "${{inputs.target}}" =~ .*aarch64.* ]] ; then + echo QEMU SETTINGS MATCH FOR ${{inputs.target}} + QEMU_SETTING="-p qemu --qemu '/usr/bin/qemu-aarch64 -L /usr/aarch64-linux-gnu'" + fi set -x - python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \ - --color=always --timeout $CTS_TIMEOUT \ - -b "$GITHUB_WORKSPACE/test_conformance" \ - -L "$GITHUB_WORKSPACE/install_icd/lib" \ - -e "CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc" \ - -e "OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so" \ - -e "CL_PLATFORM_INDEX=0" \ - -s "$GITHUB_WORKSPACE/test_conformance/$CTS_CSV_FILE" \ - -i "$GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER" + # Note: use 'eval' built-in to handle quoting/escaping/splitting reqs + RUN_CITIES="python -u $GITHUB_WORKSPACE/scripts/testing/run_cities.py -v \ + --color=always --timeout $CTS_TIMEOUT \ + $QEMU_SETTING \ + -b $GITHUB_WORKSPACE/test_conformance \ + -L $GITHUB_WORKSPACE/install_icd/lib \ + -e CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc \ + -e OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so \ + -e CL_PLATFORM_INDEX=0 \ + -s $GITHUB_WORKSPACE/test_conformance/$CTS_CSV_FILE \ + -i $GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER" + eval $RUN_CITIES diff --git a/.github/actions/setup_build/action.yml b/.github/actions/setup_build/action.yml index 67975ab49..b9ea22a60 100644 --- a/.github/actions/setup_build/action.yml +++ b/.github/actions/setup_build/action.yml @@ -27,6 +27,9 @@ inputs: description: 'Enable installing of clang-tidy (currently 19)' type: boolean default: false + vulkan_sdk_install: + description: 'vulkan install flag' + default: true runs: # We don't want a new docker just a list of steps, so mark as composite @@ -60,7 +63,9 @@ runs: # required for gtest-terse-runner running in docker sudo apt-get install --yes python3-colorama sudo apt-get install --yes doxygen - sudo apt-get install --yes vulkan-sdk + if [ "${{ inputs.vulkan_sdk_install }}" = "true" ]; then \ + sudo apt-get install --yes vulkan-sdk + fi # TODO: Only required if we are running something that requires qemu, not required for building if [ "${{ inputs.cross_arch }}" != "none" ] && [ "${{ inputs.cross_arch }}" != "x86" ]; then \ # Install QEMU for testing cross compilation. diff --git a/.github/workflows/planned_testing.yml b/.github/workflows/planned_testing.yml index bc1c39a53..792f364ef 100644 --- a/.github/workflows/planned_testing.yml +++ b/.github/workflows/planned_testing.yml @@ -50,7 +50,6 @@ jobs: echo matrix_only_linux_x86_64="[ {\"target\": \"host_aarch64_linux\"}, {\"target\": \"host_riscv64_linux\"}, {\"target\": \"host_arm_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - create_ock_artefacts_windows: needs: [workflow_vars] # Currently there is only one windows target so we don't bother with the @@ -74,6 +73,7 @@ jobs: create_ock_artefacts_ubuntu: needs: [workflow_vars] strategy: + fail-fast: false # let all matrix jobs complete matrix: target: ${{ fromJson(inputs.target_list) }} exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }} @@ -94,11 +94,13 @@ jobs: with: target: ${{ matrix.target }} llvm_version: ${{ inputs.llvm_version }} + vulkan_sdk_install: false build_icd: if: inputs.test_tornado || inputs.test_opencl_cts || inputs.test_sycl_cts needs: [workflow_vars] strategy: + fail-fast: false # let all matrix jobs complete matrix: target: ${{ fromJson(inputs.target_list) }} exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }} @@ -145,14 +147,14 @@ jobs: with: target: ${{ matrix.target }} - # Currently only builds and runs (default: quick) on x86_64 linux build_run_opencl_cts: if: inputs.test_opencl_cts needs: [ workflow_vars, build_icd, create_ock_artefacts_ubuntu ] strategy: + fail-fast: false # let all matrix jobs complete matrix: target: ${{ fromJson(inputs.target_list) }} - exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }} + exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }} # TODO: host-x86_64-linux only - expand for other targets runs-on: cp-ubuntu-24.04 @@ -166,9 +168,11 @@ jobs: with: # scripts: for run_cities.py # source: for CTS filter.csv files + # platform: for toolchain files sparse-checkout: | scripts source + platform .github # TODO: Consider separating out opencl_cts build and run in the future - name : build and upload opencl_cts