From 70059294369def4786485d0821147287ba25cd24 Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Wed, 3 Apr 2024 22:42:10 +0200 Subject: [PATCH 1/3] [CI] Add flag to install igc dev driver and build igc container Ref: #11552 --- .github/workflows/sycl-containers.yaml | 4 ++ .../ubuntu2204_intel_drivers.Dockerfile | 6 +- devops/dependencies.json | 8 +-- devops/scripts/install_drivers.sh | 59 +++++++++++++++++-- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sycl-containers.yaml b/.github/workflows/sycl-containers.yaml index 4ef5c5497e6c9..f2c86c649865b 100644 --- a/.github/workflows/sycl-containers.yaml +++ b/.github/workflows/sycl-containers.yaml @@ -45,6 +45,10 @@ jobs: file: ubuntu2204_intel_drivers tags: ubuntu2204_intel_drivers build_args: "use_latest=false" + - name: Intel Drivers Ubuntu 22.04 Docker image with dev IGC + file: ubuntu2204_intel_drivers + tags: ubuntu2204_intel_drivers_devigc + build_args: "use_latest=false use_igc_dev=true" - name: Intel Drivers (unstable) Ubuntu 22.04 Docker image file: ubuntu2204_intel_drivers tags: ubuntu2204_intel_drivers_unstable diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index fb018f195a48f..edde9e60781de 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -6,8 +6,9 @@ FROM $base_image:$base_tag ENV DEBIAN_FRONTEND=noninteractive ARG use_latest=true +ARG use_igc_dev=false -RUN apt update && apt install -yqq wget +RUN apt update && apt install -yqq wget libllvm14 COPY scripts/get_release.py / COPY scripts/install_drivers.sh / @@ -20,6 +21,9 @@ RUN --mount=type=secret,id=github_token \ install_driver_opt=" --use-latest"; \ else \ install_driver_opt=" dependencies.json"; \ + if [ "$use_igc_dev" = "true" ]; then \ + install_driver_opt="$install_driver_opt --use-dev-igc"; \ + fi; \ fi && \ GITHUB_TOKEN=$(cat /run/secrets/github_token) /install_drivers.sh $install_driver_opt --all diff --git a/devops/dependencies.json b/devops/dependencies.json index d6eff1aeb27bc..8ea97ff44bfb8 100644 --- a/devops/dependencies.json +++ b/devops/dependencies.json @@ -13,10 +13,10 @@ "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "igc_dev": { - "github_tag": "igc-dev-3d81e14", - "version": "3d81e14", - "updated_at": "2024-03-27T19:44:26Z", - "url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/1364385215/zip", + "github_tag": "igc-dev-3af2d9c", + "version": "3af2d9c", + "updated_at": "2024-04-04T12:27:26Z", + "url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/1383563495/zip", "root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu" }, "cm": { diff --git a/devops/scripts/install_drivers.sh b/devops/scripts/install_drivers.sh index 69d45a05553e8..f27fb2b6d3979 100755 --- a/devops/scripts/install_drivers.sh +++ b/devops/scripts/install_drivers.sh @@ -8,6 +8,9 @@ if [ -f "$1" ]; then CONFIG_FILE=$1 CR_TAG=$(jq -r '.linux.compute_runtime.github_tag' $CONFIG_FILE) IGC_TAG=$(jq -r '.linux.igc.github_tag' $CONFIG_FILE) + IGC_DEV_TAG=$(jq -r '.linux.igc_dev.github_tag' $CONFIG_FILE) + IGC_DEV_VER=$(jq -r '.linux.igc_dev.version' $CONFIG_FILE) + IGC_DEV_URL=$(jq -r '.linux.igc_dev.url' $CONFIG_FILE) CM_TAG=$(jq -r '.linux.cm.github_tag' $CONFIG_FILE) L0_TAG=$(jq -r '.linux.level_zero.github_tag' $CONFIG_FILE) TBB_TAG=$(jq -r '.linux.tbb.github_tag' $CONFIG_FILE) @@ -24,6 +27,9 @@ elif [[ "$*" == *"--use-latest"* ]]; then else CR_TAG=$compute_runtime_tag IGC_TAG=$igc_tag + IGC_DEV_TAG=$igc_dev_tag + IGC_DEV_VER=$igc_dev_ver + IGC_DEV_URL=$igc_dev_url CM_TAG=$cm_tag L0_TAG=$level_zero_tag TBB_TAG=$tbb_tag @@ -47,6 +53,17 @@ function get_release() { | jq -r '. as $raw | try .assets[].browser_download_url catch error($raw)' } +function get_pre_release_igfx() { + URL=$1 + HASH=$2 + HEADER="" + if [ "$GITHUB_TOKEN" != "" ]; then + HEADER="Authorization: Bearer $GITHUB_TOKEN" + fi + curl -L -H "$HEADER" -H "Accept: application/vnd.github.v3+json" $URL -o $HASH.zip + unzip $HASH.zip && rm $HASH.zip +} + TBB_INSTALLED=false if [[ -v INSTALL_LOCATION ]]; then @@ -72,19 +89,41 @@ InstallTBB () { fi } +CheckIGCdevTag() { + local prefix="igc-dev-" + local arg="$1" + + if [[ $arg == "$prefix"* ]]; then + echo "Yes" + else + echo "No" + fi +} + InstallIGFX () { echo "Installing Intel Graphics driver..." echo "Compute Runtime version $CR_TAG" - echo "IGC version $IGC_TAG" echo "CM compiler version $CM_TAG" echo "Level Zero version $L0_TAG" - get_release intel/intel-graphics-compiler $IGC_TAG \ - | grep ".*deb" \ - | wget -qi - + IS_IGC_DEV=$(CheckIGCdevTag $IGCTAG) + IGNORE_CHECKSUM=false + DPKG_OPTIONS="" + if [ "$IS_IGC_DEV" == "Yes" ]; then + echo "IGC dev git hash $IGC_DEV_VER" + get_pre_release_igfx $IGC_DEV_URL $IGC_DEV_VER + IGNORE_CHECKSUM=true + DPKG_OPTIONS=" --force-depends-version" + else + echo "IGC version $IGC_TAG" + get_release intel/intel-graphics-compiler $IGC_TAG \ + | grep ".*deb" \ + | wget -qi - + fi get_release intel/compute-runtime $CR_TAG \ | grep -E ".*((deb)|(sum))" \ | wget -qi - - sha256sum -c *.sum && \ + # Perform the checksum conditionally and then get the release + ( [ "$IGNORE_CHECKSUM" ] || sha256sum -c *.sum ) && \ get_release intel/cm-compiler $CM_TAG \ | grep ".*deb" \ | grep -v "u18" \ @@ -92,7 +131,7 @@ InstallIGFX () { get_release oneapi-src/level-zero $L0_TAG \ | grep ".*deb" \ | wget -qi - - dpkg -i *.deb && rm *.deb *.sum + dpkg -i $DPKG_OPTIONS *.deb && rm *.deb *.sum } InstallCPURT () { @@ -139,6 +178,7 @@ if [[ $# -eq 0 ]] ; then echo "No options were specified. Please, specify one or more of the following:" echo "--all - Install all Intel drivers" echo "--igfx - Install Intel Graphics drivers" + 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" @@ -146,6 +186,13 @@ if [[ $# -eq 0 ]] ; then exit 0 fi +if [[ "$*" == *"--use-dev-igc"* ]] +then + IGCTAG=${IGC_DEV_TAG} +else + IGCTAG=${IGC_TAG} +fi + while [ "${1:-}" != "" ]; do case "$1" in "--all") From ba6f4fa8394ff86cc16b4fd963571c064c47642b Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Fri, 5 Apr 2024 17:12:36 +0200 Subject: [PATCH 2/3] Fix args --- .github/workflows/sycl-containers.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sycl-containers.yaml b/.github/workflows/sycl-containers.yaml index f2c86c649865b..fb951f484a046 100644 --- a/.github/workflows/sycl-containers.yaml +++ b/.github/workflows/sycl-containers.yaml @@ -48,7 +48,9 @@ jobs: - name: Intel Drivers Ubuntu 22.04 Docker image with dev IGC file: ubuntu2204_intel_drivers tags: ubuntu2204_intel_drivers_devigc - build_args: "use_latest=false use_igc_dev=true" + build_args: | + "use_latest=false" + "use_igc_dev=true" - name: Intel Drivers (unstable) Ubuntu 22.04 Docker image file: ubuntu2204_intel_drivers tags: ubuntu2204_intel_drivers_unstable From 5dc98948433943f2bb8540401f16413e9228739d Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Fri, 5 Apr 2024 18:46:46 +0200 Subject: [PATCH 3/3] Install libllvm14 only for dev igc --- devops/containers/ubuntu2204_intel_drivers.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devops/containers/ubuntu2204_intel_drivers.Dockerfile b/devops/containers/ubuntu2204_intel_drivers.Dockerfile index edde9e60781de..4ef9009da4744 100644 --- a/devops/containers/ubuntu2204_intel_drivers.Dockerfile +++ b/devops/containers/ubuntu2204_intel_drivers.Dockerfile @@ -8,7 +8,8 @@ ENV DEBIAN_FRONTEND=noninteractive ARG use_latest=true ARG use_igc_dev=false -RUN apt update && apt install -yqq wget libllvm14 +RUN apt update && apt install -yqq wget \ + && if [ "$use_igc_dev" = "true" ]; then apt-get install -yqq libllvm14; fi COPY scripts/get_release.py / COPY scripts/install_drivers.sh /