Issue 1:
I tried to install caffe2 by following this link "https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile "

Every step was sucesfully compiled , but unfortunately while compiling the last command

**sudo make install

I am getting the following ### output/error :

Scanning dependencies of target python_copy_files

[ 72%] Built target python_copy_files

[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o

[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o

In file included from /usr/local/cuda/include/common_functions.h:50:0,

from /usr/local/cuda/include/cuda_runtime.h:115,

from :0:

/usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""CUDACC_VER is no longer supported. Use CUDACC_VER_MAJOR, CUDACC_VER_MINOR, and CUDACC_VER_BUILD instead."" is not valid in preprocessor expressions

#define CUDACC_VER "CUDACC_VER is no longer supported. Use CUDACC_VER_MAJOR, CUDACC_VER_MINOR, and CUDACC_VER_BUILD instead."

^

/usr/include/eigen3/Eigen/src/Core/util/Macros.h:364:33: note: in expansion of macro ‘CUDACC_VER’

#if defined(CUDACC_VER) && CUDACC_VER >= 70500 && __cplusplus > 199711L

^

CMake Error at caffe2_gpu_generated_math_gpu.cu.o.Release.cmake:219 (message):

Error generating

/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/utils/./caffe2_gpu_generated_math_gpu.cu.o

caffe2/CMakeFiles/caffe2_gpu.dir/build.make:63: 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

CMakeFiles/Makefile2:1456: 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

python collect_env.py

Collecting environment information...

PyTorch version: 0.4.0

Is debug build: No

CUDA used to build PyTorch: 8.0.61

OS: Ubuntu 16.04.4 LTS

GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

CMake version: version 3.5.1

Python version: 2.7

Is CUDA available: Yes

CUDA runtime version: 9.0.252

GPU models and configuration: GPU 0: Quadro M2000M

Nvidia driver version: 384.130

cuDNN version: Probably one of the following:

/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.4

/usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a

Versions of relevant libraries:

[pip] numpy (1.11.0)

[pip] torch (0.4.0)

[conda] Could not collect

Issue 2:
### Installation guide followed -

https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile

Error Output

Scanning dependencies of target python_copy_files

[ 72%] Built target python_copy_files

[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o

[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o

In file included from /usr/local/cuda/include/common_functions.h:50:0,

from /usr/local/cuda/include/cuda_runtime.h:115,

from :0:

/usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""CUDACC_VER is no longer supported. Use CUDACC_VER_MAJOR, CUDACC_VER_MINOR, and CUDACC_VER_BUILD instead."" is not valid in preprocessor expressions

#define CUDACC_VER "CUDACC_VER is no longer supported. Use CUDACC_VER_MAJOR, CUDACC_VER_MINOR, and CUDACC_VER_BUILD instead."

^

/usr/include/eigen3/Eigen/src/Core/util/Macros.h:364:33: note: in expansion of macro ‘CUDACC_VER’

#if defined(CUDACC_VER) && CUDACC_VER >= 70500 && __cplusplus > 199711L

^

CMake Error at caffe2_gpu_generated_math_gpu.cu.o.Release.cmake:219 (message):

Error generating

/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/utils/./caffe2_gpu_generated_math_gpu.cu.o

caffe2/CMakeFiles/caffe2_gpu.dir/build.make:63: 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

CMakeFiles/Makefile2:1456: 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

Issue description

Error during running the command

$ sudo make install

Code example

output of cmake ..

Does not need to define long separately.

-- std::exception_ptr is supported.

-- NUMA is available

-- Current compiler supports avx2 extention. Will build perfkernels.

-- Building using own protobuf under third_party per request.

-- Use custom protobuf build.

-- Caffe2 protobuf include directory: $&lt;BUILD_INTERFACE:/home/rv/pytorch/third_party/protobuf/src&gt;$&lt;INSTALL_INTERFACE:include>

-- The BLAS backend of choice:Eigen

-- Brace yourself, we are building NNPACK

-- Found PythonInterp: /usr/bin/python (found version "2.7.12")

-- Caffe2: Cannot find gflags automatically. Using legacy find.

-- Caffe2: Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)

-- Caffe2: Cannot find glog automatically. Using legacy find.

-- Caffe2: Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)

-- Found lmdb (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)

-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)

-- Found Snappy (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)

-- Found Numa (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnuma.so)

-- OpenCV found (/usr/share/OpenCV)

-- Found system Eigen at /usr/include/eigen3

-- Found PythonInterp: /usr/bin/python (found suitable version "2.7.12", minimum required is "2.7")

-- NumPy ver. 1.11.0 found (include: /usr/lib/python2.7/dist-packages/numpy/core/include)

-- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)

-- MPI support found

-- MPI compile flags:

-- MPI include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi

-- MPI LINK flags path: -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags

-- MPI libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so

CMake Warning at cmake/Dependencies.cmake:376 (message):

OpenMPI found, but it is not built with CUDA support.

Call Stack (most recent call first):

CMakeLists.txt:181 (include)

-- 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

-- Found cuDNN: v7.1.4 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)

-- Autodetected CUDA architecture(s): 5.0

-- Added CUDA NVCC flags for: -gencode;arch=compute_50,code=sm_50

-- Could NOT find NCCL (missing: NCCL_INCLUDE_DIRS NCCL_LIBRARIES)

-- Could NOT find CUB (missing: CUB_INCLUDE_DIR)

-- Could NOT find Gloo (missing: Gloo_INCLUDE_DIR Gloo_LIBRARY)

-- MPI include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi

-- MPI libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so

-- CUDA detected: 9.0

-- Found libcuda: /usr/local/cuda-9.0/lib64/stubs/libcuda.so

