<h2 dir="auto">Issue description</h2>
<p dir="auto">The current Windows build fails, caused probably by some erroneous type, provided to a CUDA C++ class. I made a fresh build after removing all the content of the ./build directory</p>
<h2 dir="auto">System Info</h2>
<p dir="auto">collect_env.py:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Collecting environment information...
PyTorch version: 1.5.0a0+e2f1288
Is debug build: No
CUDA used to build PyTorch: 10.2

OS: Microsoft Windows 10 Pro
GCC version: Could not collect    # VS2019 16.4.5
CMake version: version 3.16.4

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.2.89
GPU models and configuration: GPU 0: Quadro M1200
Nvidia driver version: 441.66
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip3] numpy==1.18.1+mkl
[pip3] torch==1.4.0
[pip3] torchvision==0.5.0
[conda] blas                      1.0                         mkl  
[conda] libblas                   3.8.0                    15_mkl    conda-forge
[conda] libcblas                  3.8.0                    15_mkl    conda-forge
[conda] liblapack                 3.8.0                    15_mkl    conda-forge
[conda] liblapacke                3.8.0                    15_mkl    conda-forge
[conda] mkl                       2020.0                      166  
[conda] mkl-include               2019.5                      281    conda-forge
[conda] torch                     1.5.0a0+3b2f267          pypi_0    pypi
[conda] torchvision               0.5.0a0+61763fa          pypi_0    pypi"><pre class="notranslate"><code class="notranslate">Collecting environment information...
PyTorch version: 1.5.0a0+e2f1288
Is debug build: No
CUDA used to build PyTorch: 10.2

OS: Microsoft Windows 10 Pro
GCC version: Could not collect    # VS2019 16.4.5
CMake version: version 3.16.4

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.2.89
GPU models and configuration: GPU 0: Quadro M1200
Nvidia driver version: 441.66
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\cudnn64_7.dll

Versions of relevant libraries:
[pip3] numpy==1.18.1+mkl
[pip3] torch==1.4.0
[pip3] torchvision==0.5.0
[conda] blas                      1.0                         mkl  
[conda] libblas                   3.8.0                    15_mkl    conda-forge
[conda] libcblas                  3.8.0                    15_mkl    conda-forge
[conda] liblapack                 3.8.0                    15_mkl    conda-forge
[conda] liblapacke                3.8.0                    15_mkl    conda-forge
[conda] mkl                       2020.0                      166  
[conda] mkl-include               2019.5                      281    conda-forge
[conda] torch                     1.5.0a0+3b2f267          pypi_0    pypi
[conda] torchvision               0.5.0a0+61763fa          pypi_0    pypi
</code></pre></div>
<h2 dir="auto">Output</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[1980/2511] Building NVCC (Device) object caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj
FAILED: caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj
cmd.exe /C &quot;cd /D V:\src\pytorch\pytorch\build\caffe2\CMakeFiles\torch_cuda.dir\__\aten\src\THC\generated &amp;&amp; G:\programming\bin\scripting\python\conda\envs\pytorch\Library\bin\cmake.exe -E make_directory V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/. &amp;&amp; G:\programming\bin\scripting\python\conda\envs\pytorch\Library\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj -D generated_cubin_file:STRING=V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj.cubin.txt -P V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj.Release.cmake&quot;
THCTensorMathReduceChar.cu
THCTensorMathReduceChar.cu
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2993: 'Alloc': illegal type for non-type template parameter '__formal'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(72): note: see reference to class template instantiation 'thrust::detail::allocator_traits_detail::has_rebind&lt;Alloc,U&gt;' being compiled
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2065: 't': undeclared identifier
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2923: 'std::_Select&lt;__formal&gt;::_Apply': 't' is not a valid template type argument for parameter '&lt;unnamed-symbol&gt;'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2144: syntax error: 'unknown-type' should be preceded by ')'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2144: syntax error: 'unknown-type' should be preceded by ';'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2238: unexpected token(s) preceding ';'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2059: syntax error: ')'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2988: unrecognizable template declaration/definition
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2059: syntax error: '&lt;end Parse&gt;'
CMake Error at torch_cuda_generated_THCTensorMathReduceChar.cu.obj.Release.cmake:281 (message):
  Error generating file
  V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj"><pre class="notranslate"><code class="notranslate">[1980/2511] Building NVCC (Device) object caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj
