Build from source failed on Windows 10 with CUDA11.5, CUDNN8.2, pytorch 1.11.0

Frozen: <p>Hi, there,</p>
<p>Im trying to compile pytorch 1.11.0 from source on windows using vs 2019 with cuda 11.5 and cudnn 8.2 but faces linking error when compiling <code>torch_cuda.vcxproj</code> .<br>
below is the step to rebroduce.</p>
<ol>
<li>open <code>x64 Native Tools Command Propmt for VS 2019</code> from windows start menu.</li>
<li>set python and other dependencies</li>
</ol>
<pre><code class="lang-auto">conda create -n ML3 python=3.7
conda activate ML3

conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing

# download magma and mkl

set CMAKE_INCLUDE_PATH=%cd%\mkl\include
set LIB=%LIB%;%cd%\mkl\lib
set MAGMA_HOME=%cd%\magma

</code></pre>
<ol start="3">
<li>set some variable and build</li>
</ol>
<pre><code class="lang-auto">set USE_CUDA=1
set USE_CUDNN=1
set USE_NINJA=0
set CMAKE_GENERATOR=Visual Studio 16 2019
set CMAKE_GENERATOR_TOOLSET_VERSION=14.27
set BUILD_BINARY=1
set TORCH_CUDA_ARCH_LIST=7.5
set DISTUTILS_USE_SDK=1

python setup.py install
</code></pre>
<p>error log:</p>
<pre><code class="lang-auto">RegisterCUDA.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class at::Tensor __cdecl at::native::slow_conv_transpose3d_cuda(class at::Tensor const &amp;,class at::Tensor const &amp;,cla
ss c10::ArrayRef&lt;__int64&gt;,class c10::optional&lt;class at::Tensor&gt; const &amp;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int
64&gt;)" (__imp_?slow_conv_transpose3d_cuda@native@at@@YA?AVTensor@2@AEBV32@0V?$ArrayRef@_J@c10@@AEBV?$optional@VTensor@at@@@5@1111@Z)，函数 "class at::Tensor __cdecl at::A0x35b12c2b::`anony
mous namespace'::wrapper__slow_conv_transpose3d(class at::Tensor const &amp;,class at::Tensor const &amp;,class c10::ArrayRef&lt;__int64&gt;,class c10::optional&lt;class at::Tensor&gt; const &amp;,class c10::
ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;)" (?wrapper__slow_conv_transpose3d@?A0x35b12c2b@1at@@YA?AVTensor@2@AEBV32@0V?$A
rrayRef@_J@c10@@AEBV?$optional@VTensor@at@@@5@1111@Z) 中引用了该符号 [D:\Code\Project\pytorch\pytorch-1.11.0\build\caffe2\torch_cuda.vcxproj]
RegisterCUDA.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class at::Tensor &amp; __cdecl at::native::slow_conv_transpose3d_out_cuda(class at::Tensor const &amp;,class at::Tensor const
 &amp;,class c10::ArrayRef&lt;__int64&gt;,class c10::optional&lt;class at::Tensor&gt; const &amp;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef
&lt;__int64&gt;,class at::Tensor &amp;)" (__imp_?slow_conv_transpose3d_out_cuda@native@at@@YAAEAVTensor@2@AEBV32@0V?$ArrayRef@_J@c10@@AEBV?$optional@VTensor@at@@@5@1111AEAV32@@Z)，函数 "class at::T
ensor &amp; __cdecl at::A0x35b12c2b::`anonymous namespace'::wrapper_out_slow_conv_transpose3d_out_out(class at::Tensor const &amp;,class at::Tensor const &amp;,class c10::ArrayRef&lt;__int64&gt;,class c
10::optional&lt;class at::Tensor&gt; const &amp;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,class at::Tensor &amp;)" (?wrappe
r_out_slow_conv_transpose3d_out_out@?A0x35b12c2b@1at@@YAAEAVTensor@2@AEBV32@0V?$ArrayRef@_J@c10@@AEBV?$optional@VTensor@at@@@5@1111AEAV32@@Z) 中引用了该符号 [D:\Code\Project\pytorch\pytorch-1
.11.0\build\caffe2\torch_cuda.vcxproj]
RegisterCUDA.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class at::Tensor &amp; __cdecl at::native::_sspaddmm_out_only_sparse_cuda(class at::Tensor const &amp;,class at::Tensor const
 &amp;,class at::Tensor const &amp;,class c10::Scalar const &amp;,class c10::Scalar const &amp;,class at::Tensor &amp;)" (__imp_?_sspaddmm_out_only_sparse_cuda@native@at@@YAAEAVTensor@2@AEBV32@00AEBVScala
r@c10@@1AEAV32@@Z)，函数 "class at::Tensor &amp; __cdecl at::A0x35b12c2b::`anonymous namespace'::wrapper_out_sspaddmm_out_out(class at::Tensor const &amp;,class at::Tensor const &amp;,class at::Tenso
r const &amp;,class c10::Scalar const &amp;,class c10::Scalar const &amp;,class at::Tensor &amp;)" (?wrapper_out_sspaddmm_out_out@?A0x35b12c2b@1at@@YAAEAVTensor@2@AEBV32@00AEBVScalar@c10@@1AEAV32@@Z)
中引用了该符号 [D:\Code\Project\pytorch\pytorch-1.11.0\build\caffe2\torch_cuda.vcxproj]
RegisterCUDA.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class at::Tensor __cdecl at::native::trace_cuda(class at::Tensor const &amp;)" (__imp_?trace_cuda@native@at@@YA?AVTensor@
2@AEBV32@@Z)，函数 "class at::Tensor __cdecl at::A0x35b12c2b::`anonymous namespace'::wrapper__trace(class at::Tensor const &amp;)" (?wrapper__trace@?A0x35b12c2b@1at@@YA?AVTensor@2@AEBV32@@Z)
中引用了该符号 [D:\Code\Project\pytorch\pytorch-1.11.0\build\caffe2\torch_cuda.vcxproj]
RegisterCUDA.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) class at::Tensor __cdecl at::native::tril_indices_cuda(__int64,__int64,__int64,class c10::optional&lt;enum c10::ScalarTy
pe&gt;,class c10::optional&lt;enum c10::Layout&gt;,class c10::optional&lt;struct c10::Device&gt;,class c10::optional&lt;bool&gt;)" (__imp_?tril_indices_cuda@native@at@@YA?AVTensor@2@_J00V?$optional@W4Scala
rType@c10@@@c10@@V?$optional@W4Layout@c10@@@5@V?$optional@UDevice@c10@@@5@V?$optional@_N@5@@Z)，函数 "class at::Tensor __cdecl at::A0x35b12c2b::`anonymous namespace'::wrapper__tril_indice
s(__int64,__int64,__int64,class c10::optional&lt;enum c10::ScalarType&gt;,class c10::optional&lt;enum c10::Layout&gt;,class c10::optional&lt;struct c10::Device&gt;,class c10::optional&lt;bool&gt;)" (?wrapper_
_tril_indices@?A0x35b12c2b@1at@@YA?AVTensor@2@_J00V?$optional@W4ScalarType@c10@@@c10@@V?$optional@W4Layout@c10@@@5@V?$optional@UDevice@c10@@@5@V?$optional@_N@5@@Z) 中引用了该符号 [D:\Code\Pro
ject\pytorch\pytorch-1.11.0\build\caffe2\torch_cuda.vcxproj]
RegisterCUDA.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl at::native::structured_tril_cuda::impl(class at::Tensor const &amp;,__int64,class at::Tensor const &amp;
)" (__imp_?impl@structured_tril_cuda@native@at@@QEAAXAEBVTensor@3@_J0@Z)，函数 "class at::Tensor __cdecl at::`anonymous namespace'::wrapper_tril(class at::Tensor const &amp;,__int64)" (?wrapp
er_tril@?A0x35b12c2b@at@@YA?AVTensor@2@AEBV32@_J@Z) 中引用了该符号 [D:\Code\Project\pytorch\pytorch-1.11.0\build\caffe2\torch_cuda.vcxproj]
</code></pre>
<p>Is there any clue to fix this? Thanks in advance.</p>