Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
R
kernel
mandelbrot
README.md

README.md

Source for grCUDA NVIDIA Developer Blog

Contains:

Installing grCUDA

  1. Download GraalVM CE 19.2.1 for Linux graalvm-ce-linux-amd64-19.2.1.tar.gz from GitHub and untar it in your installation directory. Add that the GraalVM bin directory to he PATH environment 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}
  2. Download the grCUDA JAR from grcuda/releases and copy it into languages directory.

    cd $GRAALVM_DIR/jre/languages
    mkdir grcuda
    cp <download folder>/grcuda-0.1.0.jar grcuda
  3. 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 ]
  4. Download other GraalVM languages.

    cd $GRAAL_VM/bin
    ./gu available
    ./gu install python R
    ./gu install ruby   # optionally

Running bindkernel (NVRTC) Example

Binding precompiled kernel with bindkernel:

  1. Compile CUDA C kernel using nvcc.
cd kernel
nvcc -ptx saxpy.cu    # produces saxpy.ptx
  1. Run Python script.
graalpython --jvm --polyglot saxpy.py

Compiling and binding kernel with buildkernel:

  1. Run Python script.
graalpython --jvm --polyglot saxpy_nvrtc.py

Running RAPIDS R Example

  1. Download the RAPIDS cuML package containing the libraries libcuml.so and libcuml++.so from the rapidsai-nightly conda channel. Choose the package that corresponds to the CUDA Toolkit version that is installed on your system. For example:

  2. Extract the libraries from archive. In the following, let $CUML_LIB_DIR point 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
  1. Start FastR (R interpreter).
# make sure CUML_LIB_DIR points to the directory that contains the two libraries
cd R
./run_r.sh
>
  1. Install the seriation package.
install.packages('seriation')
  1. Run cuml_dbscan.R script.
source('cuml_dbscan.R')

Running the Python Mandelbrot Set Web Application

  1. Install required Node.JS packages into node_modules directory of the project.
cd mandelbrot
npm install
  1. Run Node.JS application.
node --jvm --polyglot app.js
  1. Point web browser to localhost:3000.
You can’t perform that action at this time.