cuDNN linking trouble

566 views
Skip to first unread message

Philip H

unread,
Jul 2, 2015, 6:25:34 AM7/2/15
to caffe...@googlegroups.com
Hey guys,

I have installed CUDA 7.0 and it's working (according to nvidia-smi and deviceQuery).

Then, I downloaded cuDNN (cudnn-6.5-linux-R1 to be precise) to a local directory and added the following to my ~.bashrc:

export LD_INCLUDE_PATH=$LD_INCLUDE_PATH:/usr/wiss/haeusser/libs/cudnn-6.5-linux-R1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/wiss/haeusser/libs/cudnn-6.5-linux-R1
export PATH=/usr/wiss/haeusser/libs/cudnn-6.5-linux-R1:$PATH

In the Makefile.config I added

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/wiss/haeusser/libs/cudnn-6.5-linux-R1
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/wiss/haeusser/libs/cudnn-6.5-linux-R1

Still, when I run make all I get

CXX src/caffe/layer_factory.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/layer.hpp:8,
                 from src/caffe/layer_factory.cpp:3:
./include/caffe/util/cudnn.hpp:64:32: error: variable or field ‘createTensor4dDesc’ declared void
./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
./include/caffe/util/cudnn.hpp:69:29: error: variable or field ‘setTensor4dDesc’ declared void
./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
./include/caffe/util/cudnn.hpp:70:5: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:70:12: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:70:19: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:70:26: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:71:5: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:71:19: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:71:33: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:71:47: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:77:29: error: variable or field ‘setTensor4dDesc’ declared void
./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
./include/caffe/util/cudnn.hpp:78:5: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:78:12: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:78:19: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:78:26: error: expected primary-expression before ‘int’
./include/caffe/util/cudnn.hpp:102:5: error: ‘cudnnTensorDescriptor_t’ has not been declared
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::setConvolutionDesc(cudnnConvolutionStruct**, int, cudnnFilterDescriptor_t, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:104:3: error: there are no arguments to ‘cudnnSetConvolution2dDescriptor’ that depend on a template parameter, so a declaration of ‘cudnnSetConvolution2dDescriptor’ must be available [-fpermissive]
./include/caffe/util/cudnn.hpp:104:3: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
./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
./include/caffe/util/cudnn.hpp:123:3: error: there are no arguments to ‘cudnnSetPooling2dDescriptor’ that depend on a template parameter, so a declaration of ‘cudnnSetPooling2dDescriptor’ must be available [-fpermissive]
In file included from ./include/caffe/loss_layers.hpp:11:0,
                 from ./include/caffe/common_layers.hpp:12,
                 from ./include/caffe/vision_layers.hpp:10,
                 from src/caffe/layer_factory.cpp:6:
./include/caffe/neuron_layers.hpp: At global scope:
./include/caffe/neuron_layers.hpp:501:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/neuron_layers.hpp:502:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/neuron_layers.hpp:584:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/neuron_layers.hpp:585:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/neuron_layers.hpp:669:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/neuron_layers.hpp:670:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
In file included from ./include/caffe/vision_layers.hpp:10:0,
                 from src/caffe/layer_factory.cpp:6:
./include/caffe/common_layers.hpp:536:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/common_layers.hpp:537:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
In file included from src/caffe/layer_factory.cpp:6:0:
./include/caffe/vision_layers.hpp:249:10: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/vision_layers.hpp:249:33: error: template argument 1 is invalid
./include/caffe/vision_layers.hpp:249:33: error: template argument 2 is invalid
./include/caffe/vision_layers.hpp:250:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
./include/caffe/vision_layers.hpp:450:3: error: ‘cudnnTensorDescriptor_t’ does not name a type
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetTanHLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:156:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetTanHLayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:156:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSoftmaxLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:133:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSoftmaxLayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:133:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSigmoidLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:110:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSigmoidLayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:110:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetReLULayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:87:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetReLULayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:87:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetPoolingLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:64:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetPoolingLayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:64:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetConvolutionLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
src/caffe/layer_factory.cpp: In function ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetConvolutionLayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [.build_release/src/caffe/layer_factory.o] Error 1


To me, it looks like cuDNN can't be found sowhow or there's a mismatch of versions ...

Does anyone have a hint for me?

Thank you!
Philip

Philip H

unread,
Jul 3, 2015, 5:13:21 AM7/3/15
to caffe...@googlegroups.com
Okay, I solved the problem. For some reason it was a bad idea to put the links to the .bashrc. In case anyone has the same problem, just comment that reference out and you should be fine for compiling :-)

yuangd

unread,
Aug 10, 2015, 1:10:31 AM8/10/15
to Caffe Users
"just comment that reference out" , would you please tell me how to do in details? thank you

Philip Häusser | PH1L.tv

unread,
Aug 10, 2015, 7:37:04 AM8/10/15
to yuangd, Caffe Users
Just make sure that for compiling, you reference cudnn in the Makefile.config (as described) but you don't have any links in your .bashrc. If you've never changed your .bashrc you should be fine.
--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/fBvoAdcqCj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/e2507405-4b0c-4c30-b0c2-d1e05a168052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

npit

unread,
Sep 9, 2015, 2:30:55 AM9/9/15
to Caffe Users, thu.y...@gmail.com
I have the same issue while trying to build the latest version of caffe ( I have built a previous one in the past) and that does not work and I do not understand why it would in the first place.
Reply all
Reply to author
Forward
0 new messages