CUDA 问题解决 —— CUDA+MPI出错:"mpi.h" No such file or directory

在CUDA源文件里使用MPI时,编译出错

Makefile文件:

CUDA_INSTALL_PATH = /usr/local/cuda-8.0
MPI_INSTALL_PATH = /opt/intel/compilers_and_libraries_2017.0.098/linux/mpi/intel64
NVCC = $(CUDA_INSTALL_PATH)/bin/nvcc
MPICC = $(MPI_INSTALL_PATH)/bin/mpicc

LIBS = -lcudart -lcurand -L$(CUDA_INSTALL_PATH)/lib64 -L$(MPI_INSTALL_PATH)/lib

CFILES = matadd.c
CUFILES = matadd_cuda.cu
OBJECTS = matadd.o matadd_cuda.o
EXECNAME = matadd

all:
    $(MPICC) -c $(CFILES)
    $(NVCC) -c $(CUFILES)
    $(MPICC) -o $(EXECNAME) $(LIBS) $(OBJECTS)

clean:
    rm -f *.o $(EXECNAME)

编译信息

[huangx@dl1 matadd_mpi]$ make
/opt/intel/compilers_and_libraries_2017.0.098/linux/mpi/intel64/bin/mpicc -c matadd.c
/usr/local/cuda-8.0/bin/nvcc  -c matadd_cuda.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are de

你可能感兴趣的:(CUDA,cuda,c语言)