记录MinkowskiEngine 安装过程中的踩坑经历

系统版本 ubuntu 22.04 + cudnn12.2.2

torch版本同embodiedscan安装教程:

pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3

在按照https://www.cnblogs.com/mstk/p/16585508.html 的教程进行安装时出现许多报错

记录如下:

第一次报错:

RuntimeError: 
The detected CUDA version (12.2) mismatches the version that was used to compile

检测到的cuda版本与安装的torch_cuda版本不符

参考:https://blog.csdn.net/weixin_43536737/article/details/134350226?spm=1001.2014.3001.5506

把检查版本的代码注释掉就行

第二次报错:

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/root/anaconda3/envs/embodiedscan/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1740, in _run_ninja_build
    subprocess.run(
  File "/root/anaconda3/envs/embodiedscan/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '12']' returned non-zero exit status 1.

....

RuntimeError: Error compiling objects for extension

先使用 pip uninstall ninja 把ninja卸载了就行

第三次报错:

1 error detected in the compilation of "/root/experiments/EmbodiedScan/MinkowskiEngine/src/broadcast_gpu.cu".
error: command '/usr/local/cuda/bin/nvcc' failed with exit code 2

是我的环境变量中没有添加cuda的路径

使用vim ~/.bashrc 

在文件末尾添加:

# cuda

export LD_LIBRARY_PATH=/usr/local/cuda/lib64

export PATH=$PATH:/usr/local/cuda/bin

输入 nvcc -V 能正常输出版本就行

第四次报错:

1 error detected in the compilation of "/root/experiments/EmbodiedScan/MinkowskiEngine/src/broadcast_gpu.cu".
error: command '/usr/local/cuda-12.2/bin/nvcc' failed with exit code 2

按照:https://github.com/NVIDIA/MinkowskiEngine/issues/543

在几个文件中加上这些头文件后,再次安装,终于可以了!

测试安装是否成功:

$ python
$ >>> import MinkowskiEngine as ME
// 没有报错说明 OK
$ >>> exit()
$ python -c "import MinkowskiEngine as ME; print(ME.__version__)"
$ 0.5.2

第五次报错:

cblas.h: No such file or directory

failed with exit code 1

解决办法

apt-get install libopenblas-dev

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值