diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index 0d5eb6936c..2432e0dda6 100755 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -33,5 +33,7 @@ fi # need to create this folder so ensure that .dpctl-post-link.sh can work correctly mkdir -p $PREFIX/etc/OpenCL/vendors +echo "dpctl creates symbolic link to system installed /etc/OpenCL/vendors/intel.icd as a work-around." > $PREFIX/etc/OpenCL/vendors/.dpctl_readme cp $RECIPE_DIR/dpctl-post-link.sh $PREFIX/bin/.dpctl-post-link.sh +cp $RECIPE_DIR/dpctl-pre-unlink.sh $PREFIX/bin/.dpctl-pre-unlink.sh diff --git a/conda-recipe/dpctl-post-link.sh b/conda-recipe/dpctl-post-link.sh index 30f26b31c5..45b1e6856f 100644 --- a/conda-recipe/dpctl-post-link.sh +++ b/conda-recipe/dpctl-post-link.sh @@ -1,8 +1,9 @@ #!/usr/bin/bash systemwide_icd=/etc/OpenCL/vendors/intel.icd -local_vendors=$CONDA_PREFIX/etc/OpenCL/vendors/ +local_vendors=$PREFIX/etc/OpenCL/vendors/ +icd_fn=$local_vendors/intel-ocl-gpu.icd -if [[ -f $systemwide_icd && -d $local_vendors && ! -f $local_vendors/intl-ocl-gpu.icd ]]; then - ln -s $systemwide_icd $local_vendors/intel-ocl-gpu.icd +if [[ -f $systemwide_icd && -d $local_vendors && ! -f $icd_fn ]]; then + ln -s $systemwide_icd $icd_fn fi diff --git a/conda-recipe/dpctl-pre-unlink.sh b/conda-recipe/dpctl-pre-unlink.sh new file mode 100644 index 0000000000..4d0207720f --- /dev/null +++ b/conda-recipe/dpctl-pre-unlink.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +local_vendors=$PREFIX/etc/OpenCL/vendors/ +icd_fn=$local_vendors/intel-ocl-gpu.icd + +if [[ -L $icd_fn ]]; then + rm $icd_fn +fi