0

我正在尝试在 Ubuntu 14.04 上启用 cuDNN-6.5-R1 来编译 Caffe。CUDA 版本是 7.0。

我复制了 /usr/local/cuda/include 中的 cudnn.h 头文件和 /usr/local/cuda/lib64 中的 cudnn 库,然后是“sudo ldconfig”,当我执行“make all”时,我得到以下信息错误:

PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/util/db.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
             from ./include/caffe/common.hpp:19,
             from ./include/caffe/util/db.hpp:10,
             from src/caffe/util/db.cpp:1:
./include/caffe/util/cudnn.hpp:64:32: error: variable or field ‘createTensor4dDesc’ declared void
 inline void createTensor4dDesc(cudnnTensorDescriptor_t* desc) {
                            ^
./include/caffe/util/cudnn.hpp:64:32: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/util/cudnn.hpp:64:57: error: ‘desc’ was not declared in this scope
 inline void createTensor4dDesc(cudnnTensorDescriptor_t* desc) {
                                                     ^
./include/caffe/util/cudnn.hpp:69:29: error: variable or field ‘setTensor4dDesc’ declared void
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                         ^
./include/caffe/util/cudnn.hpp:69:29: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/util/cudnn.hpp:69:54: error: ‘desc’ was not declared in this scope
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                                                  ^
./include/caffe/util/cudnn.hpp:70:5: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
     ^
./include/caffe/util/cudnn.hpp:70:12: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
        ^
./include/caffe/util/cudnn.hpp:70:19: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
               ^
./include/caffe/util/cudnn.hpp:70:26: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
                      ^
./include/caffe/util/cudnn.hpp:71:5: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
     ^
./include/caffe/util/cudnn.hpp:71:19: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
               ^
./include/caffe/util/cudnn.hpp:71:33: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
                             ^
./include/caffe/util/cudnn.hpp:71:47: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
                                           ^
./include/caffe/util/cudnn.hpp:77:29: error: variable or field ‘setTensor4dDesc’ declared void
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                         ^
./include/caffe/util/cudnn.hpp:77:29: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/util/cudnn.hpp:77:54: error: ‘desc’ was not declared in this scope
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                                                  ^
./include/caffe/util/cudnn.hpp:78:5: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
     ^
./include/caffe/util/cudnn.hpp:78:12: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
        ^
./include/caffe/util/cudnn.hpp:78:19: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
               ^
./include/caffe/util/cudnn.hpp:78:26: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
                      ^
./include/caffe/util/cudnn.hpp:102:5: error: ‘cudnnTensorDescriptor_t’ has not been declared
     cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter,
     ^
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::setConvolutionDesc(cudnnConvolutionStruct**, int, cudnnFilterDescriptor_t, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:105:70: error: there are no arguments to ‘cudnnSetConvolution2dDescriptor’ that depend on a template parameter, so a declaration of ‘cudnnSetConvolution2dDescriptor’ must be available [-fpermissive]
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
                                                                  ^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                        ^
./include/caffe/util/cudnn.hpp:105:70: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
                                                                  ^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                        ^
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:117:13: error: ‘CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING’ was not declared in this scope
     *mode = CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING;
         ^
./include/caffe/util/cudnn.hpp:124:41: error: there are no arguments to ‘cudnnSetPooling2dDescriptor’ that depend on a template parameter, so a declaration of ‘cudnnSetPooling2dDescriptor’ must be available [-fpermissive]
     pad_h, pad_w, stride_h, stride_w));
                                     ^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                        ^
src/caffe/util/db.cpp: In function ‘caffe::db::DB* caffe::db::GetDB(caffe::DataParameter::DB)’:
src/caffe/util/db.cpp:71:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
src/caffe/util/db.cpp: In function ‘caffe::db::DB* caffe::db::GetDB(const string&)’:
src/caffe/util/db.cpp:81:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [.build_release/src/caffe/util/db.o] Error 1

我查看了其他与我有同样问题的人的帖子,但他们都使用 R2,而不是 R1。

4

1 回答 1

1

有关如何安装 CUDA、cuDNN 和 Caffe 的详细说明,请查看“ GPU Powered DeepLearning with NVIDIA DIGITS on EC2 ”。

顺便说一句,“他们都在使用 R2”的原因是 b/c,这只是一个要求。

于 2015-05-09T12:27:32.957 回答