Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
130 lines (92 sloc) 3.48 KB

Source for grCUDA NVIDIA Developer Blog


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    # produces saxpy.ptx
  1. Run Python script.
graalpython --jvm --polyglot

Compiling and binding kernel with buildkernel:

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

Running RAPIDS R Example

  1. Download the RAPIDS cuML package containing the libraries and 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/ lib/
  1. Start FastR (R interpreter).
# make sure CUML_LIB_DIR points to the directory that contains the two libraries
cd R
  1. Install the seriation package.
  1. Run cuml_dbscan.R script.

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.