Skip to content

[BUG] Installation Fails on Modern Stack (PyTorch 2.4, CUDA 12.1, Python 3.11, GCC 13) β€” Please Consider Future CompatibilityΒ #353

@hippoley

Description

@hippoley

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

🧠 Overview

Hello maintainers,
I’d like to share the issues I faced when trying to set up TorchSparse on a modern development environment, and hopefully get advice on any workarounds β€” or initiate a discussion for future compatibility updates.


πŸš€ Goal

To build and use torchsparse with GPU acceleration for high-performance point cloud processing tasks on a modern CUDA-capable system.


πŸ§ͺ Reproduction Environment

Component My Version TorchSparse Compatibility
OS Ubuntu 22.04 βœ…
Python 3.11 ❌ (<= 3.10)
PyTorch 2.4.0 ❌ (1.13 ~ 2.0.x)
CUDA 12.1 ❌ (11.1 ~ 11.8)
GCC 13.3.0 ❌ (CUDA 11.x only supports <= GCC 11)

❌ What Went Wrong

1. πŸ”§ Installation Command:

pip install git+https://github.com/mit-han-lab/torchsparse.git

2. 🧨 Compile Errors:

<command-line>: fatal error: cuda_runtime.h: No such file or directory
cuda_fp8.hpp: error: missing binary operator before token "("
(__CUDA_ARCH_HAS_FEATURE__(SM100_ALL)) || ...

3. πŸ•΅οΈ Root Causes Identified:

  • cuda_runtime.h and cuda_fp8.hpp were missing due to CUDA_HOME not being picked up correctly.
  • Conda's symbolic link to nvcc conflicted with system-installed CUDA.
  • cuda_fp8.hpp errors indicated macro incompatibility with GCC 13.
  • Even manually creating fallback macros didn’t solve all compile issues.
  • GCC version > 11 is simply not compatible with CUDA 11.8 (required by TorchSparse).

πŸ› οΈ Troubleshooting Attempts

βœ… Attempted Fixes:

  • Forced compilation with --allow-unsupported-compiler

  • Created header patch:

    #ifndef __CUDA_ARCH_HAS_FEATURE__
    #define __CUDA_ARCH_HAS_FEATURE__(x) 0
    #endif
  • Installed older GCC:

    conda install -c conda-forge gcc_linux-64=11 gxx_linux-64=11
  • Set environment variables:

    export CUDA_HOME=$CONDA_PREFIX
    export CUDACXX=$CUDA_HOME/bin/nvcc
    export CPATH=$CUDA_HOME/include:$CUDA_HOME/targets/x86_64-linux/include
    export TORCH_CUDA_ARCH_LIST="7.5"
  • Tried source install with:

    pip install -v -e .

❌ Result:

None of these efforts led to a successful GPU build.


βœ… Temporary Workaround: CPU-Only Mode

Eventually, I got it working with the CPU backend only:

conda create -n scenescript python=3.10 pytorch=2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia -y
conda activate scenescript
export FORCE_CPU=1
pip install git+https://github.com/mit-han-lab/torchsparse.git

No CUDA was compiled, but it successfully installed and runs on CPU.


πŸ“Œ Notes for Others

  • Don’t mix system CUDA and conda CUDA.
  • Use Python ≀ 3.10.
  • Downgrade GCC to ≀ 11 via conda-forge.
  • Use FORCE_CPU=1 if you need to proceed without GPU.

πŸ™‹ My Requests to Maintainers

Would you consider providing any of the following?

  1. βœ… A reference conda environment file (environment.yml) that does support GPU?
  2. πŸ“¦ A Dockerfile that guarantees successful GPU compilation (with exact PyTorch, CUDA, Python, GCC)?
  3. πŸ›£οΈ A compatibility roadmap β€” e.g., plans to support PyTorch 2.1+, CUDA 12.x, Python 3.11+?
  4. πŸ”§ A patched or future-proofed build system that fails more gracefully or has better version checks?

πŸ’¬ Final Thoughts

TorchSparse is critical for several point cloud projects β€” especially for high-speed inference and voxelization. It would be amazing to have either:

  • A prebuilt wheel for common environments
  • Or a minimal set of installable requirements that allow GPU build to succeed

I’d be happy to test or contribute to compatibility improvements if needed.

Thanks for all the work you’ve done maintaining this project!

Expected Behavior

No response

Environment

- GCC:
- NVCC:
- PyTorch:
- PyTorch CUDA:
- TorchSparse:

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions