Skip to content

Commit 655b66a

Browse files
authored
Documenting cuda 11.5 windows issue
Adding documentation about compiling extension with CUDA 11.5 and Windows Example of failure: https://github.com/pytorch/pytorch/runs/4408796098?check_suite_focus=true Note: Don't use torch/extension.h In CUDA 11.5 under windows in your C++ code: Use aten instead of torch interface in all cuda 11.5 code under windows. It has been failing with errors, due to a bug in nvcc. Example use: >>> #include <ATen/ATen.h> >>> at::Tensor SigmoidAlphaBlendForwardCuda(....) Instead of: >>> #include <torch/extension.h> >>> torch::Tensor SigmoidAlphaBlendForwardCuda(...) Currently open issue for nvcc bug: #69460 Complete Workaround code example: facebookresearch/pytorch3d@cb170ac
1 parent ebef634 commit 655b66a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

advanced_source/cpp_extension.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,27 @@ into C++. Our primary datatype for all computations will be
206206
also that we can include ``<iostream>`` or *any other C or C++ header* -- we have
207207
the full power of C++11 at our disposal.
208208

209+
Note that CUDA-11.5 nvcc will hit internal compiler error while parsing torch/extension.h on Windows.
210+
To workaround the issue, move python binding logic to pure C++ file.
211+
Example use:
212+
213+
.. code-block:: cpp
214+
215+
#include <ATen/ATen.h>
216+
at::Tensor SigmoidAlphaBlendForwardCuda(....)
217+
218+
Instead of:
219+
220+
.. code-block:: cpp
221+
222+
#include <torch/extension.h>
223+
torch::Tensor SigmoidAlphaBlendForwardCuda(...)
224+
225+
Currently open issue for nvcc bug `here
226+
<https://github.com/pytorch/pytorch/issues/69460>`_.
227+
Complete workaround code example `here
228+
<https://github.com/facebookresearch/pytorch3d/commit/cb170ac024a949f1f9614ffe6af1c38d972f7d48>`_.
229+
209230
Forward Pass
210231
************
211232

0 commit comments

Comments
 (0)