Ubuntu18.04 reproduces RandLA-Net (SemanticKITTTI data set)----1. Environment configuration

The installation environment of this article: CUDA11.1 cuDNN8.0.4 TensorFlow1.15.4.

The RandLA-Net project takes up a relatively large amount of memory to run. When installing the system, the /home folder must allocate about 400G of memory space. Otherwise, the subsequent project will not run.

1.Environment configuration

This article uses ubuntu18.04 to reproduce RandLA-Net, and the deep learning framework used is TensorFlow1.15.4.

No matter what kind of deep learning framework you build, you must first know what environments you want to install. The second step is to determine the environment version. Configure the installation packages required for the deep learning environment. The required installation packages are as follows:

1) Anaconda------container, used for environment management, in which multiple different deep learning environments can be created

2) GPU tool chain-----Nvidia graphics card, graphics card driver, CUDA tool kit, cuDNN tool kit

  • CUDA (Compute Unified Device Architecture, Computing Organization Platform) is a new hardware and software architecture launched by NVIDIA to operate GPU computing, which can solve complex problems. CUDA support depends on the graphics card driver version
  • cuDNN (GPU acceleration library) is a GPU acceleration library for deep neural networks. It mainly emphasizes performance, ease of use and low memory overhead. NVIDIA's cuDNN can be integrated into higher-level machine learning frameworks to accelerate the training of neural networks
  • Deep learning frameworks mainly include: TensorFlow, PyTorch, Caffe, Keras, etc.

RandLANet related information:

RandLANet source project

Zhihu blog project explanation by the author of RandLANet: [CVPR 2020 Oral] RandLA-Net: A new framework for semantic segmentation of 3D point clouds in large scenes (open source) - Zhihu

RandLANet original text link: https://arxiv.org/abs/1911.11236

1.1 Determination of environment installation package version

The most troublesome part in configuring the environment is determining the version of each installation package. It is not particularly difficult. I will explain it one by one below. Overall idea: According to the installed deep learning framework, determine the required CUDA version, graphics card driver version and cuDNN version in sequence. Take TensorFlow as an example: TensorFlow version >> CUDA version >> graphics driver version and cuDNN version.

I installed TensorFlow 1.15.4 and viewed it on the TensorFlow official website ( you need to access the Internet scientifically. If you cannot access the Internet scientifically, you may not be able to enter the TensorFlow official website ). You can see that the installation package versions required by TensorFlow1.15 are: CUDA10.0, cuDNN7.4, python2.7 or python3.3-3.7. But my graphics card is 3060, and 30 series graphics cards only support version 11.1 and above. So I chose to install CUDA11.1 cuDNN8.0.4 and python3.6. Next, install these packages one by one.

 Similarly, the steps to install PyTorch are the same. First go to the PyTorch official website to check the corresponding version. If you want to install Pytorch1.13.1, check the CUDA version required by PyTorch1.13.1, CUDA11.6 or CUDA11.7. Then look for the cuDNN version and graphics card driver version required by CUDA11.7.

1.2 Environment installation sequence

Anaconda >> Graphics driver >> CUDA11.1 >> cuDNN8.0.4 >> TensorFlow1.15.4

1.Anaconda installation

Anaconda is a container in which different deep learning environments can be created. Install the latest version directly. andaconda official website download and install the package anaconda official website :

 Check out the blog for the rest of the installation steps: Restart, restart, restart! Be sure to restart after installation.

anaconda installation

2. Graphics card driver installation

Graphics card driver installation, the graphics card driver does not have to be installed according to the CUDA version, just install the recommended version. The installation is mainly divided into two steps. The first step is to disable nouveau, and the second step is to install the driver.

1) Disable nouveau

The nouveau open source driver conflicts with the NVIDIA driver. If the device has the nouveau driver installed, the NVIDIA driver will not be installed normally.

In the terminal enter:

sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

Then, enter the following code to see if the disablement is successful:

cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf

The terminal displays:

blacklist nouveau
options nouveau modeset=0

Indicates successful disabling.

2) Install the driver

Restart the kernel first, and the kernel restart code:

sudo update-initramfs -u

Restart the system.

Use the "Additional Drivers" tab in the "Software & Updates" application to install the Nvidia driver. The system will first search for available drivers. After the search is completed, find a suitable one and click Apply Changes. The system will automatically install it ( it may take about half an hour, please be patient ).
For example: Select Using NVIDIA driver metapackage from nvidia-driver-525(proprietary).

 After the installation is complete, reboot.

After restarting, enter in the terminal:

nvidia-smi

The following content is displayed to prove that the installation is successful.

3.CUDA11.1.0 installation

Open NVIDIA's official website and download CUDA.

 I downloaded version 11.1.0, selected the corresponding configuration, copied the installation instructions, and installed it in the terminal

Then, install according to the following blog: Install cuda and cudnn on ubuntu18.04

4.cuDNN8.0.4 installation

Enter the cuDNN official website , find the appropriate cudnn version, and download the corresponding version of cuDNN's runtime developer and samples.

 After the download is complete, follow this blog to install: ubuntu18.04 install cuda and cudnn_cuda11.0.3 ubuntu18.04_FAST-ROBOT's blog-CSDN blog

At this point, the environment before installing the deep learning framework has been configured. Next, start configuring the deep learning environment.

5.TensorFlow1.15.4 installation

What I reproduce is RandLaNet, so after the installation of the above environment is completed, first create a virtual environment of randlanet, and install TensorFlow1.15.4 in the randlanet virtual environment. The code is as follows (note: select 3.6 when creating the environment here):

conda create -n randlanet python=3.6

You need to enter a y during the installation and then wait for the installation to complete.

 To activate the virtual environment, activate the command:

conda activate randlanet

The following operations are all performed in a virtual environment . Because the 30 series graphics cards do not support CUDA versions below 11.1, you need to install the dependencies before installing tensorflow. Create a txt file with any name on the desktop, such as require.txt, and copy the following corresponding version dependencies into it.

nvidia-cublas==11.2.1.74
nvidia-cuda-cupti==11.1.69
nvidia-cuda-nvcc==11.1.74
nvidia-cuda-nvrtc==11.1.74
nvidia-cuda-runtime==11.1.74
nvidia-cudnn==8.0.4.30
nvidia-cufft==10.3.0.74
nvidia-curand==10.2.2.74
nvidia-cusolver==11.0.0.74
nvidia-cusparse==11.2.0.275
nvidia-dali-cuda110==0.26.0
nvidia-dali-nvtf-plugin==0.26.0+nv20.10
nvidia-nccl==2.7.8
nvidia-pyindex==1.0.5
nvidia-tensorboard==1.15.0+nv20.10
nvidia-tensorrt==7.2.1.4
tensorflow-estimator==1.15.1

Switch to the desktop and use the following command to install the above dependencies:

After the dependency installation is complete, use pip to install TensorFlow1.15.4 directly. The command is as follows:

#安装tensorflow的索引
pip install nvidia-pyindex

#安装tensorflow
pip install nvidia-tensorflow==1.15.4

After the installation is complete, enter the following three commands to verify whether the installation is successful:

#先在终端输入python
python 

#测试tensorflow         
import tensorflow as tf
#查看版本
tf.__version__

#查看tensorflow是否可用
print('Num GPUs Available: ', len(tf.config.experimental.list_physical_devices('GPU')))

If there is no error message, the installation is successful.

At this point, the deep learning environment is set up. The next step is to install the packages required for the project and test the project.

Guess you like

Origin blog.csdn.net/m0_62648611/article/details/131666706