Pytorch Extension issue

I am trying to build this extension GitHub - daerduoCarey/PyTorchEMD: PyTorch Wrapper for Earth-Mover-Distance (EMD) for 3D point cloud regression but I am getting an errors with CUDA 11.1 and Pytorch cuda 11.3. and Pytorch cuda10.2

The detected CUDA version (11.1) mismatches the version that was used to compile
PyTorch (10.2). Please make sure to use the same CUDA versions.

I think I had this issue because I was using Python 3.6 . Then I got

cuda/emd_kernel.cu(385): error: identifier "TORCH_CHECK" is undefined
cuda/emd_kernel.cu(391): error: no suitable constructor exists to convert from "c10::ScalarType" to "at::Type"
6 errors detected in the compilation of "cuda/emd_kernel.cu".
error: command '/usr/bin/nvcc' failed with exit status 1

Moving to Python 3.8, and Installing Pytorch cuda 11.3 I run into these messages:

line 1694, in _get_cuda_arch_flags
    arch_list[-1] += '+PTX'
IndexError: list index out of range

So I used TORCH_CUDA_ARCH_LIST="7.5" python setup.py install but I got this

error: THC/THC.h: No such file or directory
   14 | #include <THC/THC.h>
      |          ^~~~~~~~~~~
compilation terminated.

I am not sure how could I install Pytorch extension properly, compiling them correctly, or where can I learn more about it outside of this page Custom C++ and CUDA Extensions — PyTorch Tutorials 1.12.1+cu102 documentation

Updated CUDA and PyTorch versions · Issue #6 · daerduoCarey/PyTorchEMD · GitHub I think this solved it

I had the same issue

and this worked for me for me