安装gcc7,默认gcc9太高了
sudo vim /etc/apt/sources.list
deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
source /etc/apt/sources.list
sudo apt update
sudo apt install gcc-5 g++-5
sudo apt install gcc-7 g++-7
原本我的miniconda torch-points3d环境
cuda_10.1.168_418.67_linux.run
cudnn-10.1-linux-x64-v7.6.5.32
torch-1.7.0+cu101-cp37-cp37m-linux_x86_64.whl
torchvision-0.8.1+cu101-cp37-cp37m-linux_x86_64.whl
torch_cluster-1.5.8+cu101-cp37-cp37m-linux_x86_64.whl
torch_scatter-2.0.5+cu101-cp37-cp37m-linux_x86_64.whl
torch_sparse-0.6.8+cu101-cp37-cp37m-linux_x86_64.whl
torch_spline_conv-1.2.0+cu101-cp37-cp37m-linux_x86_64.whl
然后如果想使用MinkowskiEngine
https://github.com/NVIDIA/MinkowskiEngine#anaconda
必须满足
我看了一下,我们外部CUDA环境不满足
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Apr_24_19:10:27_PDT_2019
Cuda compilation tools, release 10.1, V10.1.168
所以我直接使用conda安装虚拟CUDA,这样既不会捣乱我们外部环境,也可以完成安装
参考:
https://github.com/NVIDIA/MinkowskiEngine#anaconda
sudo apt-get install gfortran
sudo apt-get install libopenblas64-dev -y
sudo apt-get install libopenblas-dev -y
~/environment/mmlab_point3d_open3d/bin/conda env list
*base
*torch-points3d-1.3
source ~/environment/mmlab_point3d_open3d/bin/activate torch-points3d-1.3
pip install ninja
conda install openblas-devel -c anaconda
conda install -y -c conda-forge -c pytorch torchvision pytorch=1.7.1 cudatoolkit=10.1
如果conda遇到下载不下来的情况,使用浏览器下载然后安装,比如;
https://repo.anaconda.com/pkgs/main/linux-64/mkl-2021.3.0-h06a4308_520.conda
conda install ~/下载/mkl-2021.3.0-h06a4308_520.conda
https://codeload.github.com/NVIDIA/MinkowskiEngine/zip/refs/tags/v0.5.3
cd MinkowskiEngine-0.5.4
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas
会很慢,而且,由于占用很多线程编译,电脑会很卡
torch-points3d-v1.3必须安装1.1.0,安装最新版torchsparse1.4会出错
https://github.com/mit-han-lab/torchsparse
sudo apt-get install libsparsehash-dev
pip install --upgrade git+https://github.com/mit-han-lab/[email protected]
或
https://github.com/mit-han-lab/torchsparse/tree/v1.1.0
cd
python setup.py install