记录在复现论文pc2wf时安装MinkowskiEngine踩过的坑。
最初我使用cuda12.0进行安装,由于官方没有给出cuda12.0对应的pytorch版本,但查阅资料发现cuda12.0可以兼容cuda11.8对应的pytorch,但在安装时出现检测cuda版本和编译版本不匹配问题,在cpp_extention文件中注释检测cuda版本代码,仍然出现编译错误问题,当时认为是gcc版本问题,于是更换多个版本都无法解决问题。
最后通过更换cuda版本成功安装。测试过很多版本都有坑,亲测以下环境可以正常安装。
环境:cuda11.1 、gcc9.5.0、python3.8
安装过程:
1.安装pytorch:
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
2.安装依赖
conda install openblas-devel -c anaconda
3.安装MinkowskiEngine
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd MinkowskiEngine
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas
4.检查是否成功安装
python
>>> import MinkowskiEngine as ME
>>> print(ME.__version__)
0.5.4
>>> quit()
安装MinkowskiEngine最大的问题就是cuda、pytorch和gcc的版本匹配问题,如果需要建议使用大家尝试过且成功的版本,尝试不同版本很容易心态崩!