Hello all,
I have been trying to set up libtorch on centos8 as instructed on the installation guide provided by Pytorch. I have cuDNN 8 with 440.33 drivers and my cmake( version 3.1) looks like -
-- Caffe2: CUDA detected: 10.2
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.2
-- Found cuDNN: v? (include: /usr/include, library: /usr/lib64/libcudnn.so)
CMake Error at /home/atharva/libtorch/libtorch/share/cmake/Caffe2/public/cuda.cmake:170 (message):
PyTorch requires cuDNN 7 and above.
Call Stack (most recent call first):
/home/atharva/libtorch/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
/home/atharva/libtorch/libtorch/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/atharva/CLionProjects/TorchTest/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/atharva/CLionProjects/TorchTest/cmake-build-debug/CMakeFiles/CMakeError.log".
I have just started developing in c++ so this might be a very basic question…
What could I be doing wrong,
TIA
Sorry for the late reply @ptrblck… just saw the reply today, I replaced my stable downloads with the nightly and the CMake file contains exactly what you suggested. However, I get an error saying -
-- Caffe2: CUDA detected: 10.2
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.2
-- Could NOT find CUDNN (missing: CUDNN_LIBRARY_PATH)
CMake Warning at /home/atharva/libtorch/libtorch/share/cmake/Caffe2/public/cuda.cmake:109 (message):
Caffe2: Cannot find cuDNN library. Turning the option off
Call Stack (most recent call first):
/home/atharva/libtorch/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
/home/atharva/libtorch/libtorch/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
CMakeLists.txt:5 (find_package)
-- Autodetected CUDA architecture(s): 7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
CMake Error at /home/atharva/libtorch/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/atharva/libtorch/libtorch/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/atharva/CLionProjects/TorchTest/CMakeFiles/CMakeOutput.log".
See also "/home/atharva/CLionProjects/TorchTest/CMakeFiles/CMakeError.log".
My cuddn.h is in /usr/local/cuda/include and
My cudnn.so and .a files are in /usr/local/cuda/lib64…
Do we need to provide any other option while running CMake ?
TIA
I have cuda properly placed now, had wiped it out and reinstalled it again.
So during Cmake compilation it detects libcudnn.so and says libcudnn7 or above required even though I have both libcudnn.so and libcudnn.so.8 in /cuda/lib64. To circumvent this I changed this from a fatal error to a warning in cuda.cmake and cmake runs fine.
However running make throws the error fatal error: torch/torch.h: No such file or directory #include <torch/torch.h>
What could be going wrong??.
CMakeLists.txt is -
-- Caffe2: CUDA detected: 10.2
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.2
-- Found cuDNN: v? (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- PyTorch requires cuDNN 7 and above.
-- Autodetected CUDA architecture(s): 7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Configuring done
-- Generating done
-- Build files have been written to: /home/atharva/CLionProjects/Pytorch-c++