Pytorch extension build problem

Jakub_Mitura: <p>Hello I try to build official pytorch CUDA example from <a href="https://github.com/pytorch/extension-cpp" class="inline-onebox" rel="noopener nofollow ugc">GitHub - pytorch/extension-cpp: C++ extensions in PyTorch</a></p>
<p><code>python setup.py install</code>  invoked from the cuda subfolder of extension-cpp works well</p>
<p>Hovewer when I try to run</p>
<pre><code class="lang-auto">python jit.py
</code></pre>
<p>I get error</p>
<pre><code class="lang-auto">**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.9.18
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Windows\System32&gt;python D:\projects\extension-cpp\cuda\jit.py
Using C:\Users\jakub\AppData\Local\torch_extensions\torch_extensions\Cache\py37_cu113 as PyTorch extensions root...
Traceback (most recent call last):
  File "D:\projects\extension-cpp\cuda\jit.py", line 3, in &lt;module&gt;
    'lltm_cuda', ['lltm_cuda.cpp', 'lltm_cuda_kernel.cu'], verbose=True)
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\cpp_extension.py", line 1136, in load
    keep_intermediates=keep_intermediates)
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\cpp_extension.py", line 1314, in _jit_compile
    is_standalone=is_standalone,
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\_cpp_extension_versioner.py", line 45, in bump_version_if_changed
    hash_value = hash_source_files(hash_value, source_files)
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\_cpp_extension_versioner.py", line 15, in hash_source_files
    with open(filename) as file:
FileNotFoundError: [Errno 2] No such file or directory: 'lltm_cuda.cpp'

</code></pre>
<p>I also faund that somebody tried to make it work by changing setup.py to</p>
<pre><code class="lang-auto">setup(
    name='lltm_cuda',
    ext_modules=[
        CUDAExtension('lltm_cuda', [
            'lltm_cuda.cpp',
            'lltm_cuda_kernel.cu'],
            include_dirs=['/playpen/extension-cpp/demo/includes']
        ),
    ],
    cmdclass={
        'build_ext': BuildExtension
    })

</code></pre>
<p>but I can not figure it out what include directory to include here because when I try</p>
<pre><code class="lang-auto">from torch.utils.cpp_extension import load
lltm_cuda = load(
    'lltm_cuda', ['D:/projects/extension-cpp/cuda/lltm_cuda.cpp', 'D:/projects/extension-cpp/cuda/lltm_cuda_kernel.cu'], verbose=True)
help(lltm_cuda)
</code></pre>
<p>I get</p>
<pre><code class="lang-auto">list index out of range
</code></pre>
<p>my configuration<br>
torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113<br>
Python 6.3<br>
I had also installed latest Microsoft Visual C++ Redistributable</p>
<p>Thanks for any help !!!</p>

Jakub_Mitura: <p>Ok I figured it out I just put all of the necessery files to one directory not dividing to subfolders (I used only CUDA) and all works now</p>