<p dir="auto">note I wrote similar details here but haven't gotten an answer:<br>
<a href="https://stackoverflow.com/questions/59291287/trouble-installing-pytorch-from-source" rel="nofollow">https://stackoverflow.com/questions/59291287/trouble-installing-pytorch-from-source</a></p>
<h3 dir="auto"><strong>Background</strong></h3>
<p dir="auto">As mentioned in the above link, I'm trying to compile from source due to my GPU being old and support for it has been removed per the thread:  <a href="https://discuss.pytorch.org/t/pytorch-no-longer-supports-this-gpu-because-it-is-too-old/13803" rel="nofollow">https://discuss.pytorch.org/t/pytorch-no-longer-supports-this-gpu-because-it-is-too-old/13803</a>. I found someone with similar errors (I think) here: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="443213714" data-permission-text="Title is private" data-url="https://github.com/pytorch/pytorch/issues/20420" data-hovercard-type="issue" data-hovercard-url="/pytorch/pytorch/issues/20420/hovercard" href="https://github.com/pytorch/pytorch/issues/20420">#20420</a> but haven't had any luck. I've uninstalled everything including anaconda, pytorch, cuda, visual studio, python and reinstalled (with cuda being installed after visual studio) but nothing has worked. I'm really unsure what the issue could be tbh. Some additional notes that I'm not sure are relevant: my main drive is C but I have most things including Cuda installed on E, I'm running the python setup.py install command from within an anaconda terminal, not sure if thats whats I'm supposed to do, the readme repeatedly refers to anaconda so all the dependencies and stuff are installed only there. Also i've literally never installed something by compiling it from source before so its possible im doing something very basic wrong. I've been at it a while (multiple weeks off and on) and scoured every relevant page I could find though so I really hope not. Also I'm using VS17 but was doing it with 19 before without luck.</p>
<h3 dir="auto"><strong>LOGS</strong></h3>
<p dir="auto">I have 2 logs from a ninja and non ninja build here:<br>
<a href="https://www.dropbox.com/s/fx9wc38utijx8f3/build.log?dl=0" rel="nofollow">https://www.dropbox.com/s/fx9wc38utijx8f3/build.log?dl=0</a><br>
<a href="https://www.dropbox.com/s/4zkb5qz2hqbysn0/build%20ninjaoff.log?dl=0" rel="nofollow">https://www.dropbox.com/s/4zkb5qz2hqbysn0/build%20ninjaoff.log?dl=0</a></p>
<p dir="auto">Here's some environment details:</p>
<h3 dir="auto"><strong>Env</strong></h3>
<p dir="auto">Collecting environment information...<br>
PyTorch version: N/A<br>
Is debug build: N/A<br>
CUDA used to build PyTorch: N/A</p>
<p dir="auto">OS: Microsoft Windows 7 Professional<br>
GCC version: Could not collect<br>
CMake version: version 3.14.0</p>
<p dir="auto">Python version: 3.7<br>
Is CUDA available: N/A<br>
CUDA runtime version: 10.1.243<br>
GPU models and configuration: GPU 0: GeForce GTX 770M<br>
Nvidia driver version: 425.31<br>
cuDNN version: E:\python\CUDA\bin\cudnn64_7.dll</p>
<p dir="auto">Versions of relevant libraries:<br>
[pip] numpy==1.16.5<br>
[pip] numpydoc==0.9.1<br>
[conda] blas                      1.0                         mkl<br>
[conda] mkl                       2019.4                      245<br>
[conda] mkl-include               2019.4                      245<br>
[conda] mkl-service               2.3.0            py37hb782905_0<br>
[conda] mkl_fft                   1.0.14           py37h14836fe_0<br>
[conda] mkl_random                1.1.0            py37h675688f_0</p>
<p dir="auto">Any help would be greatly appreciated.</p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">When trying to compile with VS2019 but targeting v141 toolchain and cuda 10.0 there seems to be some issues with rewrite of dispatching that was done in recent weeks.</p>
<p dir="auto">This snippet was from building using facebook internal Buck, but I was able to reproduce same thing using cmake.</p>
<p dir="auto">Compiling with /permissive- fixed the "no matching overload" error, but raises some other cuda errors related to <code class="notranslate">__nv_hdl_create_wrapper_t</code></p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>checkout pytorch master</li>
<li>pass v141 as toolchain to cmake when generating</li>
<li>set cuda sdk root to 10.0</li>
<li>try and build torch_cuda</li>
</ol>
<p dir="auto">Error without /permissive-</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): error C2672: 'c10::impl::boxAndCallBoxedFunc': no matching overloaded function found
caffe2/aten/src\ATen/core/dispatch/Dispatcher.h(180): note: see reference to function template instantiation 'Return c10::KernelFunction::callUnboxed&lt;Return,const at::Tensor&amp;,const at::Tensor&amp;,bool,bool&gt;(const c10::OperatorHandle &amp;,const at::Tensor &amp;,const at::Tensor &amp;,bool,bool) const' being compiled
        with
        [
            Return=void
        ]
