Compiling Cuda
code on Heracles
In order to compile CUDA code files, you have to use nvcc compiler.
Cuda codes can only be compiled and executed on node that have a
GPU. Heracles has 4 Nvidia Tesla P100 GPUs on node18.
Cuda Compiler is installed on node 18, so you need ssh to compile cuda programs.
Syntax
- ssh node18 nvcc <path/> source_code.cu -o <path/> exec_program
Compiling options:
-o <path/file>:
place the output into <path/file>. If this option is omitted, the
compiler will create executable program named a.out in working
directory.
Example:
ssh node18 nvcc /home/john/csc5551/mm-cuda.cu -o /home/john/csc5551/mm-cuda