teddykoker / torchsort

Fast, differentiable sorting and ranking in PyTorch
https://pypi.org/project/torchsort/
Apache License 2.0
765 stars 33 forks source link

Any help a pip3 install --user issue? #46

Closed derekahuang closed 2 years ago

derekahuang commented 2 years ago

Here is my error code:

Using legacy 'setup.py install' for torchsort, since package 'wheel' is not installed.
Installing collected packages: torchsort
    Running setup.py install for torchsort ... \       error
ERROR: Command errored out with exit status 1:  
     command: /share/software/user/open/python/3.9.0/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rc2snp_l/torchsort_02ab43cb664b4f778f8057965fe69d12/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rc2snp_l/torchsort_02ab43cb664b4f778f8057965fe69d12/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0etipwtv/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/users/huangda/.local/include/python3.9/torchsort
         cwd: /tmp/pip-install-rc2snp_l/torchsort_02ab43cb664b4f778f8057965fe69d12/
    Complete output (31 lines):  
    No CUDA runtime is found, using CUDA_HOME='/share/software/user/open/cuda/11.2.0'  
    running install  
    running build  
    running build_py  
    creating build  
    creating build/lib.linux-x86_64-3.9  
    creating build/lib.linux-x86_64-3.9/torchsort  
    copying torchsort/__init__.py -> build/lib.linux-x86_64-3.9/torchsort  
    copying torchsort/ops.py -> build/lib.linux-x86_64-3.9/torchsort  
    running egg_info  
    writing torchsort.egg-info/PKG-INFO  
    writing dependency_links to torchsort.egg-info/dependency_links.txt    
    writing requirements to torchsort.egg-info/requires.txt  
    writing top-level names to torchsort.egg-info/top_level.txt  
    /share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/utils/cpp_extension.py:369: 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 'torchsort.egg-info/SOURCES.txt'  
    reading manifest template 'MANIFEST.in'  
    writing manifest file 'torchsort.egg-info/SOURCES.txt'  
    copying torchsort/isotonic_cpu.cpp -> build/lib.linux-x86_64-3.9/torchsort  
    copying torchsort/isotonic_cuda.cu -> build/lib.linux-x86_64-3.9/torchsort  
    running build_ext   
    building 'torchsort.isotonic_cpu' extension  
    creating build/temp.linux-x86_64-3.9  
    creating build/temp.linux-x86_64-3.9/torchsort  
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/share/software/user/open/py- 
 pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include/TH -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include/THC -I/share/software/user/open/python/3.9.0/include/python3.9 -c torchsort/isotonic_cpu.cpp -o build/temp.linux-x86_64-3.9/torchsort/isotonic_cpu.o -fopenmp -ffast-math -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=isotonic_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    c++ -pthread -shared -L/share/software/user/open/libffi/3.2.1/lib64 -L/share/software/user/open/libressl/3.2.1/lib -L/share/software/user/open/sqlite/3.18.0/lib -L/share/software/user/open/tcltk/8.6.6/lib -L/share/software/user/open/xz/5.2.3/lib -L/share/software/user/open/zlib/1.2.11/lib build/temp.linux-x86_64-3.9/torchsort/isotonic_cpu.o -L/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/lib -L/share/software/user/open/python/3.9.0/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-3.9/torchsort/isotonic_cpu.cpython-39-x86_64-linux-gnu.so
    building 'torchsort.isotonic_cuda' extension
    /share/software/user/open/cuda/11.2.0/bin/nvcc -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include/TH -I/share/software/user/open/py-pytorch/1.8.1_py39/lib/python3.9/site-packages/torch/include/THC -I/share/software/user/open/cuda/11.2.0/include -I/share/software/user/open/python/3.9.0/include/python3.9 -c torchsort/isotonic_cuda.cu -o build/temp.linux-x86_64-3.9/torchsort/isotonic_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=isotonic_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=compute_61 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -ccbin gcc -std=c++14
    nvcc error   : 'cicc' died due to signal 9 (Kill signal)  
    error: command '/share/software/user/open/cuda/11.2.0/bin/nvcc' failed with exit code 9  
    ----------------------------------------
ERROR: Command errored out with exit status 1: /share/software/user/open/python/3.9.0/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rc2snp_l/torchsort_02ab43cb664b4f778f8057965fe69d12/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rc2snp_l/torchsort_02ab43cb664b4f778f8057965fe69d12/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0etipwtv/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/users/huangda/.local/include/python3.9/torchsort Check the logs for full command output.

Has anybody else experienced this before? The full command I am running is:

TORCH_CUDA_ARCH_LIST="Pascal;Volta;Turing;Ampere" pip3 install --user torchsort

derekahuang commented 2 years ago

Environment:

image

teddykoker commented 2 years ago

How much memory does your system have? I believe the most common cause of the signal 9 (Kill signal) in programs is running out of memory (nvcc error : 'cicc' died due to signal 9 (Kill signal)), unless you manually killed the install

XiaoqiWang commented 2 years ago

Hi, I also encountered the same problem, could you tell me how you solved it.

teddykoker commented 2 years ago

@XiaoqiWang do you have the full stack trace?

XiaoqiWang commented 2 years ago

Thanks for the fast reply. I just tried to install Visual Studio, and the following error was reported. error: command 'C:\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.4\\bin\\\nvcc.exe' failed with exit code 2

My device is NVIDIA 3090(CUDA driver 11.4, python3.9, )

XiaoqiWang commented 2 years ago

isotonic_cuda.cu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\include\crt/host_config.h(160): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.4\\bin\\nvcc.exe' failed with exit code 2```