Skip to content

Conversation

@cbalint13
Copy link
Contributor

  • This simple patch allows version display and storage for cuDNN external plugin detection process. It is based on cudnn.h parsing, and can parse booth v2 and newer of future releases. See prints below:
-- Found cuDNN: 2 (include: /usr/local/cuda/include, library: /usr/lib64/libcudnn.so)
-- Found cuDNN: 3.0.07 (include: /usr/local/cuda/include, library: /usr/lib64/libcudnn.so)

@shelhamer
Copy link
Member

It's good to confirm the detected cuDNN. @lukeyeager could you check this?

@lukeyeager
Copy link
Contributor

I pulled the branch and checked it against various cuDNN versions. Seems to work correctly for >= v2, and fail gracefully for older versions:

-- Found cuDNN: .. (include: /usr/local/cudnn/v1/include, library: /usr/local/cudnn/v1/lib64/libcudnn.so)
-- Found cuDNN: .. (include: /usr/local/cudnn/v2-rc3/include, library: /usr/local/cudnn/v2-rc3/lib64/libcudnn.so)
-- Found cuDNN: 2 (include: /usr/local/cudnn/v2/include, library: /usr/local/cudnn/v2/lib64/libcudnn.so)
-- Found cuDNN: 3.0.01 (include: /usr/local/cudnn/v3-beta2/include, library: /usr/local/cudnn/v3-beta2/lib64/libcudnn.so)
-- Found cuDNN: 3.0.01 (include: /usr/local/cudnn/v3-rc/include, library: /usr/local/cudnn/v3-rc/lib64/libcudnn.so)
-- Found cuDNN: 3.0.02 (include: /usr/local/cudnn/v3-rc3/include, library: /usr/local/cudnn/v3-rc3/lib64/libcudnn.so)
-- Found cuDNN: 3.0.07 (include: /usr/local/cudnn/v3/include, library: /usr/local/cudnn/v3/lib64/libcudnn.so)
-- Found cuDNN: 4.0.1 (include: /usr/local/cudnn/v4-20151013/include, library: /usr/local/cudnn/v4-20151013/lib64/libcudnn.so)

I've verified with the cuDNN team that they plan to stick to this style of declaring the version in the header, so this should keep working with future versions.

One suggestion - I would like to see the version number printed in the summary as well:

-- Dependencies:
--   BLAS              :   Yes (Atlas)
--   Boost             :   Yes (ver. 1.54)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 2.5.0)
--   lmdb              :   Yes (ver. 0.9.10)
--   LevelDB           :   Yes (ver. 1.15)
--   Snappy            :   Yes (ver. 1.1.0)
--   OpenCV            :   Yes (ver. 2.4.8)
--   CUDA              :   Yes (ver. 7.0)
-- 
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_35
--   cuDNN             :   Yes

Something like Yes (ver. 3.0.07) instead of just Yes.

@cbalint13
Copy link
Contributor Author

@lukeyeager , will work on update in this case.

  • I was unaware that cudnn v1 exists.
  • Will short the output to align with summaries.

@cbalint13
Copy link
Contributor Author

@lukeyeager ,

  • Could please provide me the cudnn.h of "v2-rc3" release ?

  • v1 clearly have no marks in its header file !

    I think we should skip display any (ver. X) in case where cudnn.h lack of any versioning marks, and i am afraid booth v1 and v2-rc3 fall into this class.

Waiting for "v2-rc3" header file confirmal, if can help me with the header file.

@lukeyeager
Copy link
Contributor

@cbalint13 Caffe doesn't support cuDNN < v3 since #3160. So I wouldn't worry about parsing older versions. I just provided extra info because I had it handy. Failing to parse v1 headers is perfectly fine. Displaying (ver. X) or (ver. ???) or something seems good to me.

@cbalint13
Copy link
Contributor Author

@lukeyeager , @shelhamer

First thanks a lot for your feedback ! Lets then settle down:

  • (a) v1, v2-rc will be: Yes (ver. ???)
  • (b) v2-final will be: Yes (ver. 2)
  • (c) v3 and beyond: Yes (ver. 3.0.07)

For (a) or (b) cmake will halt with: cuDNN version >= 3 required. For (c) all will pass.

Do you agree ? If yes, will proceed coding it up.

@cbalint13
Copy link
Contributor Author

@lukeyeager ,

  • Updated (foce push). Now we have:
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_52
--   cuDNN             :   Yes (ver. 3.0.07)

And for versions below v3 i considered to simply halt and display ???:

-- Found cuDNN: ver. ??? found (include: /usr/local/cuda/include, library: /usr/lib64/libcudnn.so)
CMake Error at cmake/Cuda.cmake:212 (message):
  cuDNN version >3 is required.

@lukeyeager
Copy link
Contributor

for versions below v3 i considered to simply halt and display ???

That sounds reasonable to me, and a nice improvement.

I tried it and it works as you described - errors when version < 3.

shelhamer added a commit that referenced this pull request Dec 2, 2015
[build] Display and store cuDNN version numbers for CMake
@shelhamer shelhamer merged commit 0fa2607 into BVLC:master Dec 2, 2015
@shelhamer
Copy link
Member

Thanks for the build improvement @cbalint13 and guidance @lukeyeager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants