Skip to content

Instantly share code, notes, and snippets.

@hokiegeek2
Last active October 9, 2022 09:56
Show Gist options
  • Select an option

  • Save hokiegeek2/cb993244479c318eeb457eecf80a210a to your computer and use it in GitHub Desktop.

Select an option

Save hokiegeek2/cb993244479c318eeb457eecf80a210a to your computer and use it in GitHub Desktop.
Single-Locale Chapel GPU testing
# Setup GPU env variables required by Chapel
export PATH=$CHPL_HOME/bin/linux64-x86_64/:$PATH
export CPATH=$CPATH:/usr/local/cuda/include
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64
export PATH=/usr/local/cuda/bin/:$PATH
export CHPL_TARGET_CPU=native
export CHPL_LOCALE_MODEL=gpu
export CHPL_RE2=bundled
export CHPL_COMM_SUBSTRATE=smp
export CHPL_COMM=none
export CHPL_LLVM=bundled
export CHPL_RT_OVERSUBSCRIBED=yes
# New for Chapel 1.28.0
export CHPL_TARGET_COMPILER=llvm
# For CUDA compute capability = 5.0
export CHPL_CUDA_ARCH=sm_50
@hokiegeek2
Copy link
Copy Markdown
Author

hokiegeek2 commented Jul 12, 2022

A simple diagnostic module to confirm Chapel is configured and built to put locales on GPUs:

module GpuFun {
    use GPUDiagnostics;
    use IO;

    proc main() {
        try! writeln(getGPUDiagnostics());
        try! writeln(here.gpus);
    }
}

Save as gpu_fun.chpl, then compile:

chpl gpu_fun.chpl 
warning: The prototype GPU support implies --no-checks. This may impact debuggability. To suppress this warning, compile with --no-checks explicitly

Running this results in the following:

(base) kjyost@einhorn:~/development$ ./gpu_fun -nl 1
(kernel_launch = 0)
LOCALE0.node0-GPU0
(base) kjyost@einhorn:~/development$ 

@hokiegeek2
Copy link
Copy Markdown
Author

I tried to get Arkouda to run on GPUs and I ran into a problem documented here

@hokiegeek2
Copy link
Copy Markdown
Author

hokiegeek2 commented Oct 8, 2022

building with Chapel 1.28 requires a env variable change:

image

Consequently, these are the env variables to set for Chapel 1.28.0:

Setup GPU env variables required by Chapel

export PATH=$CHPL_HOME/bin/linux64-x86_64/:$PATH
export CPATH=$CPATH:/usr/local/cuda/include
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64
export PATH=/usr/local/cuda/bin/:$PATH
export CHPL_TARGET_CPU=native
export CHPL_LOCALE_MODEL=gpu
export CHPL_RE2=bundled
export CHPL_COMM_SUBSTRATE=smp
export CHPL_COMM=none
export CHPL_LLVM=bundled
export CHPL_RT_OVERSUBSCRIBED=yes
export CHPL_TARGET_COMPILER=llvm

For CUDA compute capability = 5.0

export CHPL_CUDA_ARCH=sm_50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment