Issue 1:
Editorial note: There were multiple reports in this issue; the intrin.h problem is reported further below.

Issue description

running install

running build_deps

USE_CUDA=0

USE_ROCM=0

USE_NNPACK=0

......

-- Found CUDA: /usr/local/cuda-8.0 (found suitable version "8.0", minimum required is "7.0")

-- Automatic GPU detection failed. Building for common architectures.

-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;6.0;6.1;6.1+PTX

-- Set NVCC_GENCODE for building NCCL: -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_61,code=compute_61

-- Configuring done

-- Generating done

-- Build files have been written to: /media/hh/pytorch_dir/pytorch/third_party/build/nccl

make install

Scanning dependencies of target nccl

[100%] Generating lib/libnccl.so

Grabbing src/nccl.h > /media/hh/pytorch_dir/pytorch/third_party/build/nccl/include/nccl.h

Compiling src/libwrap.cu > /media/hh/pytorch_dir/pytorch/third_party/build/nccl/obj/libwrap.o

nvcc fatal : redefinition of keyword 'code'

make[3]: *** [/media/hh/pytorch_dir/pytorch/third_party/build/nccl/obj/libwrap.o] Error 1

make[3]: INTERNAL: Exiting with 9 jobserver tokens available; should be 8!

make[2]: *** [lib/libnccl.so] Error 2

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

make: *** [all] Error 2

Failed to run 'bash tools/build_pytorch_libs.sh --use-cuda --use-nnpack --use-mkldnn nccl caffe2 nanopb libshm gloo THD c10d'

Code example

python setup.py install

System Info

PyTorch or Caffe2:PyTorch

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

Build command you used (if compiling from source):python setup.py install

OS:ubuntu14.04

PyTorch version:master

Python version:3.6

CUDA/cuDNN version:8.0

GPU models and configuration:GTX1080Ti

GCC version (if compiling from source):4.9.2

CMake version:3.7.2

Versions of any other relevant libraries:

Issue 2:
Steps to reproduce:

Get a CI CUDA docker image, e.g., 30853 5385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9-cudnn7-py3:218

Clone PyTorch, and run python setup.py build_deps develop

Expected result: It works

Actual result:

CMake Warning at /var/lib/jenkins/pytorch-1/cmake/public/utils.cmake:148 (message):
In the future we will require one to explicitly pass TORCH_CUDA_ARCH_LIST
to cmake instead of implicitly setting it as an env variable. This will
become a FATAL_ERROR in future version of pytorch.
Call Stack (most recent call first):
CMakeLists.txt:9 (torch_cuda_get_nvcc_gencode_flag)

INFOSet NVCC_GENCODE for building NCCL: -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_52,code=sm_52
-- Configuring done
-- Generating done
-- Build files have been written to: /var/lib/jenkins/pytorch-1/third_party/build/nccl
+ make install
Scanning dependencies of target nccl
[100%] Generating lib/libnccl.so
Grabbing src/nccl.h > /var/lib/jenkins/pytorch-1/third_party/build/nccl/include/nccl.h
Compiling src/libwrap.cu > /var/lib/jenkins/pytorch-1/third_party/build/nccl/obj/libwrap.o
Compiling src/core.cu > /var/lib/jenkins/pytorch-1/third_party/build/nccl/obj/core.o
nvcc fatal : redefinition of keyword 'code'
Makefile:136: recipe for target '/var/lib/jenkins/pytorch-1/third_party/build/nccl/obj/libwrap.o' failed
make[3]: *** [/var/lib/jenkins/pytorch-1/third_party/build/nccl/obj/libwrap.o] Error 1
make[3]: *** Waiting for unfinished jobs....

Workaround: set TORCH_CUDA_ARCH_LIST=5.2 forces only one -gencode to be passed.