Repository: pytorch
Issue: [Caffe2 installation problem]
Labels: caffe2

I am trying to install Caffe2 on my Ubuntu PC but I keep getting error messages that I don't understand anything from. I have installed CUDA 8.0 and cuDNN 7.0 when I run `nvcc --version` I get

```
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
```

So everything looks like it installed there. The installation also detects the correct CUDA and cuDNN verision.

Here are the error messages I receive when running `python setup.py install` from my pytorch folder

`[ 57%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_sin_op.cu.o
[ 57%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_elementwise_linear_op.cu.o
[ 57%] Built target python_copy_files
[ 57%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_given_tensor_fill_op.cu.o
/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

1 error detected in the compilation of "/tmp/tmpxft_0000371e_00000000-7_THCCachingAllocator.cpp1.ii".
CMake Error at caffe2_gpu_generated_THCCachingAllocator.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/core/./caffe2_gpu_generated_THCCachingAllocator.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:112714: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/core/caffe2_gpu_generated_THCCachingAllocator.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/core/caffe2_gpu_generated_THCCachingAllocator.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

/home/"myname"/pytorch/caffe2/operators/elementwise_linear_op.cu(80): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/elementwise_linear_op.cu(105): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/elementwise_linear_op.cu(106): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/elementwise_linear_op.cu(118): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/utils/math_gpu.cu(3905): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/utils/math_gpu.cu(3906): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/utils/math_gpu.cu(3907): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

1 error detected in the compilation of "/tmp/tmpxft_0000371c_00000000-7_context_gpu.cpp1.ii".
/home/"myname"/pytorch/caffe2/utils/math_gpu.cu(3908): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

CMake Error at caffe2_gpu_generated_context_gpu.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/core/./caffe2_gpu_generated_context_gpu.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:113186: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/core/caffe2_gpu_generated_context_gpu.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/core/caffe2_gpu_generated_context_gpu.cu.o] Error 1
/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

/home/"myname"/pytorch/caffe2/operators/utility_ops.cu(52): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/utility_ops.cu(195): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/utility_ops.cu(226): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/utility_ops.cu(277): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/piecewise_linear_transform_op.cu(221): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/piecewise_linear_transform_op.cu(257): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

/home/"myname"/pytorch/caffe2/operators/piecewise_linear_transform_op.cu(273): warning: the "template" keyword used for syntactic disambiguation may only be used within a template

1 error detected in the compilation of "/tmp/tmpxft_00003736_00000000-7_elementwise_linear_op.cpp1.ii".
/home/"myname"/pytorch/caffe2/core/common_cudnn.h(143): error: identifier "CUDNN_DATA_INT32" is undefined

CMake Error at caffe2_gpu_generated_elementwise_linear_op.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/operators/./caffe2_gpu_generated_elementwise_linear_op.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:117489: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_elementwise_linear_op.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_elementwise_linear_op.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_0000375a_00000000-7_sin_op.cpp1.ii".
CMake Error at caffe2_gpu_generated_sin_op.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/operators/./caffe2_gpu_generated_sin_op.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:116979: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_sin_op.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_sin_op.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_0000377b_00000000-7_utility_ops.cpp1.ii".
CMake Error at caffe2_gpu_generated_utility_ops.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/operators/./caffe2_gpu_generated_utility_ops.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:116310: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_utility_ops.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_utility_ops.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_00003768_00000000-7_math_gpu.cpp1.ii".
CMake Error at caffe2_gpu_generated_math_gpu.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/utils/./caffe2_gpu_generated_math_gpu.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:114106: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_0000377a_00000000-7_piecewise_linear_transform_op.cpp1.ii".
CMake Error at caffe2_gpu_generated_piecewise_linear_transform_op.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/operators/./caffe2_gpu_generated_piecewise_linear_transform_op.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:115208: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_piecewise_linear_transform_op.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_piecewise_linear_transform_op.cu.o] Error 1
1 error detected in the compilation of "/tmp/tmpxft_00003819_00000000-7_given_tensor_fill_op.cpp1.ii".
CMake Error at caffe2_gpu_generated_given_tensor_fill_op.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/"myname"/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/operators/./caffe2_gpu_generated_given_tensor_fill_op.cu.o


caffe2/CMakeFiles/caffe2_gpu.dir/build.make:117980: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_given_tensor_fill_op.cu.o' failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/operators/caffe2_gpu_generated_given_tensor_fill_op.cu.o] Error 1
CMakeFiles/Makefile2:3734: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 libshm gloo c10d THD'`