riejohnson / ConText

ConText v4: Neural networks for text categorization
http://riejohnson.com/cnn_download.html
GNU General Public License v3.0
124 stars 14 forks source link

make not working #1

Closed hwsamuel closed 6 years ago

hwsamuel commented 6 years ago

I have an NVIDIA GeForce 940MX GPU on my machine and also have gcc fully functional, as well as CUDA 9.1 installed. I've followed the README instructions and added the custom CUDA path to the makefile but I'm getting the following error on running make

/bin/rm -f bin/reNet
/usr/local/cuda-9.1  /bin/nvcc src/com/AzDmat.cpp src/com/AzParam.cpp src/com/AzSmat.cpp src/com/AzStrPool.cpp src/com/AzTextMat.cpp src/com/AzTools.cpp src/com/AzUtil.cpp src/nnet/AzpPatchDflt.cpp src/nnet/AzpReNet.cpp src/nnet/AzpReLayer.cpp src/nnet/AzMultiConn.cpp src/nnet/AzpMain_reNet.cpp src/nnet/AzpLmSgd.cpp src/nnet/AzPmat.cpp src/nnet/AzPmatSpa.cpp src/nnet/AzPmatApp.cpp src/nnet/AzPmat_gpu.cu src/nnet/AzPmatSpa_gpu.cu src/nnet/AzCuda_Pmat.cu src/nnet/AzCuda_PmatSpa.cu src/nnet/AzCuda_PmatApp.cu src/nnet/AzpEv.cpp src/nnet/AzpLossDflt.cpp src/nnet/driv_reNet.cpp -Isrc/com -Isrc/data -Isrc/nnet  -D__AZ_SMAT_SINGLE__ -D__AZ_GPU__  -I/usr/local/cuda-9.1  /include -O2 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -o bin/reNet -L/usr/local/cuda-9.1  /lib64 -lcudart -lcublas -lcurand -lcusparse
make: execvp: /usr/local/cuda-9.1: Permission denied
makefile:84: recipe for target 'bin/reNet' failed
make: *** [bin/reNet] Error 127
hwsamuel commented 6 years ago

Resolved. I had an extra space after the CUDA_PATH, correct configuration is as follows for future reference

CUDA_PATH = /usr/local/cuda-9.1# <= Change this

lenhhoxung86 commented 6 years ago

I have the same problem even I've changed the variable CUDA_PATH.

mkdir -p bin 
/bin/rm -f bin/reNet
"/usr/local/cuda-9.0/"  /bin/nvcc src/com/AzDmat.cpp src/com/AzParam.cpp src/com/AzSmat.cpp src/com/AzStrPool.cpp src/com/AzTextMat.cpp src/com/AzTools.cpp src/com/AzUtil.cpp src/nnet/AzpPatchDflt.cpp src/nnet/AzpReNet.cpp src/nnet/AzpReLayer.cpp src/nnet/AzMultiConn.cpp src/nnet/AzpMain_reNet.cpp src/nnet/AzpLmSgd.cpp src/nnet/AzPmat.cpp src/nnet/AzPmatSpa.cpp src/nnet/AzPmatApp.cpp src/nnet/AzPmat_gpu.cu src/nnet/AzPmatSpa_gpu.cu src/nnet/AzCuda_Pmat.cu src/nnet/AzCuda_PmatSpa.cu src/nnet/AzCuda_PmatApp.cu src/nnet/AzpEv.cpp src/nnet/AzpLossDflt.cpp src/nnet/driv_reNet.cpp -Isrc/com -Isrc/data -Isrc/nnet  -D__AZ_SMAT_SINGLE__ -D__AZ_GPU__  -I"/usr/local/cuda-9.0/"  /include -O2 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -o bin/reNet -L"/usr/local/cuda-9.0/"  /lib64 -lcudart -lcublas -lcurand -lcusparse
/bin/sh: 1: /usr/local/cuda-9.0/: Permission denied
makefile:99: recipe for target 'bin/reNet' failed
make: *** [bin/reNet] Error 126
lenhhoxung86 commented 6 years ago

Finally, here is the config that makes it run:

CUDA_PATH = /usr/local/cuda-9.0/# <= Change this 
#CUDA_PATH = /opt/sw/packages/cuda/7.5
CUDA_INC_PATH   = $(CUDA_PATH)/include
CUDA_BIN_PATH   = $(CUDA_PATH)/bin
CUDA_LIB_PATH   = $(CUDA_PATH)/lib64
LDFLAGS1   = -L$(CUDA_LIB_PATH) -lcudart -lcublas -lcurand -lcusparse
CFLAGS1 = -Isrc/com -Isrc/data -Isrc/nnet  -D__AZ_SMAT_SINGLE__ -D__AZ_GPU__  -I$(CUDA_INC_PATH) -O2 \
        -gencode arch=compute_30,code=sm_30 \
        -gencode arch=compute_32,code=sm_32 \
        -gencode arch=compute_35,code=sm_35 \
        -gencode arch=compute_37,code=sm_37 \
        -gencode arch=compute_50,code=sm_50 \
        -gencode arch=compute_52,code=sm_52 \
        -gencode arch=compute_53,code=sm_53
I had to remove lines with "arch=compute_20: