Skip to content

Commit f0a09ac

Browse files
committed
[CI] Add flag to install igc dev driver
Ref: #11552
1 parent 9f4ee47 commit f0a09ac

File tree

1 file changed

+53
-6
lines changed

1 file changed

+53
-6
lines changed

devops/scripts/install_drivers.sh

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ if [ -f "$1" ]; then
88
CONFIG_FILE=$1
99
CR_TAG=$(jq -r '.linux.compute_runtime.github_tag' $CONFIG_FILE)
1010
IGC_TAG=$(jq -r '.linux.igc.github_tag' $CONFIG_FILE)
11+
IGC_DEV_TAG=$(jq -r '.linux.igc_dev.github_tag' $CONFIG_FILE)
12+
IGC_DEV_VER=$(jq -r '.linux.igc_dev.version' $CONFIG_FILE)
13+
IGC_DEV_URL=$(jq -r '.linux.igc_dev.url' $CONFIG_FILE)
1114
CM_TAG=$(jq -r '.linux.cm.github_tag' $CONFIG_FILE)
1215
L0_TAG=$(jq -r '.linux.level_zero.github_tag' $CONFIG_FILE)
1316
TBB_TAG=$(jq -r '.linux.tbb.github_tag' $CONFIG_FILE)
@@ -16,6 +19,9 @@ if [ -f "$1" ]; then
1619
else
1720
CR_TAG=$compute_runtime_tag
1821
IGC_TAG=$igc_tag
22+
IGC_DEV_TAG=$igc_dev_tag
23+
IGC_DEV_VER=$igc_dev_ver
24+
IGC_DEV_URL=$igc_dev_url
1925
CM_TAG=$cm_tag
2026
L0_TAG=$level_zero_tag
2127
TBB_TAG=$tbb_tag
@@ -39,6 +45,17 @@ function get_release() {
3945
| jq -r '. as $raw | try .assets[].browser_download_url catch error($raw)'
4046
}
4147

48+
function get_pre_release_igfx() {
49+
URL=$1
50+
HASH=$2
51+
HEADER=""
52+
if [ "$GITHUB_TOKEN" != "" ]; then
53+
HEADER="Authorization: Bearer $GITHUB_TOKEN"
54+
fi
55+
curl -s -L -H "$HEADER" $URL > $HASH.zip
56+
unzip $HASH.zip && rm $HASH.zip
57+
}
58+
4259
TBB_INSTALLED=false
4360

4461
if [[ -v INSTALL_LOCATION ]]; then
@@ -64,27 +81,49 @@ InstallTBB () {
6481
fi
6582
}
6683

84+
CheckIGCdevTag() {
85+
local prefix="igc-dev-"
86+
local arg="$1"
87+
88+
if [[ $arg == "$prefix"* ]]; then
89+
echo "Yes"
90+
else
91+
echo "No"
92+
fi
93+
}
94+
6795
InstallIGFX () {
6896
echo "Installing Intel Graphics driver..."
6997
echo "Compute Runtime version $CR_TAG"
70-
echo "IGC version $IGC_TAG"
7198
echo "CM compiler version $CM_TAG"
7299
echo "Level Zero version $L0_TAG"
73-
get_release intel/intel-graphics-compiler $IGC_TAG \
74-
| grep ".*deb" \
75-
| wget -qi -
100+
IS_IGC_DEV=$(CheckIGCdevTag $IGCTAG)
101+
IGNORE_CHECKSUM=false
102+
DPKG_OPTIONS=""
103+
if [ "$IS_IGC_DEV" == "Yes" ]; then
104+
echo "IGC dev git hash $IGC_DEV_VER"
105+
get_pre_release_igfx $IGC_DEV_URL $IGC_DEV_VER
106+
IGNORE_CHECKSUM=true
107+
DPKG_OPTIONS=" --force-depends-version"
108+
else
109+
echo "IGC version $IGC_TAG"
110+
get_release intel/intel-graphics-compiler $IGC_TAG \
111+
| grep ".*deb" \
112+
| wget -qi -
113+
fi
76114
get_release intel/compute-runtime $CR_TAG \
77115
| grep -E ".*((deb)|(sum))" \
78116
| wget -qi -
79-
sha256sum -c *.sum && \
117+
# Perform the checksum conditionally and then get the release
118+
( [ "$IGNORE_CHECKSUM" ] || sha256sum -c *.sum ) && \
80119
get_release intel/cm-compiler $CM_TAG \
81120
| grep ".*deb" \
82121
| grep -v "u18" \
83122
| wget -qi -
84123
get_release oneapi-src/level-zero $L0_TAG \
85124
| grep ".*deb" \
86125
| wget -qi -
87-
dpkg -i *.deb && rm *.deb *.sum
126+
dpkg -i $DPKG_OPTIONS *.deb && rm *.deb *.sum
88127
}
89128

90129
InstallCPURT () {
@@ -131,12 +170,20 @@ if [[ $# -eq 0 ]] ; then
131170
echo "No options were specified. Please, specify one or more of the following:"
132171
echo "--all - Install all Intel drivers"
133172
echo "--igfx - Install Intel Graphics drivers"
173+
echo "--use-dev-igc - Install development version of Intel Graphics drivers instead"
134174
echo "--cpu - Install Intel CPU OpenCL runtime"
135175
echo "--fpga-emu - Install Intel FPGA Fast emulator"
136176
echo "Set INSTALL_LOCATION env variable to specify install location"
137177
exit 0
138178
fi
139179

180+
if [[ "$*" == *"--use-dev-igc"* ]]
181+
then
182+
IGCTAG=${IGC_DEV_TAG}
183+
else
184+
IGCTAG=${IGC_TAG}
185+
fi
186+
140187
while [ "${1:-}" != "" ]; do
141188
case "$1" in
142189
"--all")

0 commit comments

Comments
 (0)