Repository: pytorch
Issue: subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '32']' returned non-zero exit status 1.
Labels: module: build,triaged,Stale

Steps to reproduce the behavior:

> git clone --recursive https://github.com/pytorch/pytorch
> cd pytorch
> git submodule sync
> git submodule update --init --recursive
> export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
> python setup.py install
```
error:
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "setup.py", line 818, in <module>
    build_deps()
  File "setup.py", line 320, in build_deps
    cmake=cmake)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/build_pytorch_libs.py", line 58, in build_caffe2
    cmake.build(my_env)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/setup_helpers/cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/setup_helpers/cmake.py", line 140, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/home/hxz/anaconda3/envs/cluster/lib/python3.7/subprocess.py", line 328, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '32']' returned non-zero exit status 1.

log:
(cluster) hxz@ubuntu16:/home/data/hxz/Clusterd-Object_Detection/pytorch-2$ python setup.py install
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Building wheel torch-1.8.0a0+Unknown
-- Building version 1.8.0a0+Unknown
cmake --build . --target install --config Release -- -j 32
[41/390] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o
FAILED: caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o 
/usr/bin/c++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DFXDIV_USE_INLINE_ASSEMBLY=0 -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -Dtorch_cpu_EXPORTS -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2 -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/benchmark/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/contrib/aten -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/onnx -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/third_party/onnx -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/foxi -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/third_party/foxi -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/api -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/api/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/caffe2/aten/src/TH -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/aten/src/TH -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/../aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/../aten/src/ATen -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/miniz-2.0.8 -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/TH -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/../third_party/catch/single_include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/.. -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/aten/src/ATen -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/caffe2/core/nomnigraph/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/FXdiv/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/c10/.. -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/third_party/ideep/mkl-dnn/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/ideep/mkl-dnn/src/../include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/pthreadpool/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/cpuinfo/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/QNNPACK/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/native/quantized/cpu/qnnpack/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/native/quantized/cpu/qnnpack/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/cpuinfo/deps/clog/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/NNPACK/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fbgemm/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fbgemm -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fbgemm/third_party/asmjit/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/FP16/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fmt/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/googletest/googlemock/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/googletest/googletest/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/protobuf/src -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/gemmlowp -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/neon2sse -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/XNNPACK/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/eigen -isystem /home/hxz/anaconda3/envs/cluster/include/python3.7m -isystem /home/hxz/anaconda3/envs/cluster/lib/python3.7/site-packages/numpy/core/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/pybind11/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/ideep/mkl-dnn/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/ideep/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/include -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -fPIC -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-missing-braces -Wno-maybe-uninitialized -fvisibility=hidden -O2 -fopenmp -DCAFFE2_BUILD_MAIN_LIB -pthread -DASMJIT_STATIC -std=gnu++14 -MD -MT caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o -MF caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o.d -o caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o -c /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp: In member function ‘bool torch::jit::Node::hasSideEffects() const’:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1083:10: error: ‘set_stream’ is not a member of ‘torch::jit::cuda’
     case cuda::set_stream:
          ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1083:10: note: suggested alternatives:
In file included from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/Dimname.h:3:0,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/NamedTensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src/ATen/core/TensorBody.h:22,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Tensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Context.h:4,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/ATen.h:9,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/attributes.h:2,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:289:11: note:   ‘c10::cuda::set_stream’
   _(cuda, set_stream)                \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:289:11: note:   ‘c10::cuda::set_stream’
   _(cuda, set_stream)                \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1084:10: error: ‘_set_device’ is not a member of ‘torch::jit::cuda’
     case cuda::_set_device:
          ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1084:10: note: suggested alternatives:
In file included from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/Dimname.h:3:0,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/NamedTensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src/ATen/core/TensorBody.h:22,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Tensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Context.h:4,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/ATen.h:9,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/attributes.h:2,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:288:11: note:   ‘c10::cuda::_set_device’
   _(cuda, _set_device)               \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:288:11: note:   ‘c10::cuda::_set_device’
   _(cuda, _set_device)               \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1085:10: error: ‘_current_device’ is not a member of ‘torch::jit::cuda’
     case cuda::_current_device:
          ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1085:10: note: suggested alternatives:
In file included from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/Dimname.h:3:0,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/NamedTensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src/ATen/core/TensorBody.h:22,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Tensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Context.h:4,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/ATen.h:9,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/attributes.h:2,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:290:11: note:   ‘c10::cuda::_current_device’
   _(cuda, _current_device)           \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:290:11: note:   ‘c10::cuda::_current_device’
   _(cuda, _current_device)           \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
[72/390] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/autograd/generated/TraceType_1.cpp.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "setup.py", line 818, in <module>
    build_deps()
  File "setup.py", line 320, in build_deps
    cmake=cmake)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/build_pytorch_libs.py", line 58, in build_caffe2
    cmake.build(my_env)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/setup_helpers/cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/setup_helpers/cmake.py", line 140, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/home/hxz/anaconda3/envs/cluster/lib/python3.7/subprocess.py", line 328, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '32']' returned non-zero exit status 1.
(cluster) hxz@ubuntu16:/home/data/hxz/Clusterd-Object_Detection/pytorch-2$ USE_DISTRIBUTED=0 python setup.py install
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Building wheel torch-1.8.0a0+Unknown
-- Building version 1.8.0a0+Unknown
cmake --build . --target install --config Release -- -j 32
[15/319] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o
FAILED: caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o 
/usr/bin/c++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DFXDIV_USE_INLINE_ASSEMBLY=0 -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -Dtorch_cpu_EXPORTS -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2 -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/benchmark/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/contrib/aten -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/onnx -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/third_party/onnx -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/foxi -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/third_party/foxi -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/api -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/api/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/caffe2/aten/src/TH -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/aten/src/TH -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/../aten/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/../aten/src/ATen -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/miniz-2.0.8 -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/TH -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/../third_party/catch/single_include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/.. -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/caffe2/aten/src/ATen -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/caffe2/core/nomnigraph/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/FXdiv/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/c10/.. -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/third_party/ideep/mkl-dnn/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/ideep/mkl-dnn/src/../include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/pthreadpool/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/cpuinfo/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/QNNPACK/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/native/quantized/cpu/qnnpack/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/native/quantized/cpu/qnnpack/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/cpuinfo/deps/clog/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/NNPACK/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fbgemm/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fbgemm -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fbgemm/third_party/asmjit/src -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/FP16/include -I/home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/fmt/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/googletest/googlemock/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/googletest/googletest/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/protobuf/src -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/gemmlowp -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/neon2sse -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/XNNPACK/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/eigen -isystem /home/hxz/anaconda3/envs/cluster/include/python3.7m -isystem /home/hxz/anaconda3/envs/cluster/lib/python3.7/site-packages/numpy/core/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/cmake/../third_party/pybind11/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/ideep/mkl-dnn/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/third_party/ideep/include -isystem /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/include -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -fPIC -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-missing-braces -Wno-maybe-uninitialized -fvisibility=hidden -O2 -fopenmp -DCAFFE2_BUILD_MAIN_LIB -pthread -DASMJIT_STATIC -std=gnu++14 -MD -MT caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o -MF caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o.d -o caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/ir/ir.cpp.o -c /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp: In member function ‘bool torch::jit::Node::hasSideEffects() const’:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1083:10: error: ‘set_stream’ is not a member of ‘torch::jit::cuda’
     case cuda::set_stream:
          ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1083:10: note: suggested alternatives:
In file included from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/Dimname.h:3:0,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/NamedTensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src/ATen/core/TensorBody.h:22,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Tensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Context.h:4,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/ATen.h:9,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/attributes.h:2,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:289:11: note:   ‘c10::cuda::set_stream’
   _(cuda, set_stream)                \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:289:11: note:   ‘c10::cuda::set_stream’
   _(cuda, set_stream)                \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1084:10: error: ‘_set_device’ is not a member of ‘torch::jit::cuda’
     case cuda::_set_device:
          ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1084:10: note: suggested alternatives:
In file included from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/Dimname.h:3:0,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/NamedTensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src/ATen/core/TensorBody.h:22,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Tensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Context.h:4,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/ATen.h:9,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/attributes.h:2,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:288:11: note:   ‘c10::cuda::_set_device’
   _(cuda, _set_device)               \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:288:11: note:   ‘c10::cuda::_set_device’
   _(cuda, _set_device)               \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1085:10: error: ‘_current_device’ is not a member of ‘torch::jit::cuda’
     case cuda::_current_device:
          ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1085:10: note: suggested alternatives:
In file included from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/Dimname.h:3:0,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/NamedTensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/build/aten/src/ATen/core/TensorBody.h:22,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Tensor.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/Context.h:4,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/ATen.h:9,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/attributes.h:2,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.h:3,
                 from /home/data/hxz/Clusterd-Object_Detection/pytorch-2/torch/csrc/jit/ir/ir.cpp:1:
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:290:11: note:   ‘c10::cuda::_current_device’
   _(cuda, _current_device)           \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:290:11: note:   ‘c10::cuda::_current_device’
   _(cuda, _current_device)           \
           ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:529:35: note: in definition of macro ‘DEFINE_SYMBOL’
   namespace ns { constexpr Symbol s(static_cast<unique_t>(_keys::ns##_##s)); }
                                   ^
/home/data/hxz/Clusterd-Object_Detection/pytorch-2/aten/src/ATen/core/interned_strings.h:530:1: note: in expansion of macro ‘FORALL_NS_SYMBOLS’
 FORALL_NS_SYMBOLS(DEFINE_SYMBOL)
 ^
[46/319] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/passes/quantization/insert_observers.cpp.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "setup.py", line 818, in <module>
    build_deps()
  File "setup.py", line 320, in build_deps
    cmake=cmake)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/build_pytorch_libs.py", line 58, in build_caffe2
    cmake.build(my_env)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/setup_helpers/cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "/home/data/hxz/Clusterd-Object_Detection/pytorch-2/tools/setup_helpers/cmake.py", line 140, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/home/hxz/anaconda3/envs/cluster/lib/python3.7/subprocess.py", line 328, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '32']' returned non-zero exit status 1.
```

Does anybody know how to deal with it?

cc @malfet @seemethere