My goal is to implement a math problem in cuda by using mpi on a 3 node cluster with one frontend with no cuda on it and two compute nodes with cuda and GPU’s inside them.
I have written a MPI and CUDA program. The cuda file is kernel.cu and the mpi file is mpi.c. I called a function called run_kernel from mpi.c and the run_kernel function is defined in kernel.cu . The main function is present in mpi.c and this main function calls the run_kernel function in kernel.cu . In kernel.cu file I defined run_kernel function as extern “C” function.
When i compile the kernel.cu file by using
$ nvcc -arch=sm_11 kernel.cu (compiled like this Since I used atomicadd function)
The error it gives is
/usr/lib/gcc/i386-redhat-linux/4.1.2/…/…/…/crt1.o: In function _start': (.text+0x18): undefined reference to main’
collect2: ld returned 1 exit status
If I use nvcc -c then it is giving an error “atomicadd undefined”. So this the reason Why I used
nvcc -arch=sm_11 kernel.cu
If I compile the code on a single compute node then it works fine. i think the problem right now is not having main function in kernel.cu. `I put the main function in mpi.c file which calls kernel.cu
If I use nvcc -c then it is giving an error “atomicadd undefined”. So this the reason Why I used
nvcc -arch=sm_11 kernel.cu
If I compile the code on a single compute node then it works fine. i think the problem right now is not having main function in kernel.cu. `I put the main function in mpi.c file which calls kernel.cu