caffe2/aten/src\ATen/core/dispatch/Dispatcher.h(155): note: see reference to function template instantiation 'Return c10::Dispatcher::callUnboxed&lt;Return,const at::Tensor&amp;,const at::Tensor&amp;,bool,bool&gt;(const c10::OperatorHandle &amp;,const at::Tensor &amp;,const at::Tensor &amp;,bool,bool) const' being compiled
        with
        [
            Return=void
        ]
caffe2\ATen/core/TensorMethods.h(66): note: see reference to function template instantiation 'Return c10::OperatorHandle::callUnboxed&lt;void,const at::Tensor&amp;,const at::Tensor&amp;,bool,bool&gt;(const at::Tensor &amp;,const at::Tensor &amp;,bool,bool) const' being compiled
        with
        [
            Return=void
        ]
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): error C2770: invalid explicit template argument(s) for 'Result c10::impl::boxAndCallBoxedFunc(c10::KernelFunction::InternalBoxedKernelFunction (__cdecl *),c10::OperatorKernel *,const c10::OperatorHandle &amp;,Args...,enable_if&lt;_Test,_Ty&gt;::type)'
        with
        [
            _Ty=int
        ]
caffe2/aten/src\ATen/core/boxing/boxing.h(53): note: see declaration of 'c10::impl::boxAndCallBoxedFunc'
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): error C2893: Failed to specialize function template 'Result c10::impl::boxAndCallBoxedFunc(c10::KernelFunction::InternalBoxedKernelFunction (__cdecl *),c10::OperatorKernel *,const c10::OperatorHandle &amp;,Args...,enable_if&lt;_Test,_Ty&gt;::type)'
        with
        [
            _Ty=int
        ]
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): note: With the following template arguments:
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): note: 'Result=Return'
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): note: 'Args={}'"><pre class="notranslate"><code class="notranslate">caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): error C2672: 'c10::impl::boxAndCallBoxedFunc': no matching overloaded function found
caffe2/aten/src\ATen/core/dispatch/Dispatcher.h(180): note: see reference to function template instantiation 'Return c10::KernelFunction::callUnboxed&lt;Return,const at::Tensor&amp;,const at::Tensor&amp;,bool,bool&gt;(const c10::OperatorHandle &amp;,const at::Tensor &amp;,const at::Tensor &amp;,bool,bool) const' being compiled
        with
        [
            Return=void
        ]
caffe2/aten/src\ATen/core/dispatch/Dispatcher.h(155): note: see reference to function template instantiation 'Return c10::Dispatcher::callUnboxed&lt;Return,const at::Tensor&amp;,const at::Tensor&amp;,bool,bool&gt;(const c10::OperatorHandle &amp;,const at::Tensor &amp;,const at::Tensor &amp;,bool,bool) const' being compiled
        with
        [
            Return=void
        ]
caffe2\ATen/core/TensorMethods.h(66): note: see reference to function template instantiation 'Return c10::OperatorHandle::callUnboxed&lt;void,const at::Tensor&amp;,const at::Tensor&amp;,bool,bool&gt;(const at::Tensor &amp;,const at::Tensor &amp;,bool,bool) const' being compiled
        with
        [
            Return=void
        ]
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): error C2770: invalid explicit template argument(s) for 'Result c10::impl::boxAndCallBoxedFunc(c10::KernelFunction::InternalBoxedKernelFunction (__cdecl *),c10::OperatorKernel *,const c10::OperatorHandle &amp;,Args...,enable_if&lt;_Test,_Ty&gt;::type)'
        with
        [
            _Ty=int
        ]
caffe2/aten/src\ATen/core/boxing/boxing.h(53): note: see declaration of 'c10::impl::boxAndCallBoxedFunc'
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): error C2893: Failed to specialize function template 'Result c10::impl::boxAndCallBoxedFunc(c10::KernelFunction::InternalBoxedKernelFunction (__cdecl *),c10::OperatorKernel *,const c10::OperatorHandle &amp;,Args...,enable_if&lt;_Test,_Ty&gt;::type)'
        with
        [
            _Ty=int
        ]
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): note: With the following template arguments:
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): note: 'Result=Return'
caffe2\aten\src\aten\core\boxing\KernelFunction_impl.h(67): note: 'Args={}'
</code></pre></div>
<p dir="auto">Error with /permissive-</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="nvcc_internal_extended_lambda_implementation(542): error C3861: 'args': identifier not found
caffe2/aten/src/ATen/native/cuda/Copy.cu(62): note: see reference to class template instantiation '__nv_hdl_create_wrapper_t&lt;false,true,__nv_dl_tag&lt;void (__cdecl *)(at::TensorIterator &amp;,bool),at::native::copy_device_to_device,1&gt;&gt;' being compiled"><pre class="notranslate"><code class="notranslate">nvcc_internal_extended_lambda_implementation(542): error C3861: 'args': identifier not found
caffe2/aten/src/ATen/native/cuda/Copy.cu(62): note: see reference to class template instantiation '__nv_hdl_create_wrapper_t&lt;false,true,__nv_dl_tag&lt;void (__cdecl *)(at::TensorIterator &amp;,bool),at::native::copy_device_to_device,1&gt;&gt;' being compiled
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">files compile</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/yf225/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yf225">@yf225</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>