FAILED: caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj
cmd.exe /C "cd /D V:\src\pytorch\pytorch\build\caffe2\CMakeFiles\torch_cuda.dir\__\aten\src\THC\generated &amp;&amp; G:\programming\bin\scripting\python\conda\envs\pytorch\Library\bin\cmake.exe -E make_directory V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/. &amp;&amp; G:\programming\bin\scripting\python\conda\envs\pytorch\Library\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj -D generated_cubin_file:STRING=V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj.cubin.txt -P V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/torch_cuda_generated_THCTensorMathReduceChar.cu.obj.Release.cmake"
THCTensorMathReduceChar.cu
THCTensorMathReduceChar.cu
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2993: 'Alloc': illegal type for non-type template parameter '__formal'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(72): note: see reference to class template instantiation 'thrust::detail::allocator_traits_detail::has_rebind&lt;Alloc,U&gt;' being compiled
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2065: 't': undeclared identifier
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2923: 'std::_Select&lt;__formal&gt;::_Apply': 't' is not a valid template type argument for parameter '&lt;unnamed-symbol&gt;'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2144: syntax error: 'unknown-type' should be preceded by ')'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2144: syntax error: 'unknown-type' should be preceded by ';'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2238: unexpected token(s) preceding ';'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2059: syntax error: ')'
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2988: unrecognizable template declaration/definition
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include\thrust/detail/allocator/allocator_traits.h(64): error C2059: syntax error: '&lt;end Parse&gt;'
CMake Error at torch_cuda_generated_THCTensorMathReduceChar.cu.obj.Release.cmake:281 (message):
  Error generating file
  V:/src/pytorch/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/THC/generated/./torch_cuda_generated_THCTensorMathReduceChar.cu.obj
</code></pre></div>
<p dir="auto">Kind of similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="486963699" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/25389" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/25389/hovercard" href="https://github.com/pytorch/pytorch/issues/25389">#25389</a></p>
<p dir="auto">Sometimes our Eigen build fails this way:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2993: 'Derived': illegal type for non-type template parameter '__formal'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2065: 'RhsType': undeclared identifier
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2923: 'std::_Select&lt;__formal&gt;::_Apply': 'RhsType' is not a valid template type argument for parameter '&lt;unnamed-symbol&gt;'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2144: syntax error: 'unknown-type' should be preceded by ')'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2144: syntax error: 'unknown-type' should be preceded by ';'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(367): error C2062: type 'bool' unexpected
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(369): error C2059: syntax error: ')'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(371): error C2143: syntax error: missing ';' before '{'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(371): error C2447: '{': missing function header (old-style formal list?)"><pre class="notranslate"><code class="notranslate">C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2993: 'Derived': illegal type for non-type template parameter '__formal'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2065: 'RhsType': undeclared identifier
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2923: 'std::_Select&lt;__formal&gt;::_Apply': 'RhsType' is not a valid template type argument for parameter '&lt;unnamed-symbol&gt;'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2144: syntax error: 'unknown-type' should be preceded by ')'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(366): error C2144: syntax error: 'unknown-type' should be preceded by ';'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(367): error C2062: type 'bool' unexpected
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(369): error C2059: syntax error: ')'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(371): error C2143: syntax error: missing ';' before '{'
C:\Jenkins\workspace\caffe2-builds\py2-cuda9.0-cudnn7-windows-build\third_party\eigen\Eigen\src/LU/InverseImpl.h(371): error C2447: '{': missing function header (old-style formal list?)
</code></pre></div>
<p dir="auto">It doesn't seem to reliably repro.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gchanan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gchanan">@gchanan</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/seemethere/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/seemethere">@seemethere</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/peterjc123/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/peterjc123">@peterjc123</a></p>