hi,
I too got similar error, while building for comute capability 3.0. GPU= nvidia quadro k4200.
i am building in conda environment. python 3.7.6, gcc-7(default gcc is 11),
Cuda-10.2, Cudnn-7.6.5,  torch version = 1.6.0
tried to build latest version: successful but without cuda.
following all the steps carefully from GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration
i get this error:
2 errors detected in the compilation of "/tmp/tmpxft_000945f5_00000000-6_reduce_scatter.cpp1.ii".
2 errors detected in the compilation of "/tmp/tmpxft_0009460d_00000000-6_reduce_scatter.cpp1.ii".
2 errors detected in the compilation of "/tmp/tmpxft_0009460a_00000000-6_reduce_scatter.cpp1.ii".
2 errors detected in the compilation of "/tmp/tmpxft_00094622_00000000-6_reduce_scatter.cpp1.ii".
make[2]: *** [/home/jaypatel/pytorch/build/nccl/obj/collectives/device/Makefile.rules:1329: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/reduce_scatter_avg_i64.o] Error 1
make[2]: *** [/home/jaypatel/pytorch/build/nccl/obj/collectives/device/Makefile.rules:1319: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/reduce_scatter_avg_i32.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_00094624_00000000-6_reduce_scatter.cpp1.ii".
make[2]: *** [/home/jaypatel/pytorch/build/nccl/obj/collectives/device/Makefile.rules:1339: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/reduce_scatter_avg_f16.o] Error 1
make[2]: *** [/home/jaypatel/pytorch/build/nccl/obj/collectives/device/Makefile.rules:1324: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/reduce_scatter_avg_u32.o] Error 1
make[2]: *** [/home/jaypatel/pytorch/build/nccl/obj/collectives/device/Makefile.rules:1344: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/reduce_scatter_avg_f32.o] Error 1
2 errors detected in the compilation of "/tmp/tmpxft_00094628_00000000-6_reduce_scatter.cpp1.ii".
make[2]: *** [/home/jaypatel/pytorch/build/nccl/obj/collectives/device/Makefile.rules:1349: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/reduce_scatter_avg_f64.o] Error 1
make[2]: Leaving directory '/home/jaypatel/pytorch/third_party/nccl/nccl/src/collectives/device'
make[1]: *** [Makefile:50: /home/jaypatel/pytorch/build/nccl/obj/collectives/device/colldevice.a] Error 2
make[1]: Leaving directory '/home/jaypatel/pytorch/third_party/nccl/nccl/src'
make: *** [Makefile:25: src.build] Error 2
[16/4351] Building C object confu-deps/XNNPACK/CMakeFiles/XNNPACK.dir/src/f32-vbinary/gen/vaddc-minmax-avx-x16.c.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "setup.py", line 732, in <module>
    build_deps()
  File "setup.py", line 316, in build_deps
    cmake=cmake)
  File "/home/jaypatel/pytorch/tools/build_pytorch_libs.py", line 62, in build_caffe2
    cmake.build(my_env)
  File "/home/jaypatel/pytorch/tools/setup_helpers/cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "/home/jaypatel/pytorch/tools/setup_helpers/cmake.py", line 141, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/usr/local/anaconda/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '4']' returned non-zero exit status 1.

have also tried the steps mentioned above but didnt help got same error.
please help.
thanks in advance.