In order to avoid the reader to step on the pit, this article successfully tested the Ubuntu18.04 environment configuration deep learning environment:
(GPU:NVIDIA TITAN Xp), including:
Installation and testing of CUDA+CUDNN+TensorFlow1.9+Pytorch1.1.
I. Hardware configuration \
Ultra – micro tower server
Graphics card NVIDIA TITAN Xp *4 Memory 128G CPU 2620V4* 2 Power supply 1600W *2 Hard disk 256G*2+2T*2
1. Install Ubuntu. Use a USB flash drive to install the Ubuntu OPERATING system.
Jingyan.baidu.com/article/a37… At the beginning of the installation, select “Install Ubuntu” and press enter. After a while, if the screen displays “Input not supported”, which is related to Ubuntu’s support for graphics cards, select Nomodeset on the F6 screen of the main installation screen and proceed to the next installation. The installation process is omitted. Download the installation image from ubuntu.com/download/des: Ubuntu-18.04.2-desktop-amd64.iso
Note: Enter SSH in the command window on the server desktop. After this step, you can use SSH to remotely connect to the server. XShell is used in this document.
sudo apt-get install openssh-server
Copy the code
3. Install NVIDIA TITAN Xp graphics drivers The default graphics drivers installed are not NVIDIA drivers, so remove the old drivers first.
sudo apt-get purge nvidia*
Copy the code
Add Graphic Drivers PPA
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
Copy the code
View the appropriate driver version:
ubuntu-drivers devices
Copy the code
Figure: List of available Nvidia drivers
It can be seen that the recommended driver is the latest 430 version, install the driver: \
sudo apt-get install nvidia-driver- 430.
Copy the code
Restart the machine after installation:
sudo reboot
Copy the code
Restart complete run
nvidia-smi
Copy the code
Take a look at the graphics card driver in effect:
Figure: Graphics card driver in effect
4. Install the dependency library \
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-devlibgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
Copy the code
GCC Lowered version CUDA9.0 requires the GCC version to be 5.x or 6.x. You need to configure the GCC version by yourself. \
- Version installed
Sudo apt-get install GCC- 5
sudo apt-get install g++- 5
Copy the code
- Replace the previous version with a command
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc- 5 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++- 5 50
Copy the code
6. Install Anaconda and TensorFlow, Keras and PyTorch
** Key: Let Conda install CUDA and CUDNN automatically!! ** Since Anaconda provides a complete scientific library, you can use Anaconda directly for installation. 1) installation Anaconda download address: www.anaconda.com/download/ here we download Python 3.7 64 – bit Linux version. Installation:
bash Anaconda32019.03-Linux-x86_64.sh
Copy the code
2) Change PIP and conda to domestic source. Since it is slow to access PIP and conda in China, it is suggested to change to domestic source: a. Change the source of PIP to Aliyun:
mkdir ~/.pip
Copy the code
cat > ~/.pip/pip.conf << EOF
[global]
trusted-host=mirrors.aliyun.com
index-url=https://mirrors.aliyun.com/pypi/simple/
EOF
Copy the code
3) Install Python3.7 in Anaconda to create a Python virtual environment
conda create --name tf python=3.7Create a TF environmentCopy the code
Virtual environment commands:
Conda remove --name tf --all # delete the tf environmentCopy the code
4) Install TensorFlow GPU 1.9 in Anaconda
conda install tensorflow-gpu==1.9
Copy the code
Cuda, CUDNN and other related components will be installed automatically.
source activate tf
python
Copy the code
Enter the following code from the Python command:
import tensorflowas tf
hello= tf.constant('Hello, TensorFlow! ')
sess= tf.Session()
print(sess.run(hello))
Copy the code
No error is configured. 6) Install Keras directly in this virtual environment:
pip install keras
Copy the code
Install Pytorch directly in this virtual environment:
conda install pytorch torchvision -c pytorch
Copy the code
Cuda and CUDNN will be automatically installed to test Pytorch.
source activate tf
python
Copy the code
Enter the following code from the python command:
import torch
print(torch.cuda.is_available())
Copy the code
If True is returned, the installation succeeded.
In order to avoid the reader to step on the pit, this article successfully tested the installation and test of CUDA+CUDNN+TensorFlow1.9+Pytorch1.1 in Ubuntu18.04 environment. Reference blog.csdn.net/weixin_4186…
Please follow and share ↓↓↓\
ID: 92416895\
Currently, it ranks no.1 in the knowledge planet of machine learning
Past wonderful review \
-
Conscience Recommendation: Introduction to machine learning and learning recommendations (2018 edition) \
-
Github Image download by Dr. Hoi Kwong (Machine learning and Deep Learning resources)
-
Printable version of Machine learning and Deep learning course notes \
-
Machine Learning Cheat Sheet – understand Machine Learning like reciting TOEFL Vocabulary
-
Introduction to Deep Learning – Python Deep Learning, annotated version of the original code in Chinese and ebook
-
The mathematical foundations of machine learning
-
Machine learning essential treasure book – “statistical learning methods” python code implementation, ebook and courseware
-
Blood vomiting recommended collection of dissertation typesetting tutorial (complete version)
-
Installation of Python (Anaconda+Jupyter Notebook +Pycharm)
-
What if Python code is ugly? Recommend a few artifacts to save you
-
Blockbuster | complete AI learning course, the most detailed resources arrangement!