Following on from the previous day:

  • Special day, think of the double (1080TI) video card installed record

and

  • Alchemy furnace can’t afford to buy: chat about the graphics card market of this period of time

After that, I decided to buy a machine to play with.

And now, the host is finally back! Come on! ! What the host comes back for, of course, is to configure the environment.

Lao Pan also has some configuration environment before the article, you can refer to:

  • NVIDIA (cuda) -gtx965m installation in ubuntu16.04
  • Pytorch -0.2 successfully called GPU: Ubuntu16.04, Nvidia driver installation, and the latest CUDa9.0 and cudnnV7.0 configurations
  • Install PyTorch, Cuda9 and CUDN7.0 for Windows 10
  • Unable to locate the kernel source
  • Deep learning – installing CUDA9.1 on ubuntu16.04 – summary (problem full solution)
  • Install tensorflow-1.7.0-CUDa9.1-CUDnn7.1.2 on Ubuntu

-_ – | | I didn’t think that would write so many configuration environment, may be it will more problems… Match what of the environment, want to match step by step according to step strictly only actually, basically won’t appear what problem, appear a problem is we did not take a certain step commonly right, and return to walk again more troublesome just.

Now it is easy to get familiar with the configuration environment (I don’t know how many pits I stepped on in the past few years, and now I am impressed). It takes more than an hour to install Ubuntu and configure the deep learning environment strictly according to the steps.

So let’s talk a little bit more about the process.

  • Install Ubuntu 18.04 on Windows
  • Configure the Deep learning environment (Cuda+Cudnn+Pytorch+TensorRT)

The main engine looks like this

Let me show you a couple of pictures.

Night boot is still pretty cool, but in fact for Pan dazzle not dazzle is not important, good performance on the line…

Host configuration Environment

When the console came back, the store only installed Windows for me. For Pan, playing games was secondary (lol…). , resist the first download a ghost cry 5 play idea. First, download the official Ubuntu image package.

Officially the latest Ubuntu is 20.10, but for those who mess up, the 18.04 version is better (it was 16.04 in the lab).

Start with dual systems. Dual systems are a must. Ubuntu can be used for deep learning and as a server, while Windows can handle games and other emergent applications.

How to download Ubuntu image into a USB disk, how to install, pan will not repeat here. You can see the following article, the introduction is very detailed, I am in accordance with this strict implementation:

  • Windows install Ubuntu detailed tutorial

Of course, if you have any questions, please leave a message directly

The installation process

I don’t want to repeat it, but I’ll do it briefly:

Go to BIOS, select Ubuntu boot USB, and start installing Ubuntu:

Dot the rest of the way, and then simply divide.

Then start installing…

Wait half an hour, ready!

Set up SSH

Why set SSH, of course, is to allow Ubuntu to act as a server, after enabled can use SSH login to operate.

For example, I can first turn on the server, and then use another computer, such as a MAC, using a LAN to connect to the server through SSH.

How do I start SSH? New Ubuntu systems do not have SSH installed.

Run the following command:

sudo apt install openssh-server
sudo systemctl start ssh.service
Copy the code

Then by netstat LNP | grep 22 check for open.

If you want to automatically enable SSH every time you start it, you can do this:

sudo systemctl enable ssh
Copy the code

That’s enough.

Install the NVIDIA graphics card driver

Ubuntu uses llVMPipe as the default graphics driver. This is a public graphics driver for Linux, which needs to be replaced by NVIDIA.

First disable Nouveau.

Executing sudo gedit/etc/modprobe. D/blacklist. Conf

Add the following:

blacklist nouveau
options nouveau modest=0
Copy the code

After saving, then execute:

sudo updata-initramfs -u
sudo reboot
Copy the code

After rebooting, Ctrl+Alt+F1 toggles to the TTY screen and turns off Lightdm (if not, ignore it) :

sudo service lightdm stop
Copy the code

Then update apt source and take a look at the recommended NVIDIA driver version:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
ubuntu-drivers devices
Copy the code

Install NVIDIA drivers according to the recommended driver version:

sudo apt-get install nvidia-driver-460
Copy the code

If it is too slow, you can add Ali or Qinghua:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup
sudo gedit /etc/apt/sources.list
Copy the code

