I am conducting my final year project with CUDA and MPI. I am using Lam/MPI and it is supposed to be running as a normal user but not as root user. On the otherhand, CUDA should be running as the root user. So I would like to know that how we can run MPI+CUDA program as the root user or a normal user. In adition, I would like to know that is there any special way to compile a CUDA+MPI progam because I am going to use basic mpicc tool.
Why should CUDA be running as root?
CUDA programs shouldn’t be running as root. By default, the installer creates the /dev/nvidia? and /dev/nvidiactl devices with a primary group “video”. All that is required is to give any users that need to run CUDA membership of that group, and their programs requiring access to CUDA hardware will work without requiring any special privileges.
In LAM, mpicc is just a wrapper for your preferred compiler (gcc I presume). You can compile and link MPI containing code with the standard compiler and appropriate libraries inside the standard NVIDIA SDK build system.
u can use nvcc to compile mpi code… u just have to link the mpi and lam libraries. For example , to compile foo.c u can do the following:
nvcc -c foo.c -lmpi -llam -L/usr/lib64 -L/usr/bin -lutil -o foo.o
It is not working when some CUBLASS libraries are used. For an example, how to compile given simpleCUBLAS example using this command ?It says it cannot find any CUBLASS functions. My sdk is located at /home/nishantha/NVIDIA_CUDA_SDK