Incubator-mxnet: Error :"cannot find -lcudnn" when compile mxnet

Created on 18 Apr 2018  路  8Comments  路  Source: apache/incubator-mxnet

Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.

For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io

Description

when I compile the mxnet source code, it throw an error "cannot find -lcudnn"

Environment info (Required)

----------Python Info----------
('Version      :', '2.7.12')
('Compiler     :', 'GCC 4.4.7 20120313 (Red Hat 4.4.7-1)')
('Build        :', ('default', 'Jul  2 2016 17:42:40'))
('Arch         :', ('64bit', 'ELF'))
------------Pip Info-----------
('Version      :', '8.1.2')
('Directory    :', '/export/docker/JXQ-23-46-48.h.chinabank.com.cn/saber/mxnet_env/mxnet_2.7/lib/python2.7/site-packages/pip')
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
('Platform     :', 'Linux-3.10.0-514.el7.x86_64-x86_64-with-centos-7.3.1611-Core')
('system       :', 'Linux')
('node         :', 'JXQ-240-26-35.h.chinabank.com.cn')
('release      :', '3.10.0-514.el7.x86_64')
('version      :', '#1 SMP Tue Nov 22 16:42:41 UTC 2016')
----------Hardware Info----------
('machine      :', 'x86_64')
('processor    :', 'x86_64')
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                48
On-line CPU(s) list:   0-47
Thread(s) per core:    2
Core(s) per socket:    12
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 79
Model name:            Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
Stepping:              1
CPU MHz:               2200.000
BogoMIPS:              4400.10
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              30720K
NUMA node0 CPU(s):     0-11,24-35
NUMA node1 CPU(s):     12-23,36-47
----------Network Test----------
Setting timeout: 10

Package used (Python/R/Scala/Julia):
I'm using python2.7

Build info (Required if built from source)

Compiler : gcc

MXNet version:
Version 1.1.0 Release

Build config:

make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 USE_LAPACK=1

Error Message:

t -L/opt/anaconda1anaconda2anaconda3/lib -L/usr/local/cuda/lib64 -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -lcufft -lcublas
-lnpps -lnppi -lnppc -lcudart -ltbb -lrt -lpthread -lm -ldl -llapack -lcudnn  -lcufft -lcuda -lnvrtc -L/usr/local/cuda/lib64/stubs
a - build/src/common/random_generator_gpu.o
a - build/src/ndarray/ndarray_function_gpu.o
a - build/src/operator/svm_output_gpu.o
a - build/src/operator/optimizer_op_gpu.o
a - build/src/operator/slice_channel_gpu.o
a - build/src/operator/convolution_v1_gpu.o
a - build/src/operator/instance_norm_gpu.o
a - build/src/operator/correlation_gpu.o
a - build/src/operator/roi_pooling_gpu.o
a - build/src/operator/sequence_mask_gpu.o
a - build/src/operator/pad_gpu.o
a - build/src/operator/grid_generator_gpu.o
a - build/src/operator/leaky_relu_gpu.o
a - build/src/operator/rnn_gpu.o
a - build/src/operator/crop_gpu.o
a - build/src/operator/sequence_reverse_gpu.o
a - build/src/operator/identity_attach_KL_sparse_reg_gpu.o
a - build/src/operator/swapaxis_gpu.o
a - build/src/operator/softmax_output_gpu.o
a - build/src/operator/bilinear_sampler_gpu.o
a - build/src/operator/spatial_transformer_gpu.o
a - build/src/operator/make_loss_gpu.o
a - build/src/operator/pooling_v1_gpu.o
a - build/src/operator/batch_norm_v1_gpu.o
a - build/src/operator/loss_binary_op_gpu.o
a - build/src/operator/regression_output_gpu.o
a - build/src/operator/l2_normalization_gpu.o
a - build/src/operator/sequence_last_gpu.o
a - build/src/kvstore/gradient_compression_gpu.o
a - build/src/kvstore/kvstore_utils_gpu.o
/bin/ld: cannot find -lcudnn
collect2: error: ld returned 1 exit status
make: *** [lib/libmxnet.so] Error 1
make: *** Waiting for unfinished jobs....
/bin/ld: cannot find -lcudnn
collect2: error: ld returned 1 exit status
make: *** [bin/im2rec] Error 1 

What have you tried to solve it?

  1. check and modified the .sh file

    export PREFIX=\~/mxnet_env/mxnet_2.7
    export PATH=$PREFIX/bin:$PATH
    export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
    export PATH=$PATH:/usr/local/cuda-8.0/bin/
    export CUDA_HOME=$PREFIX/lib
    export PKG_CONFIG_PATH=$PATH:\~/mxnet_env/mxnet_2.7/pkgs/opencv-gpu-2.4.13-py27_0/lib/pkgconfig

  2. recompile

Most helpful comment

That works! Thank you again from the bottom of my heart !

All 8 comments

hmm
I have solved the problem by "conda install cudnn"

I ran into a similar problem. Can you help me with this? Here comes the Error Message:

/usr/bin/ld: cannot find -lnppi
collect2: error: ld returned 1 exit status
Makefile:466: recipe for target 'lib/libmxnet.so' failed
make: * [lib/libmxnet.so] Error 1
make:
Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lnppi
collect2: error: ld returned 1 exit status
Makefile:495: recipe for target 'bin/im2rec' failed
make: *
* [bin/im2rec] Error 1

hei, @Lane565
Maybe you can try as the answer ->https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary
I'm not sure if it's effective ,but the method make sense.

Thanks for replying .Last night ,I found that it was due to the lack of libnppi.so files in the /cuda-9.0/lib64/
directory .So I changed cuda version to cuda8.0 and used MXNet 1.0.0 .Finally I succeeded in compiling.

But here comes another problem. When I start Python terminal "import mxnet as mx", error occurs again.

OSError: /home/qwang/anaconda2/bin/../lib/libgomp.so.1: version `GOMP_4.0' not found (required by /home/qwang/Xiang/Download/apache-mxnet-src-1.0.0-incubating/python/mxnet/../../lib/libmxnet.so)

That works! Thank you again from the bottom of my heart !

Hi @Alexander-flyer @Lane565 , are you still facing the same issue? Can we close this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuconglin picture yuconglin  路  3Comments

dmadeka picture dmadeka  路  3Comments

sbodenstein picture sbodenstein  路  3Comments

Zhaoyang-XU picture Zhaoyang-XU  路  3Comments

realbns2008 picture realbns2008  路  3Comments