Ubuntu16.04 checks and installs the graphics card driver, installs cuda10.1 and cudnn7.6.5

Table of contents

1. Preparation and checking whether there is a graphics card driver

1.1 Check if the driver exists

1.2 Download file URL

1.3 Note

2. Tutorial on installing graphics card driver

3. Install cuda10.1 and cudnn7.6.5

3.1  cuda

3.2 hidden


1. Preparation and checking whether there is a graphics card driver

1.1 Check if the driver exists

        Terminal input:

nvidia-smi

        Generally there is nothing.

1.2 Download file URL

        Generally speaking, you need to download three files from the Nvidia official website, namely the driver, cuda installation package and cudnn compressed package.

        1. Find the graphics card driver and download the URL:

Official Drivers | NVIDIADownload latest drivers for NVIDIA products including GeForce, TITAN, NVIDIA RTX, Data Center, GRID and more.https://www.nvidia.com/Download/index.aspx?lang=en-us

         You need to find the graphics card model yourself, just search it on Baidu online.

        2. Download the cuda historical type installation package:

CUDA Toolkit Archive | NVIDIA DeveloperPrevious releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production drivers appropriate for your hardware configuration.https://developer.nvidia.com/cuda-toolkit-archive

        The specific type depends on which version of the graphics card can be downloaded. Search on Baidu and you can download cuda10.1 for 1050Ti.

        3.cudnn installation package: 

cuDNN Archive | NVIDIA DeveloperExplore and download past releases from cuDNN GPU-accelerated primitive library for deep neural networks.https://developer.nvidia.com/rdp/cudnn-archive

        Just choose the appropriate download based on the previous cuda version.

1.3 Note

        The first three files, two .run files and a compressed package. The first two files and the folder after decompression of the compressed package must be placed directly under the HOME folder.

        You need to remember the driver file name because you won’t be able to see it when you enter the interface later.

2. Tutorial on installing graphics card driver

        Reference tutorial:

Environment Building 01 - How to check graphics card information and install NVDIA graphics driver in Ubuntu_chakanxiankaqudong minling_Named Incompetent Blog-CSDN Blog 1. Check the graphics card model and enter the following command: lshw -c video. The result shows: You can see your graphics card information. For example, mine is product: GF108GL [Quadro 600]. Check the configure field to see if there is the word driver. If there is content, it means that the corresponding workstation graphics card driver is installed. 2. Find the driver for your graphics card. Go to the NVDIA driver search page to search for the driver model required by your graphics card and download it. The following is the driver corresponding to my computer... https://blog.csdn.net/qiancaobaicheng/article/details/95096354         Basically just press and go. Note that the driver file .run is placed in the HOME directory, and the name must be remembered. There is no display interface at the back, so it is best to open the tutorial on your mobile phone to read it.

        There is a step later to uninstall the old driver and see what someone writes:

sudo apt-get remove --purge nvidia-*

        One more -, you can try it.

        After closing the graphical interface, if Login is displayed, you need to log in. The username and password are the username and password of your system. Generally, when running the code, if the next line appears

用户名 一堆方块

        form, or you need to enter a password and press Enter to run. Either the code is incorrect. Check whether the code is entered in the wrong case or something.

        If the input is correct, either a long string will appear like the installation, and the last successful one will not report an error; or it will enter the next command line and input nothing else; or it will enter the password (a line of user names will be displayed and a bunch of squares will be displayed, and then the next command line will be directly entered). is wrong).

3. Install cuda10.1 and cudnn7.6.5

3.1  cuda

        The basic operation is to download the file, run an sh command to run the run file, and then just pay attention to the options.

        Reference blog: Note that the first step in this step is to install a default driver. The version is probably too low. I ran the driver version for more than 300 yuan, but later reported an error that the driver version was too old! ! !

Ubuntu 20.04 installation of CUDA & CUDNN will guide you step by step_Ubuntu installation of cuda_HashMap's blog-CSDN blog. Newbies should take a look at this before. I have been using CPU for training. Recently, I got a single-card 1080Ti graphics card host, so I started to study GPU. train. If you use GPU training, you will definitely use CUDA. When I first came into contact with CUDA, I had a very, very headache and it was very unfriendly to beginners. I worked on it for almost a whole day and wanted to give up many times in the middle. Finally, I finally got it. Looking back, it was not very good. It’s difficult, but there are many and complicated articles online, and it really took me back and forth for a long time, so I wrote this article. I hope that friends who are new to entry-level GPU machines can learn something and want to install CUDA, so that they can avoid detours and don’t be like me. It's a waste of time. The most difficult thing for novices to understand is what CUDA and cuDNN are, as well as the installation process and steps. Let’s briefly talk about https://blog.csdn.net/h3c4lenovo/article/details/119003405         . When installing cuda, download the .run file and put it in the HOME folder. Start directly with the command:

sudo sh cuda_xxxxxxxxxxxxxxxxxxxx.run

        See the tutorial for the following options. Note that after the first accpet, the driver in the options needs to be removed because the appropriate version has been installed previously.

3.2 hidden

        Just like referring to the blog, after unzipping the file, just enter a few commands to copy the folder:

sudo cp cuda/include/cudnn.h /usr/local/cuda-10.1/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-10.1/lib64
sudo chmod a+r /usr/local/cuda-10.1/include/cudnn.h 
sudo chmod a+r /usr/local/cuda-10.1/lib64/libcudnn*

        Detection version:

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

        or:

cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

Guess you like

Origin blog.csdn.net/weixin_43907136/article/details/129422854