I’m trying to build C++ Extension with CMake using libtorch or using installed Pytorch package.
It’s ok when I use CPU-only build, but when using GPU-build there is a problem with Caffe2 - no CuDNN
So there is a question - is it possible somehow to detect automatically if Cudnn is installed (there were no problems with pytorch installation itself)?
Is it possible to simplify the process (I want to install the package using pip)?
>> CXX=g++-5 cmake -DCMAKE_PREFIX_PATH=/home/artbataev/Documents/libraries/libtorch ..
-- The CXX compiler identification is GNU 5.5.0
-- Check for working CXX compiler: /usr/bin/g++-5
-- Check for working CXX compiler: /usr/bin/g++-5 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found suitable version "9.0", minimum required is "7.0") 
-- Caffe2: CUDA detected: 9.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 9.0
-- Could NOT find CUDNN (missing: CUDNN_INCLUDE_DIR CUDNN_LIBRARY) 
CMake Warning at /home/artbataev/Documents/libraries/libtorch/share/cmake/Caffe2/public/cuda.cmake:101 (message):
  Caffe2: Cannot find cuDNN library.  Turning the option off
Call Stack (most recent call first):
  /home/artbataev/Documents/libraries/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
  /home/artbataev/Documents/libraries/libtorch/share/cmake/Torch/TorchConfig.cmake:39 (find_package)
  CMakeLists.txt:11 (find_package)


-- Autodetected CUDA architecture(s): 6.1;6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
CMake Error at /home/artbataev/Documents/libraries/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:96 (message):
  Your installed Caffe2 version uses cuDNN but I cannot find the cuDNN
  libraries.  Please set the proper cuDNN prefixes and / or install cuDNN.
Call Stack (most recent call first):
  /home/artbataev/Documents/libraries/libtorch/share/cmake/Torch/TorchConfig.cmake:39 (find_package)
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/artbataev/Documents/ML/end2end/build/CMakeFiles/CMakeOutput.log".
See also "/home/artbataev/Documents/ML/end2end/build/CMakeFiles/CMakeError.log".