Issue 1:
I cannot install Caffe2 on Nvidia TX2 because of such error:

Scanning dependencies of target operator_fallback_gpu_test

[ 80%] Building CXX object caffe2/CMakeFiles/operator_fallback_gpu_test.dir/operators/operator_fallback_gpu_ test.cc.o

[ 80%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state.cc.o

[ 80%] Building CXX object caffe2/CMakeFiles/reshape_op_gpu_test.dir/operators/reshape_op_gpu_test.cc.o

[ 80%] Building CXX object caffe2/CMakeFiles/elementwise_op_gpu_test.dir/operators/elementwise_op_gpu_test.c c.o

[ 80%] Linking CXX executable ../bin/reshape_op_gpu_test

../lib/libcaffe2_gpu.so: undefined reference to void caffe2::math::BiasCHW<float, caffe2::CUDAContext>(floa t const*, int, int, float*, caffe2::CUDAContext*)' collect2: error: ld returned 1 exit status caffe2/CMakeFiles/reshape_op_gpu_test.dir/build.make:109: recipe for target 'bin/reshape_op_gpu_test' failed make[2]: *** [bin/reshape_op_gpu_test] Error 1 CMakeFiles/Makefile2:1587: recipe for target 'caffe2/CMakeFiles/reshape_op_gpu_test.dir/all' failed make[1]: *** [caffe2/CMakeFiles/reshape_op_gpu_test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 80%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state_dlpack.cc.o [ 80%] Linking CXX executable ../bin/operator_fallback_gpu_test ../lib/libcaffe2_gpu.so: undefined reference to void caffe2::math::BiasCHW<float, caffe2::CUDAContext>(floa t const*, int, int, float*, caffe2::CUDAContext*)'

collect2: error: ld returned 1 exit status

caffe2/CMakeFiles/operator_fallback_gpu_test.dir/build.make:109: recipe for target 'bin/operator_fallback_gp u_test' failed

make[2]: *** [bin/operator_fallback_gpu_test] Error 1

CMakeFiles/Makefile2:1671: recipe for target 'caffe2/CMakeFiles/operator_fallback_gpu_test.dir/all' failed

make[1]: *** [caffe2/CMakeFiles/operator_fallback_gpu_test.dir/all] Error 2

[ 80%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state_gpu.cc.o

[ 80%] Linking CXX executable ../bin/elementwise_op_gpu_test

../lib/libcaffe2_gpu.so: undefined reference to `void caffe2::math::BiasCHW<float, caffe2::CUDAContext>(floa t const*, int, int, float*, caffe2::CUDAContext*)'

collect2: error: ld returned 1 exit status

caffe2/CMakeFiles/elementwise_op_gpu_test.dir/build.make:109: recipe for target 'bin/elementwise_op_gpu_test ' failed

make[2]: *** [bin/elementwise_op_gpu_test] Error 1

CMakeFiles/Makefile2:1629: recipe for target 'caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all' failed

make[1]: *** [caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all] Error 2

[ 80%] Linking CXX shared module python/caffe2_pybind11_state_gpu.so

[ 80%] Built target caffe2_pybind11_state_gpu

Makefile:138: recipe for target 'all' failed

make: *** [all] Error 2

Would someone give me any help? I have been stuck on installation for a long time!

PyTorch or Caffe2: C2

How you installed PyTorch (conda, pip, source): source

Build command you used (if compiling from source): ./build_tegra_x1.sh

OS: Ubuntu 16.04

PyTorch version:

Python version: 2.7

CUDA/cuDNN version: cuda9.0 cudnn7.0.5

GPU models and configuration: Nvidia TX2

GCC version (if compiling from source): gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

CMake version: 3.5.1

Versions of any other relevant libraries:

Issue 2:
🐛 Bug

PyTorch fails to finish building, with a possible bug (see below).

Scanning dependencies of target caffe2_observers
[ 92%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/data_channels/DataChannelTCP.cpp.o
[ 93%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/net_observer_reporter_print.cc.o
�[91m/opt/pytorch/torch/lib/c10d/ProcessGroupMPI.cpp: In destructor ‘virtual c10d::ProcessGroupMPI::AsyncWork::~AsyncWork()’:
/opt/pytorch/torch/lib/c10d/ProcessGroupMPI.cpp:154:71: error: throw will always call terminate() [-Werror=terminate]
"Attempted destruction of AsyncWork before work has completed");
^
/opt/pytorch/torch/lib/c10d/ProcessGroupMPI.cpp:154:71: note: in C++11 destructors default to noexcept
�[0m[ 93%] Building CXX object caffe2/torch/CMakeFiles/torch.dir/csrc/autograd/function.cpp.o
[ 93%] Building CXX object caffe2/torch/CMakeFiles/torch.dir/csrc/autograd/functions/accumulate_grad.cpp.o
[ 93%] Building CXX object modules/detectron/CMakeFiles/caffe2_detectron_ops.dir/ps_roi_pool_op.cc.o
[ 93%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/observer_config.cc.o
�[91mcc1plus: all warnings being treated as errors
�[0m�[91mmake[2]: *** [caffe2/torch/lib/c10d/CMakeFiles/c10d.dir/ProcessGroupMPI.cpp.o] Error 1
�[0m�[91mmake[2]: *** Waiting for unfinished jobs....
�[0mcaffe2/torch/lib/c10d/CMakeFiles/c10d.dir/build.make:230: recipe for target 'caffe2/torch/lib/c10d/CMakeFiles/c10d.dir/ProcessGroupMPI.cpp.o' failed
[ 93%] Building CXX object caffe2/torch/CMakeFiles/torch.dir/csrc/autograd/functions/basic_ops.cpp.o
[ 93%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethod.cpp.o
[ 93%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/perf_observer.cc.o
[ 93%] Building CXX object modules/detectron/CMakeFiles/caffe2_detectron_ops.dir/roi_pool_f_op.cc.o
[ 93%] Building CXX object modules/detectron/CMakeFiles/caffe2_detectron_ops.dir/sample_as_op.cc.o
[ 93%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/init_methods/InitMethodEnv.cpp.o
[ 93%] Building CXX object caffe2/torch/CMakeFiles/torch.dir/csrc/autograd/functions/comm.cpp.o
[ 93%] Building CXX object modules/detectron/CMakeFiles/caffe2_detectron_ops.dir/select_smooth_l1_loss_op.cc.o
[ 93%] Building CXX object caffe2/torch/CMakeFiles/torch.dir/csrc/autograd/functions/tensor.cpp.o
CMakeFiles/Makefile2:7496: recipe for target 'caffe2/torch/lib/c10d/CMakeFiles/c10d.dir/all' failed
�[91mmake[1]: *** [caffe2/torch/lib/c10d/CMakeFiles/c10d.dir/all] Error 2
�[0m�[91mmake[1]: *** Waiting for unfinished jobs....
...
...
...
[ 99%] Linking CXX shared library ../../lib/libtorch.so
[ 99%] Built target torch
Makefile:138: recipe for target 'all' failed
�[91mmake: *** [all] Error 2
�[0msetup.py::build_deps::run()
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-fbgemm --use-nnpack --use-mkldnn --use-qnnpack caffe2'

To Reproduce

cd /opt && git clone --recursive https://github.com/pytorch/pytorch \
&& cd pytorch && git submodule update --init && \
cd /opt/pytorch/third_party/ideep/mkl-dnn && \
git pull https://github.com/intel/mkl-dnn.git --no-commit --rebase && \
cd /opt/pytorch && \
sed -i 's/"Use MKLDNN" OFF/"Use MKLDNN" ON /g' CMakeLists.txt && \
sed -i 's/"Use DISTRIBUTED" OFF/"Use DISTRIBUTED" ON /g' CMakeLists.txt && \
sed -i 's/for parallel code" OFF/for parallel code" ON /g' CMakeLists.txt && \
PYTHON_EXECUTABLE=/opt/conda/bin/python \
PYTHON_LIBRARY=/opt/conda/lib/libpython3.6m.so \
PYTHON_INCLUDE_DIR=/opt/conda/include/python3.6m \
FULL_CAFFE2=1 \
USE_OPENMP=1 \
USE_MKL=1 \
USE_MKLDNN=1 \
USE_MKLML=1 \
USE_SYSTEM_EIGEN_INSTALL=1 \
USE_ZMQ=1 \
USE_DISTRIBUTED=1 \
MKLDNN_LIBRARY=/usr/local/lib \
MKLDNN_INCLUDE_DIR=/usr/local/include \
MKLDNN_LIB_DIR=/usr/local/lib \
python setup.py install && \
cd /opt && rm -rf /opt/pytorch && \
cd /usr/lib && sudo ldconfig

Environment

PyTorch Version (e.g., 1.0): Master branch (1.0)

OS (e.g., Linux): Debian:Stretch

How you installed PyTorch (conda, pip, source): source

Build command you used (if compiling from source): see above

Python version: 3.6

CUDA/cuDNN version: N/A

GPU models and configuration: N/A

Any other relevant information: N/A

Additional context