Can't build caffe with cudnn (.build_release/lib/libcaffe.so: undefined reference to `caffe::cudnn::

177 views
Skip to first unread message

dusa

unread,
Jul 21, 2016, 2:46:30 PM7/21/16
to Caffe Users
Hi all,

I have been trying to install cudnn to work with caffe. I have a GPU supporting compute capability 5.0 and 5GB memory. I have tried to install cuda 7.5 and cudnn v5 and cudnn v4 and also cuda 7.0 and cudnn v5, v4 and v3. I keep getting the error below when I build caffe:

CXX/LD -o .build_release/examples/siamese/convert_mnist_siamese_data.bin
.build_release/lib/libcaffe.so: undefined reference to caffe::cudnn::dataType<double>::zero' .build_release/lib/libcaffe.so: undefined reference tocaffe::cudnn::dataType::one'
.build_release/lib/libcaffe.so: undefined reference to caffe::cudnn::dataType<float>::zero' .build_release/lib/libcaffe.so: undefined reference tocaffe::cudnn::dataType::one'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/lib/libcaffe.so: undefined reference to caffe::cudnn::dataType<double>::zero' .build_release/lib/libcaffe.so: undefined reference tocaffe::cudnn::dataType::one'
.build_release/lib/libcaffe.so: undefined reference to caffe::cudnn::dataType<float>::zero' .build_release/lib/libcaffe.so: undefined reference tocaffe::cudnn::dataType::one'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to caffe::cudnn::dataType<double>::zero' .build_release/lib/libcaffe.so: undefined reference tocaffe::cudnn::dataType::one'
.build_release/lib/libcaffe.so: undefined reference to caffe::cudnn::dataType<float>::zero' .build_release/lib/libcaffe.so: undefined reference tocaffe::cudnn::dataType::one'
collect2: error: ld returned 1 exit status
.......and the like

I have run cmake .. in build and it seems to detect my cuda and cudnn well:

-- CUDA detected: 7.0
-- Found cuDNN: ver. 4.0.7 found (include: /usr/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Added CUDA NVCC flags for: sm_50 sm_20
-- OpenCV found (/usr/local/share/OpenCV)

It only shows an error for ATLAS:
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR
Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindAtlas.cmake:43 (find_package_handle_standard_args)
cmake/Dependencies.cmake:88 (find_package)
CMakeLists.txt:43 (include)

However as stated in my config, I am using OpenBlas and I had been working with the same configuration and didn't have any problems before until I tried to build with cudnn.

What might be the problem here?? I have been switching back and forth with versions but no luck, I need to use cudnn as I have memory problems running py-faster-rcnn even with my old TeslaC2070 (6 GB dedicated memory). I am currently using a Quadro K2200 4GB.

dusa

unread,
Jul 21, 2016, 2:51:20 PM7/21/16
to Caffe Users
-- Found cuDNN: ver. 4.0.7 found (include: /usr/include, library: /usr/local/cuda/lib64/libcudnn.so)

I have copied cudnn.h under usr/local/cuda-7.0/include/  (not /usr/include as detected) could this be the reason? I can't see where this is set in makefile

dusa

unread,
Jul 21, 2016, 2:59:54 PM7/21/16
to Caffe Users

I have put the path in DIRS_INCLUDE and the cuda-7.0/lib64 to LIBRARY_DIRS as below:

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/cuda-7.0/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/cuda-7.0/lib64

But it didn't work and still gives the same error.

Reply all
Reply to author
Forward
0 new messages