Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

directory structure is very confused #168

Closed
sgxu opened this issue Aug 10, 2016 · 4 comments
Closed

directory structure is very confused #168

sgxu opened this issue Aug 10, 2016 · 4 comments

Comments

@sgxu
Copy link

sgxu commented Aug 10, 2016

Hello, I can not find cudnn head file and cudnn libs, even I can not find caffe head files libs and so on.
I feel the directory structure is very confused.
I do not know why you design such a directory structure.
And I do not know how to use it.

thank you!

@flx42
Copy link
Member

flx42 commented Aug 10, 2016

For cuDNN:

$ nvidia-docker run -ti --rm nvidia/cuda:7.5-cudnn5-devel 
root@c4c3c2005975:/# ldconfig -p | grep cudnn
        libcudnn.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudnn.so.5
        libcudnn.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudnn.so
root@c4c3c2005975:/# find / -name 'cudnn.h'
/usr/include/cudnn.h

For Caffe, the image we provide is not a dev image, so there are no headers and no libraries to link against. It's only useful if you software is already packaged (e.g. with pip or deb) and you want to deploy it inside a container. See this discussion:
#59
But it's not too difficult to modify the existing Caffe Dockerfile, you need to change the first line to a FROM cuda:7.5-cudnn5-devel and then you also need to install package libcaffe-nv0-dev.

@sgxu
Copy link
Author

sgxu commented Aug 10, 2016

Thanks very much, but BTW, why not put libcudnn into /usr/local/cuda/lib64/ or /usr/local/cuda/targets/x86_64-linux/lib, usually, we put the cudnn libs into these path.

@flx42
Copy link
Member

flx42 commented Aug 10, 2016

Because we now have .deb packages for recent versions of cuDNN and they install at this location, which is the recommended locations for libraries installed through a deb package. I didn't choose :)
When installing a library without a deb, it should go in /usr/local/, CUDA is a bit particular since it's a deb that still installs in /usr/local for legacy reasons.

@flx42
Copy link
Member

flx42 commented Aug 10, 2016

By the way, /usr/lib/x86_64-linux-gnu/ is actually better for users, it should always be in the search path of your linker whereas /usr/local/cuda/lib64 is not, compare the following with a fresh CUDA install:

$ g++ test.cc -lcublas
/usr/bin/ld: cannot find -lcublas  
collect2: error: ld returned 1 exit status

$ g++ test.cc -lcudnn
# works fine

However, with our Docker images both will work because of these lines:
https://github.com/NVIDIA/nvidia-docker/blob/master/ubuntu-14.04/cuda/7.5/runtime/Dockerfile#L30-L32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants