mit-han-lab / torchsparse

[MICRO'23, MLSys'22] TorchSparse: Efficient Training and Inference Framework for Sparse Convolution on GPUs.
https://torchsparse.mit.edu
MIT License
1.19k stars 138 forks source link

[Installation] pip安装torchsparse失败 #272

Closed OliverLai closed 9 months ago

OliverLai commented 10 months ago

Is there an existing issue for this?

Have you followed all the steps in the FAQ?

Current Behavior

在conda环境中安装torchsparse时通过conda search安装torchsparse没有找到适合cuda==11.0和torch==1.7.1版本的包,我需要如何操作才能在当前环境下安装适配的torchsparse?

Error Line

nvcc fatal: Unsupported gpu architecture 'compute_86' error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for torchsparse Running setup.py clean for torchsparse

Failed to build torchsparse ERROR: Could not build wheels for torchsparse, which is required to install pyproject.toml-based projects

Environment

- GCC:9.4.0
- NVCC:11.0
- PyTorch:1.7.1+cu110
- PyTorch CUDA:11.0

Full Error Log

(neucon) zqcz@zqcz-MS-7D36:~/Downloads/NeuralRecon-master$ FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/torchsparse.git Collecting git+https://github.com/mit-han-lab/torchsparse.git Cloning https://github.com/mit-han-lab/torchsparse.git to /tmp/pip-req-build-ptiijeer Running command git clone --filter=blob:none --quiet https://github.com/mit-han-lab/torchsparse.git /tmp/pip-req-build-ptiijeer Resolved https://github.com/mit-han-lab/torchsparse.git to commit 7c04c5843961b8cb86123ab9299a351f6501ea22 Preparing metadata (setup.py) ... done Requirement already satisfied: numpy in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from torchsparse==2.1.0) (1.21.6) Requirement already satisfied: backports.cached_property in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from torchsparse==2.1.0) (1.0.2) Requirement already satisfied: tqdm in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from torchsparse==2.1.0) (4.66.1) Requirement already satisfied: typing-extensions in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from torchsparse==2.1.0) (4.7.1) Requirement already satisfied: wheel in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from torchsparse==2.1.0) (0.42.0) Collecting rootpath (from torchsparse==2.1.0) Downloading rootpath-0.1.1-py3-none-any.whl (15 kB) Requirement already satisfied: six>=1.11.0 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from rootpath->torchsparse==2.1.0) (1.16.0) Collecting coloredlogs>=10.0 (from rootpath->torchsparse==2.1.0) Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 482.6 kB/s eta 0:00:00 Collecting termcolor>=1.1.0 (from rootpath->torchsparse==2.1.0) Downloading termcolor-2.3.0-py3-none-any.whl (6.9 kB) Collecting colour-runner>=0.0.5 (from rootpath->torchsparse==2.1.0) Downloading colour_runner-0.1.1-py2.py3-none-any.whl (3.7 kB) Collecting deepdiff>=3.3.0 (from rootpath->torchsparse==2.1.0) Downloading deepdiff-6.7.1-py3-none-any.whl.metadata (6.1 kB) Requirement already satisfied: pygments>=2.2.0 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from rootpath->torchsparse==2.1.0) (2.17.2) Collecting tox>=3.0.0 (from rootpath->torchsparse==2.1.0) Downloading tox-4.8.0-py3-none-any.whl.metadata (5.1 kB) Collecting coverage>=4.5.2 (from rootpath->torchsparse==2.1.0) Downloading coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.7 kB) Collecting codecov>=2.0.15 (from rootpath->torchsparse==2.1.0) Downloading codecov-2.1.13-py2.py3-none-any.whl (16 kB) Requirement already satisfied: requests>=2.7.9 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from codecov>=2.0.15->rootpath->torchsparse==2.1.0) (2.31.0) Collecting humanfriendly>=9.1 (from coloredlogs>=10.0->rootpath->torchsparse==2.1.0) Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 1.6 MB/s eta 0:00:00 Collecting blessings (from colour-runner>=0.0.5->rootpath->torchsparse==2.1.0) Downloading blessings-1.7-py3-none-any.whl (18 kB) Collecting ordered-set<4.2.0,>=4.0.2 (from deepdiff>=3.3.0->rootpath->torchsparse==2.1.0) Downloading ordered_set-4.1.0-py3-none-any.whl (7.6 kB) Collecting cachetools>=5.3.1 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading cachetools-5.3.2-py3-none-any.whl.metadata (5.2 kB) Collecting chardet>=5.1 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading chardet-5.2.0-py3-none-any.whl.metadata (3.4 kB) Requirement already satisfied: colorama>=0.4.6 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from tox>=3.0.0->rootpath->torchsparse==2.1.0) (0.4.6) Requirement already satisfied: filelock>=3.12.2 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from tox>=3.0.0->rootpath->torchsparse==2.1.0) (3.12.2) Collecting importlib-metadata>=6.7 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading importlib_metadata-6.7.0-py3-none-any.whl.metadata (4.9 kB) Requirement already satisfied: packaging>=23.1 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from tox>=3.0.0->rootpath->torchsparse==2.1.0) (23.2) Collecting platformdirs>=3.9.1 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading platformdirs-4.0.0-py3-none-any.whl.metadata (11 kB) Collecting pluggy>=1.2 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading pluggy-1.2.0-py3-none-any.whl.metadata (4.4 kB) Collecting pyproject-api>=1.5.3 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading pyproject_api-1.5.3-py3-none-any.whl.metadata (2.9 kB) Collecting tomli>=2.0.1 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading tomli-2.0.1-py3-none-any.whl (12 kB) Collecting virtualenv>=20.24.1 (from tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading virtualenv-20.25.0-py3-none-any.whl.metadata (4.5 kB) Requirement already satisfied: zipp>=0.5 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from importlib-metadata>=6.7->tox>=3.0.0->rootpath->torchsparse==2.1.0) (3.15.0) Requirement already satisfied: charset-normalizer<4,>=2 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from requests>=2.7.9->codecov>=2.0.15->rootpath->torchsparse==2.1.0) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from requests>=2.7.9->codecov>=2.0.15->rootpath->torchsparse==2.1.0) (3.6) Requirement already satisfied: urllib3<3,>=1.21.1 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from requests>=2.7.9->codecov>=2.0.15->rootpath->torchsparse==2.1.0) (2.0.7) Requirement already satisfied: certifi>=2017.4.17 in /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages (from requests>=2.7.9->codecov>=2.0.15->rootpath->torchsparse==2.1.0) (2023.11.17) Collecting distlib<1,>=0.3.7 (from virtualenv>=20.24.1->tox>=3.0.0->rootpath->torchsparse==2.1.0) Downloading distlib-0.3.7-py2.py3-none-any.whl.metadata (5.1 kB) Downloading coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225.6/225.6 kB 159.1 kB/s eta 0:00:00 Downloading deepdiff-6.7.1-py3-none-any.whl (76 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.6/76.6 kB 125.8 kB/s eta 0:00:00 Downloading tox-4.8.0-py3-none-any.whl (152 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 152.6/152.6 kB 41.5 kB/s eta 0:00:00 Downloading cachetools-5.3.2-py3-none-any.whl (9.3 kB) Downloading chardet-5.2.0-py3-none-any.whl (199 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.4/199.4 kB 46.4 kB/s eta 0:00:00 Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB) Downloading platformdirs-4.0.0-py3-none-any.whl (17 kB) Downloading pluggy-1.2.0-py3-none-any.whl (17 kB) Downloading pyproject_api-1.5.3-py3-none-any.whl (12 kB) Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 84.1 kB/s eta 0:00:00 Downloading distlib-0.3.7-py2.py3-none-any.whl (468 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 kB 62.1 kB/s eta 0:00:00 Building wheels for collected packages: torchsparse Building wheel for torchsparse (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [94 lines of output] torchsparse version: 2.1.0 running bdist_wheel /home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages/torch/utils/cpp_extension.py:352: 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.')) running build running build_py creating build creating build/lib.linux-x86_64-cpython-37 creating build/lib.linux-x86_64-cpython-37/torchsparse copying torchsparse/backends.py -> build/lib.linux-x86_64-cpython-37/torchsparse copying torchsparse/tensor.py -> build/lib.linux-x86_64-cpython-37/torchsparse copying torchsparse/operators.py -> build/lib.linux-x86_64-cpython-37/torchsparse copying torchsparse/version.py -> build/lib.linux-x86_64-cpython-37/torchsparse copying torchsparse/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse creating build/lib.linux-x86_64-cpython-37/torchsparse/backbones copying torchsparse/backbones/unet.py -> build/lib.linux-x86_64-cpython-37/torchsparse/backbones copying torchsparse/backbones/resnet.py -> build/lib.linux-x86_64-cpython-37/torchsparse/backbones copying torchsparse/backbones/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/backbones creating build/lib.linux-x86_64-cpython-37/torchsparse/nn copying torchsparse/nn/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn creating build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/collate.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/tensor_cache.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/to_dense.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/utils.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/quantize.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils copying torchsparse/utils/tune.py -> build/lib.linux-x86_64-cpython-37/torchsparse/utils creating build/lib.linux-x86_64-cpython-37/torchsparse/backbones/modules copying torchsparse/backbones/modules/blocks.py -> build/lib.linux-x86_64-cpython-37/torchsparse/backbones/modules copying torchsparse/backbones/modules/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/backbones/modules creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/hash.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/voxelize.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/activation.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/count.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/crop.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/pooling.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/query.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/devoxelize.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional copying torchsparse/nn/functional/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/conv.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/activation.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/bev.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/crop.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/pooling.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/norm.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules copying torchsparse/nn/modules/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/modules creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/utils copying torchsparse/nn/utils/kernel.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/utils copying torchsparse/nn/utils/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/utils copying torchsparse/nn/utils/apply.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/utils creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv copying torchsparse/nn/functional/conv/conv.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv copying torchsparse/nn/functional/conv/conv_mode.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv copying torchsparse/nn/functional/conv/conv_config.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv copying torchsparse/nn/functional/conv/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/func copying torchsparse/nn/functional/conv/func/fetch_on_demand.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/func copying torchsparse/nn/functional/conv/func/implicit_gemm.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/func copying torchsparse/nn/functional/conv/func/gather_scatter.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/func copying torchsparse/nn/functional/conv/func/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/func creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/hash copying torchsparse/nn/functional/conv/hash/hash.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/hash copying torchsparse/nn/functional/conv/hash/query.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/hash copying torchsparse/nn/functional/conv/hash/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/hash creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap copying torchsparse/nn/functional/conv/kmap/upsample.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap copying torchsparse/nn/functional/conv/kmap/downsample.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap copying torchsparse/nn/functional/conv/kmap/build_kmap.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap copying torchsparse/nn/functional/conv/kmap/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/utils copying torchsparse/nn/functional/conv/utils/compat.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/utils copying torchsparse/nn/functional/conv/utils/collections.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/utils copying torchsparse/nn/functional/conv/utils/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/utils creating build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap/func copying torchsparse/nn/functional/conv/kmap/func/hashmap_on_the_fly.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap/func copying torchsparse/nn/functional/conv/kmap/func/hashmap.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap/func copying torchsparse/nn/functional/conv/kmap/func/init.py -> build/lib.linux-x86_64-cpython-37/torchsparse/nn/functional/conv/kmap/func running build_ext building 'torchsparse.backend' extension creating build/temp.linux-x86_64-cpython-37 creating build/temp.linux-x86_64-cpython-37/torchsparse creating build/temp.linux-x86_64-cpython-37/torchsparse/backend creating build/temp.linux-x86_64-cpython-37/torchsparse/backend/convolution creating build/temp.linux-x86_64-cpython-37/torchsparse/backend/devoxelize creating build/temp.linux-x86_64-cpython-37/torchsparse/backend/hash creating build/temp.linux-x86_64-cpython-37/torchsparse/backend/hashmap creating build/temp.linux-x86_64-cpython-37/torchsparse/backend/others creating build/temp.linux-x86_64-cpython-37/torchsparse/backend/voxelize /usr/local/cuda/bin/nvcc -I/home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages/torch/include -I/home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages/torch/include/TH -I/home/zqcz/.conda/envs/neucon/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zqcz/.conda/envs/neucon/include/python3.7m -c torchsparse/backend/convolution/convolution_backward_wgrad_implicit_gemm_cuda.cu -o build/temp.linux-x86_64-cpython-37/torchsparse/backend/convolution/convolution_backward_wgrad_implicit_gemm_cuda.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -O3 -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=backend -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 nvcc fatal : Unsupported gpu architecture 'compute_86' error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for torchsparse Running setup.py clean for torchsparse Failed to build torchsparse ERROR: Could not build wheels for torchsparse, which is required to install pyproject.toml-based projects

zhijian-liu commented 9 months ago

Please install the latest TorchSparse with

python -c "$(curl -fsSL https://raw.githubusercontent.com/mit-han-lab/torchsparse/master/install.py)"
ys-2020 commented 9 months ago

Please install the latest TorchSparse with

python -c "$(curl -fsSL https://raw.githubusercontent.com/mit-han-lab/torchsparse/master/install.py)"

It seems that this error is caused by the conflict between your nvcc and GPU architecture, rather than torchsparse. Please double check your CUDA environment and try to install the latest TorchSparse as mentioned above.

ys-2020 commented 9 months ago

Close this issue due to inactivity. Please feel free to reopen it if you have any further questions.

PatrickEleeve commented 5 months ago

Still can't solve this problem....