From 7dc575a761ea7444b40d18f35665182e4889b6e5 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 22 Feb 2023 14:08:27 -0600 Subject: [PATCH] This PR modifies conda-recipe to add post-link to dpctl The post-link creates a symbolic link from $PREFIX/etc/OpenCL/vendors/intel-gpu.icd to /etc/OpenCL/vendors/intel.icd if one exists. This is a work-around to ensure that OpenCL GPU device from system installation can be found by OpenCL loader in intel-opencl-rt forthcoming package. --- conda-recipe/build.sh | 5 +++++ conda-recipe/dpctl-post-link.sh | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 conda-recipe/dpctl-post-link.sh diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index 4520fcd607..0d5eb6936c 100755 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -30,3 +30,8 @@ else # Perform regular install ${PYTHON} setup.py install ${SKBUILD_ARGS} fi + +# need to create this folder so ensure that .dpctl-post-link.sh can work correctly +mkdir -p $PREFIX/etc/OpenCL/vendors + +cp $RECIPE_DIR/dpctl-post-link.sh $PREFIX/bin/.dpctl-post-link.sh diff --git a/conda-recipe/dpctl-post-link.sh b/conda-recipe/dpctl-post-link.sh new file mode 100644 index 0000000000..30f26b31c5 --- /dev/null +++ b/conda-recipe/dpctl-post-link.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +systemwide_icd=/etc/OpenCL/vendors/intel.icd +local_vendors=$CONDA_PREFIX/etc/OpenCL/vendors/ + +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 +fi