Issue 1:
note I wrote similar details here but haven't gotten an answer:

https://stackoverflow.com/questions/59291287/trouble-installing-pytorch-from-source

Background

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: https://discuss.pytorch.org/t/pytorch-no-longer-supports-this-gpu-because-it-is-too-old/13803. I found someone with similar errors (I think) here: #20420 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.

LOGS

I have 2 logs from a ninja and non ninja build here:

https://www.dropbox.com/s/fx9wc38utijx8f3/build.log?dl=0

https://www.dropbox.com/s/4zkb5qz2hqbysn0/build%20ninjaoff.log?dl=0

Here's some environment details:

Env

Collecting environment information...

PyTorch version: N/A

Is debug build: N/A

CUDA used to build PyTorch: N/A

OS: Microsoft Windows 7 Professional

GCC version: Could not collect

CMake version: version 3.14.0

Python version: 3.7

Is CUDA available: N/A

CUDA runtime version: 10.1.243

GPU models and configuration: GPU 0: GeForce GTX 770M

Nvidia driver version: 425.31

cuDNN version: E:\python\CUDA\bin\cudnn64_7.dll

Versions of relevant libraries:

[pip] numpy==1.16.5

[pip] numpydoc==0.9.1

[conda] blas 1.0 mkl

[conda] mkl 2019.4 245

[conda] mkl-include 2019.4 245

[conda] mkl-service 2.3.0 py37hb782905_0

[conda] mkl_fft 1.0.14 py37h14836fe_0

[conda] mkl_random 1.1.0 py37h675688f_0

Any help would be greatly appreciated.

Issue 2:
🐛 Bug

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.

This snippet was from building using facebook internal Buck, but I was able to reproduce same thing using cmake.

Compiling with /permissive- fixed the "no matching overload" error, but raises some other cuda errors related to __nv_hdl_create_wrapper_t

To Reproduce

Steps to reproduce the behavior:

checkout pytorch master

pass v141 as toolchain to cmake when generating

set cuda sdk root to 10.0

try and build torch_cuda

Error without /permissive-

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<Return,const at::Tensor&,const at::Tensor&,bool,bool>(const c10::OperatorHandle &,const at::Tensor &,const at::Tensor &,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<Return,const at::Tensor&,const at::Tensor&,bool,bool>(const c10::OperatorHandle &,const at::Tensor &,const at::Tensor &,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<void,const at::Tensor&,const at::Tensor&,bool,bool>(const at::Tensor &,const at::Tensor &,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 &,Args...,enable_if<_Test,_Ty>::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 &,Args...,enable_if<_Test,_Ty>::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={}'

Error with /permissive-

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<false,true,__nv_dl_tag<void (__cdecl *)(at::TensorIterator &,bool),at::native::copy_device_to_device,1>>' being compiled

Expected behavior

files compile

cc @ezyang @gchanan @zou3519 @yf225 @peterjc123