Table of contents
1. Preparation and checking whether there is a graphics card driver
1.1 Check if the driver exists
2. Tutorial on installing graphics card driver
3. Install cuda10.1 and cudnn7.6.5
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:
You need to find the graphics card model yourself, just search it on Baidu online.
2. Download the cuda historical type installation package:
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:
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! ! !
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