Skip to content

build: support CUDA 12.8 / torch 2.8 / GCC 11+ host compiler - #639

Open
WhaleK1123 wants to merge 1 commit into
NVIDIA:masterfrom
WhaleK1123:fix/build-cuda12.8-gcc13
Open

build: support CUDA 12.8 / torch 2.8 / GCC 11+ host compiler#639
WhaleK1123 wants to merge 1 commit into
NVIDIA:masterfrom
WhaleK1123:fix/build-cuda12.8-gcc13

Conversation

@WhaleK1123

Copy link
Copy Markdown

What

Makes the CUDA sparse-conv backend build with a modern toolchain
(CUDA 12.8 thrust/CCCL, torch 2.8, GCC 11 or 13). Without this, the
backend fails to compile on Blackwell GPUs (e.g. RTX 5070 Ti / sm_120).

Fixes

  • Add missing explicit <thrust/*> algorithm includes (new thrust requires
    explicit includes; ME relied on transitive ones).
  • Disable ME's bundled nvtx3 (nvtx3.hpp / ranges.hpp), which collides
    with torch's nvtx3; add a no-op CUDF_FUNC_RANGE().
  • Make default_allocator / c10_allocator conformant.
  • concurrent_unordered_map::create() returns std::shared_ptr<Self>
    instead of unique_ptr — the unique_ptr→shared_ptr conversion triggers a
    libstdc++ std::__to_address overload ambiguity on GCC 11 and 13.

Verification

CUDA 12.8 / torch 2.8.0+cu128 / RTX 5070 Ti (sm_120):
ME.is_cuda_available() == True, cuda_version() == 12080,
SparseTensor -> MinkowskiConvolution runs on cuda:0.

Closes #638.

MinkowskiEngine 0.5.4 (master) fails to compile on a modern toolchain
(CUDA 12.8 thrust/CCCL, torch 2.8, GCC 11/13). The sparse-conv CUDA
backend needs these compatibility fixes:

- Add explicit <thrust/sort.h>, <thrust/unique.h>, <thrust/sequence.h>,
  <thrust/reduce.h>, <thrust/remove.h>, <thrust/count.h>, <thrust/copy.h>,
  <thrust/fill.h>, <thrust/device_vector.h>, <thrust/iterator/zip_iterator.h>,
  <thrust/tuple.h>, <thrust/execution_policy.h> includes. New thrust
  requires explicit includes; ME relied on transitive ones.
- Disable ME's bundled nvtx3 (nvtx3.hpp / ranges.hpp) which collides with
  torch's nvtx3. Add a no-op CUDF_FUNC_RANGE() so the cudf path still
  compiles.
- Make default_allocator / c10_allocator fully conformant (pointer,
  const_pointer, size_type, difference_type, rebind, ==/!=).
- Make concurrent_unordered_map::create() return std::shared_ptr<Self>
  instead of unique_ptr. The unique_ptr->shared_ptr conversion triggers a
  GCC libstdc++ std::__to_address overload ambiguity on both GCC 11 and 13.

Build with:
  export CUDA_HOME=/usr/local/cuda-12.8
  export TORCH_CUDA_ARCH_LIST="12.0"
  export SETUPTOOLS_USE_DISTUTILS=stdlib
  export CC=gcc-13 CXX=g++-13
  python setup.py build_ext --inplace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] CUDA sparse-conv backend fails to compile with CUDA 12.8 / torch 2.8 / GCC 11+

1 participant