From 65d77a3019015808b9ec5e9c05b74af69538b497 Mon Sep 17 00:00:00 2001 From: Oren <oren_segal@student.uml.edu> Date: Mon, 2 Mar 2015 11:10:11 -0500 Subject: [PATCH] added working WorkingWithMultiplePlatforms text and misc env + doc fixes --- docs/HowToRunAPARAPI.txt | 16 ++++++---- docs/WorkingWithMultiplePlatforms.txt | 46 +++++++++++++++++++++++++++ env/AlteraV14Env | 2 +- 3 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 docs/WorkingWithMultiplePlatforms.txt diff --git a/docs/HowToRunAPARAPI.txt b/docs/HowToRunAPARAPI.txt index 2df81a34..2506b0e2 100644 --- a/docs/HowToRunAPARAPI.txt +++ b/docs/HowToRunAPARAPI.txt @@ -25,28 +25,32 @@ How to run APARAPI tests from the cmd line Format is*: - sh [name].sh [JTP|GPU|SEQ] + sh [name].sh [ACC|CPU|JTP|GPU|SEQ] Examples: - run nbody simulation - cd /home/admin/projects/aparapi/src/aparapi/examples/nbody + cd [project folder]/src/aparapi/examples/nbody sh nbody.sh JTP + sh nbody.sh CPU sh nbody.sh GPU + sh nbody.sh ACC - run mandel - cd /home/admin/projects/aparapi/src/aparapi/samples/mandel/ + cd [project folder]/src/aparapi/samples/mandel/ sh mandel.sh JTP + sh mandel.sh CPU sh mandel.sh GPU + sh mandel.sh ACC * For more sophisticated use cases with dual configs(fpga/std) you can use the following format: - sh [name].std.sh [JTP|GPU|SEQ] - - sh [name].fpga.sh [JTP|GPU|SEQ] + sh [name].std.sh [ACC|CPU|JTP|GPU|SEQ] + sh [name].fpga.sh [ACC|CPU|JTP|GPU|SEQ] +You can read more about dual config in how to build aparapi. diff --git a/docs/WorkingWithMultiplePlatforms.txt b/docs/WorkingWithMultiplePlatforms.txt new file mode 100644 index 00000000..d55a415a --- /dev/null +++ b/docs/WorkingWithMultiplePlatforms.txt @@ -0,0 +1,46 @@ +Working with multiple platforms +------------------------------- + +The original version of Aparapi does not support platform selection (it just chooses the first available one). + +This means that in scenarios where you have multiple OpenCL platforms such as AMD, NVidia, Intel, Altera etc. you do not have control over what accelerator device will be used. + +One of the changes we made is to allow selection for platforms that support the OpenCL ICD model. +(https://www.khronos.org/news/permalink/opencl-installable-client-driver-icd-loader) + +In the spirit of other Aparapi configuration options for device selection this can be set using a configuration option. + +The platform configuration option is called: com.amd.aparapi.platformHint + +When this option is set it causes Aparapi to search for the string platformHint inside the available platform names and if it found it will select that platform over other available ones. + +You can use it on the command line in the following way: + +java -Dcom.amd.aparapi.platformHint=AMD .... + +or + +java -Dcom.amd.aparapi.platformHint=NVIDIA .... + + +Nbody simulation example with platform selection +--------------------------------------------------------------------- + +The script nbody.std.no-opengles-platform-select.sh contains the following java command line: + +java \ + -Djava.library.path=../../com.amd.aparapi.jni/dist.std:../third-party/jogamp \ + -Dcom.amd.aparapi.executionMode=$1 \ + -Dbodies=$2 \ + -Dcom.amd.aparapi.platformHint=$3 \ + -Dheight=600 \ + -Dwidth=600 \ + -Djogl.disable.opengles \ + -classpath ../third-party/jogamp/jogl-all.jar:../third-party/jogamp/gluegen-rt.jar:../../com.amd.aparapi/dist/aparapi.jar:nbody.jar \ + com.amd.aparapi.examples.nbody.Main + +To choose an AMD GPU for example we would invoke the script in the following way(the third parameter): + +nbody.std.no-opengles-platform-select.sh GPU 1024 AMD + + diff --git a/env/AlteraV14Env b/env/AlteraV14Env index a6362c7d..501d6a4d 100644 --- a/env/AlteraV14Env +++ b/env/AlteraV14Env @@ -4,5 +4,5 @@ export ALTERAOCLSDKROOT=/home/sdev/altera/14.0/hld export LD_LIBRARY_PATH=$ALTERAOCLSDKROOT/host/linux64/lib:$ALTERAOCLSDKROOT/board/nalla_pcie/linux64/lib export PATH=$PATH:$ALTERAOCLSDKROOT/bin export AOCL_BOARD_PACKAGE_ROOT=/home/sdev/altera/14.0/hld/board/nalla_pcie -export LM_LICENSE_FILE=8123@HPUMASSFPGA +export LM_LICENSE_FILE=[your license file here] -- GitLab