Repository: pytorch
Issue: [caffe2] build from source, cannot find my cudnn7.1
Labels: caffe2

I am building pytorch from source.  My cudnn version is 7.1,  however, it seems that caffe2 cannot succeed to use this verion of cudnn 7.1, but found a low version 5 instead. 
 errors like below: 
```
[ 87%] Building CXX object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/CUDAReduceOps.cpp.o
[ 87%] Building CXX object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/CUDACharStorage.cpp.o
[ 87%] Building CXX object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/CUDAByteStorage.cpp.o
[ 87%] Building CXX object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/CUDAByteTensor.cpp.o
In file included from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/Exceptions.h:3:0,
                 from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/Descriptors.h:3,
                 from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/native/cudnn/BatchNorm.cpp:31:
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:10:2: error: #error "CuDNN version not supported"
 #error "CuDNN version not supported"
  ^
In file included from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/native/cudnn/RNN.cpp:58:0:
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:10:2: error: #error "CuDNN version not supported"
 #error "CuDNN version not supported"
  ^
In file included from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/Exceptions.h:3:0,
                 from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/Descriptors.h:3,
                 from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/native/cudnn/GridSampler.cpp:27:
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:10:2: error: #error "CuDNN version not supported"
 #error "CuDNN version not supported"
  ^
In file included from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cuda/detail/CUDAHooks.cpp:11:0:
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:10:2: error: #error "CuDNN version not supported"
 #error "CuDNN version not supported"

```
and  
```
n file included from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/Exceptions.h:3:0,
                 from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/Descriptors.h:3,
                 from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/native/cudnn/BatchNorm.cpp:31:
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:9:198: note: #pragma message: CuDNN v5 found, but need
 at least CuDNN v6. You can get the latest version of CuDNN from https://developer.nvidia.com/cudnn or disable CuDNN with NO_CUDNN=1
 #pragma message ("CuDNN v" STRING(CUDNN_MAJOR) " found, but need at least CuDNN v6. You can get the latest version of CuDNN from https
://developer.nvidia.com/cudnn or disable CuDNN with NO_CUDNN=1")

                                                               ^
In file included from /home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/native/cudnn/AffineGridGenerator.cpp:28:0:
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:9:198: note: #pragma message: CuDNN v5 found, but need
 at least CuDNN v6. You can get the latest version of CuDNN from https://developer.nvidia.com/cudnn or disable CuDNN with NO_CUDNN=1
  at least CuDNN v6. You can get the latest version of CuDNN from https://developer.nvidia.com/cudnn or disable CuDNN with NO_CUDNN=1")
                                                                                                                                      ^
/home/hxw/Ananaconda_Pytorch_Related/pytorch/aten/src/ATen/cudnn/cudnn-wrapper.h:9:198: note: #pragma message: CuDNN v5 found, but need
 at least CuDNN v6. You can get the latest version of CuDNN from https://developer.nvidia.com/cudnn or disable CuDNN with NO_CUDNN=1
 #pragma message ("CuDNN v" STRING(CUDNN_MAJOR) " found, but need at least CuDNN v6. You can get the latest version of CuDNN from https
://developer.nvidia.com/cudnn or disable CuDNN with NO_CUDNN=1")

```

does anyone know how to solve this problem.