minkowskiengine安装

注意,因为最终编译产物要放在 python的目录下,所以如果使用conda,一定要注意激活环境。 推荐使用python3.10

我们下载一个补丁版本:git clone -b cuda-12-1 –single-branch https://gitee.com/ctbots/mirror-MinkowskiEngine.git

因为原版的https://github.com/NVIDIA/MinkowskiEngine 很久不维护了,对12.x 的cuda 有点兼容性问题。

注意使用gcc9,不然会有报错:

pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 | function(_Functor&& __f)
      | ^
...
error: command '/usr/bin/nvcc' failed with exit code 1

整体编译命令如下:

sudo apt install gcc-9 g++-9 -y
export CC=gcc-9
export CXX=g++-9
export CUDAHOSTCXX=g++-9

git clone -b cuda-12-1 --single-branch https://gitee.com/ctbots/mirror-MinkowskiEngine.git
cd MinkowskiEngine
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas

编译之后不要切换python版本,否则需要重来