Skip to content

Commit 3247a80

Browse files
Merge pull request #1084 from IntelPython/post-link-post-fix
Fixes to dpctl-post-link prior changes gh-1081
2 parents 79fbb79 + 0967621 commit 3247a80

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

conda-recipe/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ fi
3333

3434
# need to create this folder so ensure that .dpctl-post-link.sh can work correctly
3535
mkdir -p $PREFIX/etc/OpenCL/vendors
36+
echo "dpctl creates symbolic link to system installed /etc/OpenCL/vendors/intel.icd as a work-around." > $PREFIX/etc/OpenCL/vendors/.dpctl_readme
3637

3738
cp $RECIPE_DIR/dpctl-post-link.sh $PREFIX/bin/.dpctl-post-link.sh
39+
cp $RECIPE_DIR/dpctl-pre-unlink.sh $PREFIX/bin/.dpctl-pre-unlink.sh

conda-recipe/dpctl-post-link.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/bash
22

33
systemwide_icd=/etc/OpenCL/vendors/intel.icd
4-
local_vendors=$CONDA_PREFIX/etc/OpenCL/vendors/
4+
local_vendors=$PREFIX/etc/OpenCL/vendors/
5+
icd_fn=$local_vendors/intel-ocl-gpu.icd
56

6-
if [[ -f $systemwide_icd && -d $local_vendors && ! -f $local_vendors/intl-ocl-gpu.icd ]]; then
7-
ln -s $systemwide_icd $local_vendors/intel-ocl-gpu.icd
7+
if [[ -f $systemwide_icd && -d $local_vendors && ! -f $icd_fn ]]; then
8+
ln -s $systemwide_icd $icd_fn
89
fi

conda-recipe/dpctl-pre-unlink.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/bash
2+
3+
local_vendors=$PREFIX/etc/OpenCL/vendors/
4+
icd_fn=$local_vendors/intel-ocl-gpu.icd
5+
6+
if [[ -L $icd_fn ]]; then
7+
rm $icd_fn
8+
fi

0 commit comments

Comments
 (0)