After backup, open the file and add the following source:

# AliYunyuandeb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted  universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse## Beta source
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# source
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
## Beta source
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse


# Tsinghua University source
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
## Beta source
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# source
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
## Beta source
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
Copy the code

Don’t forget to update the barrage after adding:

sudo apt-get update
sudo apt-get upgrade
Copy the code

This will allow for a smooth installation of NVIDIA drivers.

Then download the following three deep learning partners:

Start installing!

Install Cuda and Cudnn

Cuda is a must, of course.

Find the downloaded 11.1 CUDA environment package (now available in 11.2) and execute:

Sudo sh cuda_11. 1.0 _455. 23.05 _linux. RunCopy the code

A bunch of blabla options come up:

  • 1. Make sure you have any old CUDAs in your environment and delete them if you do
  • 2. Terms of Agreement..
  • 3, confirm whether to install the driver, install demo… And installation position determination
  • 4. Start installing ING

For Pan, I already installed the CUDA driver in the previous step, so I don’t need to install the old version of the driver (the new version of the driver is compatible with the old version of the driver match), so I will remove the driver option here, and the rest of the installation will follow my requirements.

Pay attention to

If you don’t have root permission and can’t use Sudo, you can install CUDa if you want. You can install CUDA into the software folder under the current home by running the following command once you have defined the installation location:

. / cuda_11. 1.0 _455. 23.05 _linux. Run - silent - toolkit - toolkitpath =$HOME/software/cuda --defaultroot=$HOME/software/cuda
Copy the code

After installation, however, it will display:

Configure environment variables according to the above requirements:

(base) oldpan@oldpan-fun:~/software$vim ~/.bashrc willexport PATH=/usr/local/ cuda - 11.1 / bin:$PATH
export LD_LIBRARY_PATH=/usr/local/ cuda - 11.1 / lib64:$LD_LIBRARY_PATHAdd to an open file (base) oldpan@oldpan-fun:~/software$source ~/.bashrc
(base) oldpan@oldpan-fun:~/software$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
Copy the code

Cudnn

Cudnn is easy to install, just zip the package and copy and paste it:

Tar -xzvf cudnn-11.2-linux-x64-v8.1.1.33.tgz sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h
Copy the code

Installation Anaconda

Installing Anaconda is also easy, download it from here:

Sh anaconda3-2020.11-linux-x86_64.

After installation, configure conda and PIP tsinghua source, refer to the following text:

  • Pycharm changes PIP source to tsinghua source to improve download speed
  • Anaconda common commands Configure information and change the source

Install Pytorch

Installing Pytorch is easy. If you don’t want to build Pytorch yourself, you can install it directly from the official Cuda and Cudnn versions:

Download.pytorch.org/whl/torch_s…

After Pytorch is installed, test cudA to see if it works properly:

>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.ones(1).cuda()
tensor([1.], device='cuda:0')
>>> torch.cudnn_is_acceptable(torch.ones(1).cuda())
True
Copy the code

OK~

TensorRT

TensorRT posts a separate article about it

Some resources

Configuring the environment requires many software packages, such as:

  • Anaconda
  • Pytorch.whl
  • TensorRT
  • CUDA
  • CUDNN

Some of them can be downloaded from tsinghua University open Source software image site, but TensorRT and CUDA and CUDNN need to be officially registered and slow.

Lao Pan sorted out some software packages that had been downloaded.

Please reply to 015 on our official account to find out what you need:

I want to write a lot more, I will tell you next (whoo).

If you have any questions, please leave a comment at oldpan Blog, where you can find all of pan’s possessions. Very willing to make friends with you ~

reference

www.cnblogs.com/masbay/p/10… Blog.csdn.net/ZPeng_CSDN/…

Pulled me

  • If you are like-minded with me, Lao Pan is willing to communicate with you;
  • If you like Lao Pan’s content, welcome to follow and support.
  • If you like my article, please like ๐Ÿ‘ collect ๐Ÿ“ comment ๐Ÿ’ฌ three times ~

If you want to know how Lao Pan learned to tread pits, and if you want to talk with me about his problems, please follow the public account “Oldpan blog”. Lao Pan will also sort out some of his own private stash, hoping to help you, click on the mysterious portal to obtain.