-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I spent 4 days trying to compile the C++ library of this library, and this is the only solution that worked. #707
Comments
Hi @EternalSaga,
but got the following error about accessing the header files (though they do exist). Have you ever encountered such issues? I suppose there would be some additional settings in CMakeLists.
|
I found out that I forgot to prepare spconv/CMakeLists.txt. It works like a charm with this repo's example:
|
@barrydoooit |
A little bit improvements with barrydoooit's suggestion. FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 AS basebuild
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt install -y lsb-release wget software-properties-common gnupg
RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
RUN apt update && apt install lsb-release wget software-properties-common gnupg -y && apt update && apt upgrade -y && apt install -y vim wget gdb pkg-config autoconf automake build-essential git libpoco-dev uuid-dev libncurses5-dev python3-dev python3-pip \
libtool libc6 libc6-dev unzip libnuma1 libnuma-dev libturbojpeg0-dev apt-utils \
&& python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1A127079A92F09ED && apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && apt update && apt install -y cmake
WORKDIR /workspace
FROM basebuild as build_stage
RUN git clone https://github.com/traveller59/spconv.git && git clone https://github.com/FindDefinition/cumm
# set environmnet variables for building cumm
ENV CUMM_CUDA_VERSION=12.2
ENV CUMM_DISABLE_JIT=1
ENV SPCONV_DISABLE_JIT=1
ENV CUMM_INCLUDE_PATH=/workspace/cumm/include
ENV CUMM_CUDA_ARCH_LIST="8.9"
# install pccm for building cumm wheel
RUN pip3 install wheel pccm -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN cd /workspace/cumm && git checkout v0.5.3 && python3 setup.py bdist_wheel && pip3 install dist/cumm_cu122-0.5.3-cp310-cp310-linux_x86_64.whl
# remove cumm depandance for building spconv
COPY pyproject.toml /workspace/spconv/pyproject.toml
ENV PATH=/usr/local/cuda-12.2/bin${PATH:+:${PATH}}
ENV LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
RUN cd /workspace/spconv && mkdir ./cpp
# from example/libspconv/spconv/CMakeLists.txt
COPY CMakeLists.txt /workspace/spconv/cpp/CMakeLists.txt
RUN cd /workspace/spconv && python3 setup.py bdist_wheel && python3 -m spconv.gencode --include=./cpp/include --src=./cpp/src
RUN cd /workspace/spconv/cpp/ && mkdir build && cmake . -B ./build && \
cmake --build ./build --config Release --parallel $(nproc) --target install
RUN mkdir -p ./libspconv/lib && mkdir -p ./libspconv/include
# make sure the cumm headers have been moved out with spconv heads
RUN mv /usr/local/lib/libspconv.so ./libspconv/lib && mv /workspace/spconv/cpp/include ./libspconv/ && mv /workspace/cumm/include/tensorview ./libspconv/include/
FROM basebuild
RUN apt install -y gcc-12 g++-12
RUN wget https://apt.llvm.org/llvm.sh && chmod +x ./llvm.sh && ./llvm.sh 18 -s && rm ./llvm.sh
COPY --from=build_stage /workspace/libspconv /usr/local/libspconv
|
Thanks for sharing! For me (RTX 2060, i.e. sm_75) the necessary thing to build
instead of just
Otherwise, I got various errors concerning |
Here is the Dockerfile which can build the C++ library successfully, but it requires several workarounds for successful building.
Please make it easier for C++ inference. I'd appreciate any suggestions for streamlining the process.
Please notice that the pyproject.toml file should be prepared first which used to be copied into the building container.
Then run:
docker build -t spconv:x86 --output ./out .
You can get the libspconv.so in your output direcotry.
The text was updated successfully, but these errors were encountered: