diff --git a/.github/workflows/ur-build-hw.yml b/.github/workflows/ur-build-hw.yml index f6af36cb5bf0f..7e1203c16feff 100644 --- a/.github/workflows/ur-build-hw.yml +++ b/.github/workflows/ur-build-hw.yml @@ -26,6 +26,14 @@ on: required: false type: string default: OFF + docker_image: + required: true + type: string + default: "" + image_options: + required: true + type: string + default: "" workflow_dispatch: inputs: adapter_name: @@ -51,9 +59,16 @@ on: required: false type: string default: OFF + docker_image: + required: true + type: string + default: "" + image_options: + required: true + type: string + default: "" -permissions: - contents: read +permissions: read-all env: UR_LOG_CUDA: "level:error;flush:error" @@ -83,6 +98,9 @@ jobs: compiler: [{c: gcc, cxx: g++}] runs-on: ${{inputs.runner_name}} + container: + image: ${{ inputs.docker_image }} + options: ${{ inputs.image_options }} steps: # TODO: @@ -94,9 +112,15 @@ jobs: - name: Checkout LLVM uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - # Latest distros do not allow global pip installation + # for some reason it's required to re-configure python for venv to work properly. + - name: Set up Python 3.12 + if: ${{ inputs.docker_image == 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps' }} + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: '3.12' + - name: Install UR python dependencies in venv - working-directory: ${{github.workspace}}/unified-runtime + working-directory: ./unified-runtime run: | python3 -m venv .venv . .venv/bin/activate @@ -106,16 +130,25 @@ jobs: - name: Download DPC++ run: | - wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz - mkdir dpcpp_compiler - tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler + wget -O dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz + mkdir -p dpcpp_compiler + tar -xvf dpcpp_compiler.tar.gz -C dpcpp_compiler + + - name: Install OpenCL + if: ${{ inputs.adapter_name == 'OPENCL' }} + run: | + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update + sudo apt-get install -y intel-oneapi-runtime-opencl - name: Configure Unified Runtime project - working-directory: ${{github.workspace}}/unified-runtime # ">" is used to avoid adding "\" at the end of each line; this command is quite long run: > cmake - -B${{github.workspace}}/build + -S unified-runtime + -B build -DCMAKE_C_COMPILER=${{matrix.compiler.c}} -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} @@ -127,32 +160,32 @@ jobs: ${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }} -DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}} -DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}} - -DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ - -DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib - -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install + -DUR_DPCXX=./dpcpp_compiler/bin/clang++ + -DUR_SYCL_LIBRARY_DIR=./dpcpp_compiler/lib + -DCMAKE_INSTALL_PREFIX=./install ${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }} ${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }} - name: Build # This is so that device binaries can find the sycl runtime library - run: cmake --build ${{github.workspace}}/build -j $(nproc) + run: cmake --build build -j $(nproc) - name: Install # This is to check that install command does not fail - run: cmake --install ${{github.workspace}}/build + run: cmake --install build - name: Test adapter specific env: ZE_ENABLE_LOADER_DEBUG_TRACE: 1 - run: ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV + run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV # Don't run adapter specific tests when building multiple adapters if: ${{ matrix.adapter.other_name == '' }} - name: Test adapters env: ZE_ENABLE_LOADER_DEBUG_TRACE: 1 - run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "conformance" --timeout 600 -VV + run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "conformance" --timeout 600 -VV - name: Get information about platform if: ${{ always() }} - run: ${{github.workspace}}/unified-runtime/.github/scripts/get_system_info.sh + run: ./unified-runtime/.github/scripts/get_system_info.sh diff --git a/.github/workflows/ur-precommit.yml b/.github/workflows/ur-precommit.yml index 09af48933f046..0d0824bbd334c 100644 --- a/.github/workflows/ur-precommit.yml +++ b/.github/workflows/ur-precommit.yml @@ -52,27 +52,54 @@ jobs: if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }} strategy: matrix: - # Extra native CPU jobs are here to force the loader to be used. - # UR will not use the loader if there is only one target. - adapter: [ - {name: L0, runner: UR_L0}, - {name: L0_V2, runner: UR_L0}, - {name: L0, runner: UR_L0, static: ON}, - {name: OPENCL, runner: UR_OPENCL, platform: "Intel(R) OpenCL"}, - {name: CUDA, runner: UR_CUDA}, - {name: HIP, runner: UR_HIP}, - {name: NATIVE_CPU, runner: UR_NATIVE_CPU}, - {name: OPENCL, runner: UR_OPENCL, other_adapter: NATIVE_CPU, platform: "OPENCL:Intel(R) OpenCL"}, - {name: L0, runner: UR_L0, other_adapter: NATIVE_CPU}, - ] + # Extra native CPU jobs are here to force the loader to be used. + # UR will not use the loader if there is only one target. + include: + - name: L0 + runner: UR_L0 + image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN + - name: L0_V2 + runner: UR_L0 + image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN + - name: L0 + runner: UR_L0 + static: ON + image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN + - name: L0 + runner: UR_L0 + other_adapter: NATIVE_CPU + image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN + - name: HIP + runner: UR_HIP + image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --cap-add=SYS_ADMIN + - name: CUDA + runner: UR_CUDA + image_options: -u 1001 --privileged --cap-add SYS_ADMIN --gpus all + - name: OPENCL + runner: UR_OPENCL + platform: "Intel(R) OpenCL" + docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest" + image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN + - name: OPENCL + runner: UR_OPENCL + platform: "OPENCL:Intel(R) OpenCL" + other_adapter: NATIVE_CPU + docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest" + image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN + - name: NATIVE_CPU + runner: UR_NATIVE_CPU + docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest" + image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN uses: ./.github/workflows/ur-build-hw.yml with: - adapter_name: ${{ matrix.adapter.name }} - runner_name: ${{ matrix.adapter.runner }} - static_loader: ${{ matrix.adapter.static || 'OFF' }} - static_adapter: ${{ matrix.adapter.static || 'OFF' }} - platform: ${{ matrix.adapter.platform || '' }} - other_adapter_name: ${{ matrix.adapter.other_adapter || '' }} + adapter_name: ${{ matrix.name }} + runner_name: ${{ matrix.runner }} + static_loader: ${{ matrix.static || 'OFF' }} + static_adapter: ${{ matrix.static || 'OFF' }} + platform: ${{ matrix.platform || '' }} + other_adapter_name: ${{ matrix.other_adapter || '' }} + docker_image: ${{ matrix.docker_image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'}} + image_options: ${{ matrix.image_options || '' }} macos: name: MacOS build only