Configuration requirements:

Target: Caffe framework based on CUDA8.0+ OpenCV 3.1+ CUDNNV5.1 + Python 3.6 interfaces


Compilation and installation process

Video card model: NVS 510

1. Download the video card driver installer

Enter under root

lspci |grep VGA

You can look at your graphics card model

After determining your graphics card model, log in NVIDIA official website to download the driver

http://www.nvidia.cn/Download…

According to their own graphics card model download the corresponding driver

2. Configure the compilation environment

Installing the NVIDIA driven build environment requires:

gcc kernel-devel kernel-headers

This may seem like a simple step, but it can actually cause a lot of problems. The first is GCC. If you haven’t uninstalled GCC after manually compiling and installing a higher version of GCC, you’re fine, but if you have uninstalled GCC, please scroll to the end to see how to do it. Second, if you use

kernel-devel -version

or

kernel-headers -version

It is not possible to check whether you have installed either dependency package. If you use yum install to install kernel-devel and kernel-headers directly, you may download a version of kernel-devel that is higher than your kernel, and it is very likely that you will not be able to download kernel-headers. The correct way to do this is to type in the terminal separately:

yum info kernel-devel

and

yum info kernel-headers 

If you already have Packages in Installed Packages for your current kernel version, then you do not need to download the two dependencies, otherwise you will need to reinstall the system.

3. Disable the Nouveau driver that comes with Centos6.5

The Nouveau driver will conflict with the NVIDIA driver. If the Nouveau driver is still enabled, an error will be reported during the installation of the NVIDIA driver. Enter at the terminal:

vi /etc/modprobe.d/blacklist.conf

Nouveau =0. ModeSet =0. Nouveau =0. ModeSet =0. ModeSet =0. After adding gedit /boot/grub/grub. Conf to Quiet, pro test the second may make the system startup crash, and the first method in the Centos7 version of the configuration used, whether necessary unknown, I directly ignored this sentence, or can start normally.

4. Backup and rebuild the system image CentOS

Steps specific to installing NVIDIA drivers

Backup system image

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

Create a new system image

dracut -v /boot/initramfs-$(uname -r).img $(uname -r)

$(uname -r) refers to the kernel version of your system, which you can try by typing uname -r as root.

5. Change the system running level

The NVIDIA driver cannot be installed at X Desktop Boot, so you need to start the installer in text mode for the installation to work.

vi /etc/inittab

Change the last line id:5 to id: 3. This line represents the default runtime level when the system starts, 5 represents the graphical interface, and 3 represents the text mode. Save the exit

5. Restart

reboot

6. Installation

Under terminal root

Chmod +x nvidia-linux-x86_64-384.69.run sh./ nvidia-linux-x86_64-384.69.run

Start the installation, select some additional items according to their actual situation whether to install or not. After the completion of the installation, modify the running level of the system again and change id:3 to id: 5, save the exit and restart, the installation is completed

Problems encountered:

Before installing the NVIDIA driver, I manually compiled the installed version of GCC 4.8.2 and uninstalled the version of GCC4.4.7 that came with the system. If you are sure you have installed GCC, please check CC is in your PATH. If you are sure you have installed GCC, please check CC is in your PATH. At that time, I was puzzled that I had installed a new version of GCC, and I couldn’t find the reason. / nvidia-linux-x86_64-384.69. run/nvidia-linux-x86_64-384.69. run/nvidia-linux-x86_64-384.69. run/nvidia-linux-x86_64-384.69. run/nvidia-linux-x86_64-384.69.run However, this is not the right thing to do. After installing the NVIDIA driver successfully, I thought about this problem again, and I had to fix it, otherwise I would definitely have problems finding GCC again in the future. First I used a global search to find all the folders named GCC

find / -name gcc

According to the following

/usr/local/libexec/gcc
/usr/local/bin/gcc
/usr/local/lib/gcc
/usr/libexec/gcc
/usr/bin/gcc
/usr/lib/gcc

There are also several home folders that are not the cause of the problem. The presence of two bins in GCC indicates that there are at least two versions of GCC input

The/usr/bin/GCC - version gcc4.4.7 (GCC) 4.4.7 20120313..................................................................... / usr/local/bin/GCC version GCC (GCC) 4.8.2.......................................................................................... .

During the installation of the NVIDIA driver, it calls /usr/bin/gcc and /usr/bin/gcc is the directory where GCC is stored on the system so it will still call GCC in this folder in the future. So I have a way to first move the version of GCC from this directory. Then create a soft link between version 4.8.2 GCC and this folder, so that the next call will go directly to version 4.8.2 GCC

Mv /usr/bin/gcc /usr/bin/gcc /usr/bin/gcc /usr/bin/gcc /usr/bin/gcc /usr/bin/gcc

In addition, the g++, cc, C ++ commands also need to change

Mv/usr/bin/g + + / usr/bin/g + + - 4.4.7 ln -s/usr/local/bin/g + + / usr/bin/g + + mv/usr/bin/cc/usr/bin/cc - 4.4.7 ln -s /usr/local/bin/ GCC /usr/bin/cc/C ++ /usr/bin/ C ++ /usr/bin/ C ++ /usr/bin/ C ++ /usr/bin/ C ++ -4.4.7ln -s /usr/local/bin/c++ /usr/bin/c++

Similarly, if you uninstall GCC after updating the GCC version, you can simply create a soft link to these items and do not need to use the mv command