Pytorch-Correlation-extension
Pytorch-Correlation-extension copied to clipboard
Hello, can you take a look at my question? Thank you cuda10.1.02 gcc 7.10
(pytorch) [wzc@gpu01 ~]$ pip install spatial-correlation-sampler Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting spatial-correlation-sampler Using cached https://pypi.tuna.tsinghua.edu.cn/packages/73/99/fbfcb914944c390e59aefd29c17fba2dd7d647a8b58385ca39ed0a32765f/spatial_correlation_sampler-0.3.0.tar.gz (8.6 kB) Requirement already satisfied: torch>=1.1 in ./anaconda3/envs/pytorch/lib/python3.7/site-packages (from spatial-correlation-sampler) (1.6.0+cu101) Requirement already satisfied: numpy in ./anaconda3/envs/pytorch/lib/python3.7/site-packages (from spatial-correlation-sampler) (1.19.5) Requirement already satisfied: future in ./anaconda3/envs/pytorch/lib/python3.7/site-packages (from torch>=1.1->spatial-correlation-sampler) (0.18.2) Building wheels for collected packages: spatial-correlation-sampler Building wheel for spatial-correlation-sampler (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/wzc/anaconda3/envs/pytorch/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k26jz95z/spatial-correlation-sampler/setup.py'"'"'; file='"'"'/tmp/pip-install-k26jz95z/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ami5hjyt cwd: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/ Complete output (39 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.7 creating build/lib.linux-x86_64-3.7/spatial_correlation_sampler copying Correlation_Module/spatial_correlation_sampler/init.py -> build/lib.linux-x86_64-3.7/spatial_correlation_sampler copying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.7/spatial_correlation_sampler running build_ext building 'spatial_correlation_sampler_backend' extension creating /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7 creating /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module /usr/wzc/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/cpp_extension.py:252: UserWarning:
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Your compiler (c++) is not compatible with the compiler Pytorch was built with for this platform, which is g++ on linux. Please use g++ to to compile your extension. Alternatively, you may compile PyTorch from source using c++, and then you can also use c++ to compile your extension.
See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help with compiling PyTorch from source. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
platform=sys.platform))
Emitting ninja build file /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) 1.7.2 g++ -pthread -shared -B /usr/wzc/anaconda3/envs/pytorch/compiler_compat -L/usr/wzc/anaconda3/envs/pytorch/lib -Wl,-rpath=/usr/wzc/anaconda3/envs/pytorch/lib -Wl,--no-as-needed -Wl,--sysroot=/ /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o -L/usr/wzc/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib -L/usr/local/cuda-10.0/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-3.7/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so -lgomp g++: error: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o: No such file or directory g++: error: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o: No such file or directory g++: error: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o: No such file or directory error: command 'g++' failed with exit status 1
ERROR: Failed building wheel for spatial-correlation-sampler Running setup.py clean for spatial-correlation-sampler Failed to build spatial-correlation-sampler DEPRECATION: Could not build wheels for spatial-correlation-sampler which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. Installing collected packages: spatial-correlation-sampler Running setup.py install for spatial-correlation-sampler ... error ERROR: Command errored out with exit status 1: command: /usr/wzc/anaconda3/envs/pytorch/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k26jz95z/spatial-correlation-sampler/setup.py'"'"'; file='"'"'/tmp/pip-install-k26jz95z/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-5mfocxhu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/wzc/anaconda3/envs/pytorch/include/python3.7m/spatial-correlation-sampler cwd: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/ Complete output (39 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.7 creating build/lib.linux-x86_64-3.7/spatial_correlation_sampler copying Correlation_Module/spatial_correlation_sampler/init.py -> build/lib.linux-x86_64-3.7/spatial_correlation_sampler copying Correlation_Module/spatial_correlation_sampler/spatial_correlation_sampler.py -> build/lib.linux-x86_64-3.7/spatial_correlation_sampler running build_ext building 'spatial_correlation_sampler_backend' extension creating /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7 creating /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module /usr/wzc/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/cpp_extension.py:252: UserWarning:
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) is not compatible with the compiler Pytorch was
built with for this platform, which is g++ on linux. Please
use g++ to to compile your extension. Alternatively, you may
compile PyTorch from source using c++, and then you can also use
c++ to compile your extension.
See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
platform=sys.platform))
Emitting ninja build file /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.7.2
g++ -pthread -shared -B /usr/wzc/anaconda3/envs/pytorch/compiler_compat -L/usr/wzc/anaconda3/envs/pytorch/lib -Wl,-rpath=/usr/wzc/anaconda3/envs/pytorch/lib -Wl,--no-as-needed -Wl,--sysroot=/ /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o -L/usr/wzc/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/lib -L/usr/local/cuda-10.0/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-3.7/spatial_correlation_sampler_backend.cpython-37m-x86_64-linux-gnu.so -lgomp
g++: error: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation.o: No such file or directory
g++: error: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_sampler.o: No such file or directory
g++: error: /tmp/pip-install-k26jz95z/spatial-correlation-sampler/build/temp.linux-x86_64-3.7/Correlation_Module/correlation_cuda_kernel.o: No such file or directory
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/wzc/anaconda3/envs/pytorch/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k26jz95z/spatial-correlation-sampler/setup.py'"'"'; file='"'"'/tmp/pip-install-k26jz95z/spatial-correlation-sampler/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-5mfocxhu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/wzc/anaconda3/envs/pytorch/include/python3.7m/spatial-correlation-sampler Check the logs for full command output. (pytorch) [wzc@gpu01 ~]$
Now it's a problem of compiler. The compiler that was used to compile pytorch and your compiler have different ABIs (not an expert on the subject)
You need to either update your gcc to 4.9 or more, or compile pytorch from source with your own compiler. See https://pytorch.org/tutorials/advanced/cpp_extension.html#using-your-extension