facebookarchive / caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework.
https://caffe2.ai
Apache License 2.0
8.42k stars 1.94k forks source link

compile error related with CUDNN #411

Open buaaavis opened 7 years ago

buaaavis commented 7 years ago

Error reported: In file included from /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.h:4:0, [100/4644] from /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:1: /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc: In instantiation of ‘bool caffe2::RecurrentParamAccessOp<T, mode>::RunOnDevice() [with T = float; caffe2::RecurrentParam OpMode mode = (caffe2::RecurrentParamOpMode)1u]’: /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:595:1: required from here /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:397:34: error: cannot convert ‘const cudnnTensorDescriptor_t {aka cudnnTensorStruct const}’ to ‘cudnnTensorStruct const ’ for argument ‘3’ to ‘cudnnStatus_t cudnnGetRNNParamsSize(cudnnHandle_t, cudnnRNNDescriptor_t, cudnnTensorStruct const, size_t)’ cudnnTypeWrapper::type)); ^ /home/alohal/learning/caffe2/caffe2/core/common_cudnn.h:64:28: note: in definition of macro ‘CUDNN_ENFORCE’ cudnnStatus_t status = condition; \ ^ /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:434:14: error: cannot convert ‘const cudnnTensorDescriptor_t {aka cudnnTensorStruct const}’ to ‘cudnnTensorStruct const ’ for argument ‘4’ to ‘cudnnStatus_t cudnnGetRNNLinLayerBiasParams(cudnnHandle_t, cudnnRNNDescriptor_t, int, cudnnTensorStruct const, cudnnFilterDescriptor_t, const void, int, cudnnFilt erDescriptor_t, void)’ &bias)); ^ /home/alohal/learning/caffe2/caffe2/core/common_cudnn.h:64:28: note: in definition of macro ‘CUDNN_ENFORCE’ cudnnStatus_t status = condition; \ ^ /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:473:17: error: cannot convert ‘const cudnnTensorDescriptor_t {aka cudnnTensorStruct const}’ to ‘cudnnTensorStruct const ’ for argument ‘4’ to ‘cudnnStatus_t cudnnGetRNNLinLayerMatrixParams(cudnnHandle_t, cudnnRNNDescriptor_t, int, cudnnTensorStruct const, cudnnFilterDescriptor_t, const void, int, cudnnFi lterDescriptor_t, void)’ &pmatrix)); ^ /home/alohal/learning/caffe2/caffe2/core/common_cudnn.h:64:28: note: in definition of macro ‘CUDNN_ENFORCE’ cudnnStatus_t status = condition; \ ^ /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc: In instantiation of ‘bool caffe2::RecurrentParamAccessOp<T, mode>::RunOnDevice() [with T = float; caffe2::RecurrentParam OpMode mode = (caffe2::RecurrentParamOpMode)0u]’: /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:595:1: required from here /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:397:34: error: cannot convert ‘const cudnnTensorDescriptor_t {aka cudnnTensorStruct const}’ to ‘cudnnTensorStruct const ’ for argument ‘3’ to ‘cudnnStatus_t cudnnGetRNNParamsSize(cudnnHandle_t, cudnnRNNDescriptor_t, cudnnTensorStruct const, size_t)’ cudnnTypeWrapper::type)); ^ /home/alohal/learning/caffe2/caffe2/core/common_cudnn.h:64:28: note: in definition of macro ‘CUDNN_ENFORCE’ cudnnStatus_t status = condition; \ ^ /home/alohal/learning/caffe2/caffe2/operators/recurrent_op_cudnn.cc:434:14: error: cannot convert ‘const cudnnTensorDescriptor_t {aka cudnnTensorStruct const}’ to ‘cudnnTensorStruct const ’ for argument ‘4’ to ‘cudnnStatus_t cudnnGetRNNLinLayerBiasParams(cudnnHandle_t, cudnnRNNDescriptor_t, int, cudnnTensorStruct const, cudnnFilterDescriptor_t, const void, int, cudnnFilt erDescriptor_t, void**)’ &bias)); ^

$PATH: /home/alohal/anaconda2/bin:/home/alohal/anaconda2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/utils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/usr/local/cuda-8.0/bin/

$LD_LIBRARY_PATH: /lib/x86_64-linux-gnu:/home/alohal/anaconda2/lib:/lib/x86_64-linux-gnu:/home/alohal/anaconda2/lib:/usr/local/cuda-8.0/lib64/:/usr/local/cudnn-5.0/lib64

I have no idea to fix this bug, So I post this issue. Thanks in advance.

Yangqing commented 7 years ago

@slayton58 this seems like a cudnn 5 vs 6 difference error? Do we still support cudnn5?

slayton58 commented 7 years ago

It could be a 5.1 vs. 6.0 issue -- I'm not familiar enough with the cuDNN RNN code to know if the API changed between 5.0 and 5.1 though. 5.1 and 6.0 are the versions publicly available through the cuDNN download pages.

I would suggest upgrading to 6.0.