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
This commit is contained in:
Freddy Paul
2021-08-26 09:04:56 -07:00
parent fdb61872c8
commit 4790350f63
2 changed files with 8 additions and 11 deletions
+5 -7
View File
@@ -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"
+3 -4
View File
@@ -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@