26.01.2025, 14:53
(25.01.2025, 15:10)Dan64 Wrote: ----- INSTALLATION GUIDE for: Pytorch-Correlation-extension -----
This will produce under the directory dist a egg file, like
spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg
This file have to be converted in whell with the command (the script wheel to be installed with conda/pip)
wheel convert spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg
then is necessary to rename the generated file:
spatial_correlation_sampler-0.5.0-py3.12-win-amd64.whl
in: spatial_correlation_sampler-0.5.0-py3.12-win-amd64.whl.zip
so that is possible to open the zip archive.
The files need to be extracted in the directory (no way to install it with pip)
.\Hybrid\64bit\Vapoursynth\Lib\site-packages
As wrote previously you need to extract the file in the zip archive to the folder: .\Hybrid\64bit\Vapoursynth\Lib\site-packages
In this way should work.
This is the output of my compilation (using pytorch 2.6 dev)
(colormnet) PS D:\PProjects\Pytorch-Correlation-extension> python setup.py install
running install
d:\anaconda3\envs\colormnet\Lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
d:\anaconda3\envs\colormnet\Lib\site-packages\setuptools\_distutils\cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
self.initialize_options()
running bdist_egg
running egg_info
writing Correlation_Module\spatial_correlation_sampler.egg-info\PKG-INFO
writing dependency_links to Correlation_Module\spatial_correlation_sampler.egg-info\dependency_links.txt
writing requirements to Correlation_Module\spatial_correlation_sampler.egg-info\requires.txt
writing top-level names to Correlation_Module\spatial_correlation_sampler.egg-info\top_level.txt
d:\anaconda3\envs\colormnet\Lib\site-packages\torch\utils\cpp_extension.py:529: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'Correlation_Module\spatial_correlation_sampler.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'Correlation_Module\spatial_correlation_sampler.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build\lib.win-amd64-cpython-312\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler\spatial_correlation_sampler.py -> build\lib.win-amd64-cpython-312\spatial_correlation_sampler
copying Correlation_Module\spatial_correlation_sampler\__init__.py -> build\lib.win-amd64-cpython-312\spatial_correlation_sampler
running build_ext
building 'spatial_correlation_sampler_backend' extension
creating build\temp.win-amd64-cpython-312\Release\Correlation_Module
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DUSE_CUDA -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\torch\csrc\api\include -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\TH -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -Id:\anaconda3\envs\colormnet\include -Id:\anaconda3\envs\colormnet\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /TpCorrelation_Module\correlation.cpp /Fobuild\temp.win-amd64-cpython-312\Release\Correlation_Module\correlation.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -std=c++17 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17
cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
correlation.cpp
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc" -c Correlation_Module\correlation_cuda_kernel.cu -o build\temp.win-amd64-cpython-312\Release\Correlation_Module\correlation_cuda_kernel.obj -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\torch\csrc\api\include -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\TH -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -Id:\anaconda3\envs\colormnet\include -Id:\anaconda3\envs\colormnet\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++17 --use-local-env
correlation_cuda_kernel.cu
tmpxft_00005454_00000000-7_correlation_cuda_kernel.cudafe1.cpp
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DUSE_CUDA -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\torch\csrc\api\include -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\TH -Id:\anaconda3\envs\colormnet\Lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -Id:\anaconda3\envs\colormnet\include -Id:\anaconda3\envs\colormnet\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /TpCorrelation_Module\correlation_sampler.cpp /Fobuild\temp.win-amd64-cpython-312\Release\Correlation_Module\correlation_sampler.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -std=c++17 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17
cl : Command line warning D9002 : ignoring unknown option '-std=c++17'
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
correlation_sampler.cpp
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:d:\anaconda3\envs\colormnet\Lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\lib\x64" /LIBPATH:d:\anaconda3\envs\colormnet\libs /LIBPATH:d:\anaconda3\envs\colormnet /LIBPATH:d:\anaconda3\envs\colormnet\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit_spatial_correlation_sampler_backend build\temp.win-amd64-cpython-312\Release\Correlation_Module\correlation.obj build\temp.win-amd64-cpython-312\Release\Correlation_Module\correlation_cuda_kernel.obj build\temp.win-amd64-cpython-312\Release\Correlation_Module\correlation_sampler.obj /OUT:build\lib.win-amd64-cpython-312\spatial_correlation_sampler_backend.cp312-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-312\Release\Correlation_Module\spatial_correlation_sampler_backend.cp312-win_amd64.lib -lgomp
LINK : warning LNK4044: unrecognized option '/lgomp'; ignored
Creating library build\temp.win-amd64-cpython-312\Release\Correlation_Module\spatial_correlation_sampler_backend.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\Correlation_Module\spatial_correlation_sampler_backend.cp312-win_amd64.exp
Generating code
Finished generating code
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\spatial_correlation_sampler
copying build\lib.win-amd64-cpython-312\spatial_correlation_sampler\spatial_correlation_sampler.py -> build\bdist.win-amd64\egg\spatial_correlation_sampler
copying build\lib.win-amd64-cpython-312\spatial_correlation_sampler\__init__.py -> build\bdist.win-amd64\egg\spatial_correlation_sampler
copying build\lib.win-amd64-cpython-312\spatial_correlation_sampler_backend.cp312-win_amd64.pyd -> build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\spatial_correlation_sampler\spatial_correlation_sampler.py to spatial_correlation_sampler.cpython-312.pyc
byte-compiling build\bdist.win-amd64\egg\spatial_correlation_sampler\__init__.py to __init__.cpython-312.pyc
creating stub loader for spatial_correlation_sampler_backend.cp312-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\spatial_correlation_sampler_backend.py to spatial_correlation_sampler_backend.cpython-312.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying Correlation_Module\spatial_correlation_sampler.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying Correlation_Module\spatial_correlation_sampler.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Correlation_Module\spatial_correlation_sampler.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Correlation_Module\spatial_correlation_sampler.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Correlation_Module\spatial_correlation_sampler.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
__pycache__.spatial_correlation_sampler_backend.cpython-312: module references __file__
creating 'dist\spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg
removing 'd:\anaconda3\envs\colormnet\lib\site-packages\spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg' (and everything under it)
creating d:\anaconda3\envs\colormnet\lib\site-packages\spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg
Extracting spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg to d:\anaconda3\envs\colormnet\lib\site-packages
Adding spatial-correlation-sampler 0.5.0 to easy-install.pth file
Installed d:\anaconda3\envs\colormnet\lib\site-packages\spatial_correlation_sampler-0.5.0-py3.12-win-amd64.egg
Processing dependencies for spatial-correlation-sampler==0.5.0
Searching for numpy==2.1.2
Best match: numpy 2.1.2
Adding numpy 2.1.2 to easy-install.pth file
Installing f2py-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing f2py.exe script to d:\anaconda3\envs\colormnet\Scripts
Installing numpy-config-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing numpy-config.exe script to d:\anaconda3\envs\colormnet\Scripts
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for torch==2.6.0.dev20241101+cu124
Best match: torch 2.6.0.dev20241101+cu124
Adding torch 2.6.0.dev20241101+cu124 to easy-install.pth file
Installing convert-caffe2-to-onnx-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing convert-caffe2-to-onnx.exe script to d:\anaconda3\envs\colormnet\Scripts
Installing convert-onnx-to-caffe2-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing convert-onnx-to-caffe2.exe script to d:\anaconda3\envs\colormnet\Scripts
Installing torchfrtrace-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing torchfrtrace.exe script to d:\anaconda3\envs\colormnet\Scripts
Installing torchrun-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing torchrun.exe script to d:\anaconda3\envs\colormnet\Scripts
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for sympy==1.13.1
Best match: sympy 1.13.1
Adding sympy 1.13.1 to easy-install.pth file
Installing isympy-script.py script to d:\anaconda3\envs\colormnet\Scripts
Installing isympy.exe script to d:\anaconda3\envs\colormnet\Scripts
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for setuptools==75.3.0
Best match: setuptools 75.3.0
Processing setuptools-75.3.0-py3.12.egg
Adding setuptools 75.3.0 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages\setuptools-75.3.0-py3.12.egg
Searching for fsspec==2024.10.0
Best match: fsspec 2024.10.0
Adding fsspec 2024.10.0 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for jinja2==3.1.4
Best match: jinja2 3.1.4
Adding jinja2 3.1.4 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for networkx==3.4.2
Best match: networkx 3.4.2
Adding networkx 3.4.2 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for typing-extensions==4.12.2
Best match: typing-extensions 4.12.2
Adding typing-extensions 4.12.2 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages\setuptools\_vendor
Searching for filelock==3.16.1
Best match: filelock 3.16.1
Adding filelock 3.16.1 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for mpmath==1.3.0
Best match: mpmath 1.3.0
Adding mpmath 1.3.0 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages
Searching for MarkupSafe==2.1.5
Best match: MarkupSafe 2.1.5
Adding MarkupSafe 2.1.5 to easy-install.pth file
Using d:\anaconda3\envs\colormnet\lib\site-packages
Finished processing dependencies for spatial-correlation-sampler==0.5.0
You get too many warnings try to install Visual Studio 2019 (maybe the compiler is more compatible).
These are my environment variables
CUDA_MODULE_LOADING=LAZY
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4
CUDA_PATH_V11_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4
CUDA_PATH_V12_1=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
CUDA_PATH_V12_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4
TORCH_CUDA_ARCH_LIST=8.6
Dan