Skip to content

Fixes to dpctl-post-link prior changes gh-1081 #1084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions conda-recipe/dpctl-post-link.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions conda-recipe/dpctl-pre-unlink.sh
Original file line number Diff line number Diff line change
@@ -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