-- Found libnvrtc: /usr/local/cuda-9.0/lib64/libnvrtc.so

-- Could NOT find NCCL (missing: NCCL_INCLUDE_DIR NCCL_LIBRARY)

CMake Warning at third_party/gloo/cmake/Dependencies.cmake:62 (message):

Not compiling with NCCL support. Suppress this warning with

-DUSE_NCCL=OFF.

Call Stack (most recent call first):

third_party/gloo/CMakeLists.txt:56 (include)

-- GCC 5.4.0: Adding gcc and gcc_s libs to link line

-- Include NCCL operators

-- Excluding ideep operators as we are not using ideep

-- Including image processing operators

-- Excluding video processing operators due to no opencv

-- Excluding mkl operators as we are not using mkl

-- Include Observer library

CMake Error at cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:497 (file):

file failed to open for writing (Permission denied):

/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o.depend

Call Stack (most recent call first):

cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:1595 (cuda_include_nvcc_dependencies)

cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:1827 (CUDA_WRAP_SRCS)

cmake/public/utils.cmake:134 (cuda_add_library)

caffe2/CMakeLists.txt:230 (torch_cuda_based_add_library)

-- Using lib/python2.7/dist-packages as python relative installation path

-- Automatically generating missing init.py files.

-- A previous caffe2 cmake run already created the init.py files.

CMake Warning at CMakeLists.txt:341 (message):

Generated cmake files are only fully tested if one builds with system glog,

gflags, and protobuf. Other settings may generate files that are not well

tested.

--

-- ******** Summary ********

-- General:

-- CMake version : 3.5.1

-- CMake command : /usr/bin/cmake

-- Git version : v0.1.11-9191-g08daed4

-- System : Linux

-- C++ compiler : /usr/bin/c++

-- C++ compiler version : 5.4.0

-- BLAS : Eigen

-- CXX flags : -fvisibility-inlines-hidden -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-error=deprecated-declarations

-- Build type : Release

-- Compile definitions :

-- CMAKE_PREFIX_PATH :

-- CMAKE_INSTALL_PREFIX : /usr/local

-- BUILD_CAFFE2 : ON

-- BUILD_ATEN : OFF

-- BUILD_BINARY : ON

-- BUILD_CUSTOM_PROTOBUF : ON

-- Link local protobuf : ON

-- BUILD_DOCS : OFF

-- BUILD_PYTHON : ON

-- Python version : 2.7.12

-- Python includes : /usr/include/python2.7

-- BUILD_SHARED_LIBS : ON

-- BUILD_TEST : OFF

-- USE_ASAN : OFF

-- USE_ATEN : OFF

-- USE_CUDA : ON

-- CUDA static link : OFF

-- USE_CUDNN : ON

-- CUDA version : 9.0

-- cuDNN version : 7.1.4

-- CUDA root directory : /usr/local/cuda

-- CUDA library : /usr/local/cuda-9.0/lib64/stubs/libcuda.so

-- cudart library : /usr/local/cuda/lib64/libcudart_static.a;-pthread;dl;/usr/lib/x86_64-linux-gnu/librt.so

-- cublas library : /usr/local/cuda/lib64/libcublas.so;/usr/local/cuda/lib64/libcublas_device.a

-- cufft library : /usr/local/cuda/lib64/libcufft.so

-- curand library : /usr/local/cuda/lib64/libcurand.so

-- cuDNN library : /usr/lib/x86_64-linux-gnu/libcudnn.so

-- nvrtc : /usr/local/cuda-9.0/lib64/libnvrtc.so

-- CUDA include path : /usr/local/cuda/include

-- NVCC executable : /usr/local/cuda/bin/nvcc

-- CUDA host compiler : /usr/bin/cc

-- USE_TENSORRT : OFF

-- USE_ROCM : OFF

-- USE_EIGEN_FOR_BLAS : ON

-- USE_FFMPEG : OFF

-- USE_GFLAGS : ON

-- USE_GLOG : ON

-- USE_GLOO : ON

-- USE_GLOO_IBVERBS : OFF

-- USE_LEVELDB : ON

-- LevelDB version : 1.18

-- Snappy version : 1.1.3

-- USE_LITE_PROTO : OFF

-- USE_LMDB : ON

-- LMDB version : 0.9.17

-- USE_METAL : OFF

-- USE_MKL :

-- USE_MOBILE_OPENGL : OFF

-- USE_MPI : ON

-- USE_NCCL : ON

-- USE_SYSTEM_NCCL : OFF

-- USE_NERVANA_GPU : OFF

-- USE_NNPACK : ON

-- USE_OBSERVERS : ON

-- USE_OPENCL : OFF

-- USE_OPENCV : ON

-- OpenCV version : 3.3.1

-- USE_OPENMP : OFF

-- USE_PROF : OFF

-- USE_REDIS : OFF

-- USE_ROCKSDB : OFF

-- USE_ZMQ : OFF

-- Public Dependencies : Threads::Threads;gflags;glog::glog

-- Private Dependencies : nnpack;cpuinfo;/usr/lib/x86_64-linux-gnu/liblmdb.so;/usr/lib/x86_64-linux-gnu/libleveldb.so;/usr/lib/x86_64-linux-gnu/libsnappy.so;/usr/lib/x86_64-linux-gnu/libnuma.so;opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;opencv_videoio;opencv_video;/usr/lib/openmpi/lib/libmpi_cxx.so;/usr/lib/openmpi/lib/libmpi.so;gloo;onnxifi_loader;gcc_s;gcc;dl

-- Configuring incomplete, errors occurred!

See also "/home/rv/pytorch/build/CMakeFiles/CMakeOutput.log".

See also "/home/rv/pytorch/build/CMakeFiles/CMakeError.log".

System Info