Skip to content

Environment Setup for Non-Root Users (No Sudo Required) #194

@LiYuxian0306

Description

@LiYuxian0306

Highly appreciated to the guide in #192.

Based on the overall frame in #192, this environment setup pipeline is for users without sudo, which installs gcc and g++ inside the conda environment and uses local cuda (11.8).

git clone https://github.com/JonasSchult/Mask3D.git
cd Mask3D

conda create -n mask3d python=3.10     gxx_linux-64=11 gcc_linux-64=11 sysroot_linux-64 make cmake     -c conda-forge -y

conda activate mask3d

#python --version  #Python 3.10.9
#which python  #under miniconda/anaconda

pip install pip==24.0  #too high version will cause mismatch errors later
pip install "cython<3.0.0"

pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 pytorch-lightning==1.7.2 torchmetrics==0.11.4 --extra-index-url https://download.pytorch.org/whl/cu113

pip install cython numpy setuptools  #likely "already installed"

#test
#conda list python      #If you install gcc later (conda install -c conda-forge gcc=11 -y) instead of using conda-forge together with python at the beginning as shown in front, it could happen that:
#The following packages will be SUPERSEDED by a higher-priority channel:
#python                pkgs/main::python-3.10.9-h7a1cb2a_2 --> conda-forge::python-3.10.8-0_native230_graalpy
# and this will cause error "ImportError: Failed to load PyTorch C extensions ..." when installing detectron2


export CUDA_HOME=/usr/local/cuda-11.8
export PATH=/usr/local/cuda-11.8/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH
export TORCH_CUDA_ARCH_LIST="6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6"
export CPATH=$CONDA_PREFIX/include:$CPATH

pip3 install 'git+https://github.com/facebookresearch/detectron2.git@710e7795d0eeadf9def0e7ef957eea13532e34cf'

pip install torch-scatter==2.1.0+pt112cu113     -f https://data.pyg.org/whl/torch-1.12.1+cu113.html     --force-reinstall --no-cache-dir
# if not specified, it could cause the following error when testing:
# python -c "import torch; import torch_scatter; print('Scatter OK')"
# Segmentation fault (core dumped)
# Similarly, you can test detectron2

pip install --no-build-isolation "pyyaml==5.4.1"
pip install hydra-core==1.0.5

conda install -c conda-forge pycocotools
pip install numpy==1.23.5 tensorboard loguru natsort fire scikit-learn scikit-image pillow==9.5.0 matplotlib pyviz3d python-dotenv plyfile trimesh wandb==0.15.0 fvcore cloudpickle albumentations==1.2.1

pip install open3d==0.17.0 pandas==2.0.0 pyquaternion==0.9.9 ruamel.yaml==0.17.21 scipy==1.9.0 trimesh==3.14.0 numpy==1.24.2



pip install -U git+https://github.com/kumuji/volumentations
pip install volumentations --no-build-isolation
pip uninstall importlib-metadata


conda install -c conda-forge openblas=0.3.21 openblas-devel=0.3.21
export CPLUS_INCLUDE_PATH=$CONDA_PREFIX/include:$CONDA_PREFIX/include/openblas:$CPLUS_INCLUDE_PATH
export C_INCLUDE_PATH=$CONDA_PREFIX/include:$CONDA_PREFIX/include/openblas:$C_INCLUDE_PATH
# the version of openblas is essential, if the version is too low, it will cause error when import ME after installation (ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory); 
# ie ME thus depends on libgfortran.so.3, which is too old and not compatible with the gcc version you are using

cd third_party
git clone --recursive "https://github.com/NVIDIA/MinkowskiEngine"
cd MinkowskiEngine
git checkout 02fc608bea4c0549b0a7b00ca1bf15dee4a0b228
python setup.py install --blas=openblas
#test
#python -c "import MinkowskiEngine as ME; print(ME.__version__)"

cd ..
cd pointnet2
python setup.py install
#test
#python -c "import pointnet2; print('PointNet2 import success')"


pip install   addict==2.4.0   boltons==23.0.0   brotlipy==0.7.0   cryptography==39.0.1   dash==2.9.3   dash-core-components==2.0.0   dash-html-components==2.0.0   dash-table==5.0.0   fastapi==0.95.1   flask==2.2.3   google-auth==2.17.3   google-auth-oauthlib==1.0.0   hydra-core==1.0.5   ipykernel==6.22.0   ipython==8.12.0   jsonpatch==1.32   jsonpointer==2.1   open3d==0.17.0   pandas==2.0.0   plotly==5.14.1   pyquaternion==0.9.9   ruamel.yaml==0.17.21   scikit-image==0.20.0   scikit-learn==1.1.2   scipy==1.9.0   stack-data==0.6.2   toolz==0.12.0   trimesh==3.14.0   uvicorn==0.21.1   zstandard==0.19.0 werkzeug==2.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions