Skip to content
Pascal Spörri edited this page Mar 16, 2017 · 2 revisions

Building the OpenACC/CUDA Sample

Daint

PGI Compiler

module load daint-gpu
module switch PrgEnv-cray PrgEnv-pgi
module load gcc
module load cudatoolkit
module load CMake
export CC=gcc
export CXX=g++
export FC=ftn
mkdir build
cd build
cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCUDA_ARCH=sm_60 \
    -DCUDA_HOST_COMPILER=`which gcc`

make -j 4
srun -C gpu -n 1 --gres=gpu:1 openacc_cuda_sample

Cray Compiler

module load daint-gpu
module load gcc
module load cudatoolkit
module load CMake
module load craype-accel-nvidia60
export CC=gcc
export CXX=g++
export FC=ftn
mkdir build
cd build
cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCUDA_ARCH=sm_60 \
    -DCUDA_HOST_COMPILER=`which gcc`

make -j 4
srun -C gpu -n 1 --gres=gpu:1 openacc_cuda_sample
Clone this wiki locally