Skip to content

[Installation] Building on linux Debian 13 is missing openmp shared library #368

@hradec

Description

@hradec

Is there an existing issue for this?

  • I have searched the existing issues

Have you followed all the steps in the FAQ?

  • I have tried the steps in the FAQ.

Current Behavior

After building it correctly without issues (on linux debian 13), I'm seeing this error:

 ImportError: comfyui/custom_nodes/ComfyUI-Direct3D-S2/torchsparse/torchsparse/backend.cpython-311-x86_64-linux-gnu.so: undefined symbol: __kmpc_for_static_fini 

A google search told me the symbol __kmpc_for_static_fini is because the .so was compiled without -openmp parameter to add the shared library dependency to do .so file, so the backend so file is not loading openmp shared library.
So I added -openmp the cxx flags in setup.py, but then it fails to build because it wants .o files with "_cpu" suffix, but it build then with suffix "_cuda":

    clang++ -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_backward_wgrad_implicit_gemm_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_backward_wgrad_implicit_gemm_sorted_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_forward_fetch_on_demand_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_forward_implicit_gemm_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_forward_implicit_gemm_sorted_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_gather_scatter_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_gather_scatter_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/devoxelize/devoxelize_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/devoxelize/devoxelize_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/hash/hash_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/hash/hash_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/hashmap/hashmap_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/count_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/count_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/downsample_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/exclusive_scan_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/query_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/query_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/reduce_bitmask_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/reorder_map_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/sparsemapping_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/pybind_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/voxelize/voxelize_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/voxelize/voxelize_cuda.o -L/NVME/comfyui/tools/LPy64-3.11.10/install/lib/python3.11/site-packages/torch/lib -L/NVME/comfyui/tools/cuda/12.8.0/linux/lib64 -L/install/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-311/torchsparse/backend.cpython-311-x86_64-linux-gnu.so
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_gather_scatter_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/devoxelize/devoxelize_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/hash/hash_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/hashmap/hashmap_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/count_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/query_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/voxelize/voxelize_cpu.o'
    error: command '/usr/bin/clang++' failed with exit code 1

I'm running this on Linux Debian 13, Python 3.11, pytorch 2.8 and cuda 12.8.

Error Line

ImportError: comfyui/custom_nodes/ComfyUI-Direct3D-S2/torchsparse/torchsparse/backend.cpython-311-x86_64-linux-gnu.so: undefined symbol: __kmpc_for_static_fini

Environment

- GCC: 12.2
- NVCC: cuda_12.8.r12.8/compiler.35404655_0
- PyTorch: 2.8
- PyTorch CUDA: 12.8

Full Error Log

  ImportError: comfyui/custom_nodes/ComfyUI-Direct3D-S2/torchsparse/torchsparse/backend.cpython-311-x86_64-linux-gnu.so: undefined symbol: __kmpc_for_static_fini 

The command FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/torchsparse.git builds fine, but I get the import error above.

It's missing -openmp cxx flag to include libopenmpt.so.0 as a shared library, but adding it to setup.py cxx flags, causes this compilation error with FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/torchsparse.git :

   clang++ -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_backward_wgrad_implicit_gemm_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_backward_wgrad_implicit_gemm_sorted_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_forward_fetch_on_demand_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_forward_implicit_gemm_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_forward_implicit_gemm_sorted_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_gather_scatter_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_gather_scatter_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/devoxelize/devoxelize_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/devoxelize/devoxelize_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/hash/hash_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/hash/hash_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/hashmap/hashmap_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/count_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/count_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/downsample_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/exclusive_scan_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/query_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/query_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/reduce_bitmask_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/reorder_map_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/sparsemapping_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/pybind_cuda.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/voxelize/voxelize_cpu.o build/temp.linux-x86_64-cpython-311/torchsparse/backend/voxelize/voxelize_cuda.o -L/NVME/comfyui/tools/LPy64-3.11.10/install/lib/python3.11/site-packages/torch/lib -L/NVME/comfyui/tools/cuda/12.8.0/linux/lib64 -L/install/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-311/torchsparse/backend.cpython-311-x86_64-linux-gnu.so
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/convolution/convolution_gather_scatter_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/devoxelize/devoxelize_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/hash/hash_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/hashmap/hashmap_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/count_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/others/query_cpu.o'
    clang: error: no such file or directory: 'build/temp.linux-x86_64-cpython-311/torchsparse/backend/voxelize/voxelize_cpu.o'
    error: command '/usr/bin/clang++' failed with exit code 1

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