Contains:
bindkernel+ launch example- Example 1: RAPIDS cuML DBSCAN from R
- Example 2: ASCII Mandelbrot Set from Express.js
-
Download GraalVM CE 19.2.1 for Linux
graalvm-ce-linux-amd64-19.2.1.tar.gzfrom GitHub and untar it in your installation directory. Add that the GraalVMbindirectory to hePATHenvironment variable.cd <your installation directory> tar xfz graalvm-ce-linux-amd64-19.2.1.tar.gz export GRAALVM_DIR=`pwd`/graalvm-ce-19.2.1 export PATH=${GRAALVM_HOME}/bin:${PATH}:${HOME}
-
Download the grCUDA JAR from grcuda/releases and copy it into
languagesdirectory.cd $GRAALVM_DIR/jre/languages mkdir grcuda cp <download folder>/grcuda-0.1.0.jar grcuda
-
Test grCUDA in Node.JS from GraalVM.
cd $GRAALVM_DIR/bin ./node --jvm --polyglot > arr = Polyglot.eval('grcuda', 'int[5]') [Array: null prototype] [ 0, 0, 0, 0, 0 ]
-
Download other GraalVM languages.
cd $GRAAL_VM/bin ./gu available ./gu install python R ./gu install ruby # optionally
Binding precompiled kernel with bindkernel:
- Compile CUDA C kernel using nvcc.
cd kernel
nvcc -ptx saxpy.cu # produces saxpy.ptx- Run Python script.
graalpython --jvm --polyglot saxpy.pyCompiling and binding kernel with buildkernel:
- Run Python script.
graalpython --jvm --polyglot saxpy_nvrtc.py-
Download the RAPIDS cuML package containing the libraries
libcuml.soandlibcuml++.sofrom the rapidsai-nightly conda channel. Choose the package that corresponds to the CUDA Toolkit version that is installed on your system. For example: -
Extract the libraries from archive. In the following, let
$CUML_LIB_DIRpoint to this directory.
tar xfj libcuml-0.11.0a1191028-cuda10.1_76.tar.bz2 \
--strip-components 1 -C ${CUML_LIB_DIR} \
lib/libcuml.so lib/libcuml++.so- Start FastR (R interpreter).
# make sure CUML_LIB_DIR points to the directory that contains the two libraries
cd R
./run_r.sh
>- Install the
seriationpackage.
install.packages('seriation')- Run
cuml_dbscan.Rscript.
source('cuml_dbscan.R')- Install required Node.JS packages into
node_modulesdirectory of the project.
cd mandelbrot
npm install- Run Node.JS application.
node --jvm --polyglot app.js- Point web browser to localhost:3000.