<p dir="auto">Editorial note: There were multiple reports in this issue; the intrin.h problem is reported further below.</p>
<hr>
<h2 dir="auto">Issue description</h2>
<p dir="auto">running install<br>
running build_deps</p>
<ul dir="auto">
<li>USE_CUDA=0</li>
<li>USE_ROCM=0</li>
<li>USE_NNPACK=0</li>
</ul>
<p dir="auto">......</p>
<p dir="auto">-- Found CUDA: /usr/local/cuda-8.0 (found suitable version "8.0", minimum required is "7.0")<br>
-- Automatic GPU detection failed. Building for common architectures.<br>
-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;6.0;6.1;6.1+PTX<br>
-- 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<br>
-- Configuring done<br>
-- Generating done<br>
-- Build files have been written to: /media/hh/pytorch_dir/pytorch/third_party/build/nccl</p>
<ul dir="auto">
<li>make install<br>
Scanning dependencies of target nccl<br>
[100%] Generating lib/libnccl.so<br>
Grabbing  src/nccl.h                          &gt; /media/hh/pytorch_dir/pytorch/third_party/build/nccl/include/nccl.h<br>
Compiling src/libwrap.cu                      &gt; /media/hh/pytorch_dir/pytorch/third_party/build/nccl/obj/libwrap.o<br>
nvcc fatal   : redefinition of keyword 'code'<br>
make[3]: *** [/media/hh/pytorch_dir/pytorch/third_party/build/nccl/obj/libwrap.o] Error 1<br>
make[3]: INTERNAL: Exiting with 9 jobserver tokens available; should be 8!<br>
make[2]: *** [lib/libnccl.so] Error 2<br>
make[1]: *** [CMakeFiles/nccl.dir/all] Error 2<br>
make: *** [all] Error 2<br>
Failed to run 'bash tools/build_pytorch_libs.sh --use-cuda --use-nnpack --use-mkldnn nccl caffe2 nanopb libshm gloo THD c10d'</li>
</ul>
<h2 dir="auto">Code example</h2>
<p dir="auto">python setup.py install</p>
<h2 dir="auto">System Info</h2>
<ul dir="auto">
<li>PyTorch or Caffe2:PyTorch</li>
<li>How you installed PyTorch (conda, pip, source): source</li>
<li>Build command you used (if compiling from source):python setup.py install</li>
<li>OS:ubuntu14.04</li>
<li>PyTorch version:master</li>
<li>Python version:3.6</li>
<li>CUDA/cuDNN version:8.0</li>
<li>GPU models and configuration:GTX1080Ti</li>
<li>GCC version (if compiling from source):4.9.2</li>
<li>CMake version:3.7.2</li>
<li>Versions of any other relevant libraries:</li>
</ul>
<p dir="auto">Steps to reproduce:</p>
<ol dir="auto">
<li>Get a CI CUDA docker image, e.g., <code class="notranslate">30853 5385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda9-cudnn7-py3:218</code></li>
<li>Clone PyTorch, and run <code class="notranslate">python setup.py build_deps develop</code></li>
</ol>
<p dir="auto">Expected result: It works</p>
<p dir="auto">Actual result:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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                          &gt; /var/lib/jenkins/pytorch-1/third_party/build/nccl/include/nccl.h
Compiling src/libwrap.cu                      &gt; /var/lib/jenkins/pytorch-1/third_party/build/nccl/obj/libwrap.o
Compiling src/core.cu                         &gt; /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...."><pre class="notranslate"><code class="notranslate">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                          &gt; /var/lib/jenkins/pytorch-1/third_party/build/nccl/include/nccl.h
Compiling src/libwrap.cu                      &gt; /var/lib/jenkins/pytorch-1/third_party/build/nccl/obj/libwrap.o
Compiling src/core.cu                         &gt; /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....
</code></pre></div>
<p dir="auto">Workaround: set <code class="notranslate">TORCH_CUDA_ARCH_LIST=5.2</code> forces only one <code class="notranslate">-gencode</code> to be passed.</p>