SWDEV-300274 - Path to OCL library not handled consistently

OpenCl applications are expected to work with publicly available
libopencl.so that is capable of finding vendor specific library
libamdocl64.so using the ICD loader entry.
x86_64-rocm-opencl.conf should provide ldconfig entry for
libamdocl64.so and libamdocl64.so shall use RUNPATH for finding
dependencies like hsa runtime.

Change-Id: Icf1267c7a04c1545eae0a7236bf8b7581ffa11ef


[ROCm/clr commit: 4790350f63]
This commit is contained in:
Freddy Paul
2021-08-26 09:04:56 -07:00
parent b6d8d42410
commit 799280db07
2 changed files with 8 additions and 11 deletions
@@ -2,16 +2,14 @@
set -e
do_ldconfig() {
if [ -e "/opt/rocm/opencl" ] ; then
echo /opt/rocm/opencl/lib > /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
fi
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
}
INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@
ROCM_LIBPATH=@ROCM_PATH@/lib
do_ldconfig() {
echo ${ROCM_LIBPATH} > /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
}
case "$1" in
abort-deconfigure|abort-remove|abort-upgrade)
echo "$1"
@@ -1,10 +1,9 @@
if [ -e "/opt/rocm/opencl" ] ; then
echo /opt/rocm/opencl/lib > /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
fi
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@
ROCM_LIBPATH=@ROCM_PATH@/lib
echo ${ROCM_LIBPATH} > /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
mkdir -p ${ROCM_LIBPATH}
ln -s -f -r ${INSTALL_PATH}/lib/libOpenCL.so ${ROCM_LIBPATH}/libOpenCL.so
ln -s -f -r ${INSTALL_PATH}/lib/libOpenCL.so.@OPENCL_LIB_VERSION_MAJOR@ ${ROCM_LIBPATH}/libOpenCL.so.@OPENCL_LIB_VERSION_MAJOR@