Commit 6e64e25c authored by Matthieu Boileau's avatar Matthieu Boileau

Install OpenCL for AMD CPUs

parent 7b2863d6
- Download installation script on <http://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/> to `/data/software/sources/AMD-APP-SDK`
- Run `./install.sh` script as a `:software` user. Answer "yes", "yes" and for example `/data/software/install/AMD-APP-SDK/3.0.130.136` to the questions
#!/bin/bash
set -x
LIB_NAME="AMD-APP-SDK"
LIB_VERSION=3.0.130.136
SUB_DIR=${LIB_NAME}/${LIB_VERSION}
SRC_DIR=/data/software/sources/${LIB_NAME}
TARBALL="${LIB_NAME}Installer-v${LIB_VERSION}-GA-linux64.tar.bz2"
INSTALL_SCRIPT="${LIB_NAME}-v${LIB_VERSION}-GA-linux64.sh"
TARGET_DIR=/data/software/install/${SUB_DIR}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INSTALL_DIR=${TARGET_DIR}/AMDAPPSDK-3.0
MODULE_DIR=/data/software/modules/libs/${LIB_NAME}
MODULE_PATH=${MODULE_DIR}/${LIB_VERSION}
if [[ -d $SRC_DIR ]]; then
cd $SRC_DIR
if [[ ! -f $INSTALL_SCRIPT ]]; then
tar xvjf $TARBALL || exit 1
fi
./$INSTALL_SCRIPT --nox11 --target $TARGET_DIR
echo $INSTALL_DIR/lib/x86_64/sdk/libamdocl64.so | tee $INSTALL_DIR/etc/OpenCL/vendors/amd64.icd
else
echo "Source dir $SRC_DIR does not exist."
exit 1
fi
cd $SCRIPT_DIR
mkdir -p $MODULE_DIR
export INSTALL_DIR
envtpl --keep-template -o $MODULE_PATH module.tmpl
#%Module1.0################
##
## AMD APP SDK module
##
#
#
set amdappsdk {{ INSTALL_DIR }}
if [module-info mode load] {
setenv AMDAPPSDKROOT $amdappsdk
prepend-path LD_LIBRARY_PATH $amdappsdk/lib/x86_64/sdk
prepend-path LIBRARY_PATH $amdappsdk/lib/x86_64/sdk
prepend-path PATH $amdappsdk/bin/x86_64
setenv OPENCL_VENDOR_PATH $amdappsdk/etc/OpenCL/vendors
}
if [module-info mode remove] {
unsetenv AMDAPPSDKROOT $amdappsdk
remove-path LD_LIBRARY_PATH $amdappsdk/lib/x86_64/sdk
remove-path LIBRARY_PATH $amdappsdk/lib/x86_64/sdk
remove-path PATH $amdappsdk/bin/x86_64
unsetenv OPENCL_VENDOR_PATH $amdappsdk/etc/OpenCL/vendors
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment