Graphics driver installed in the system ubuntu16.04

1. Install ubuntu.16.04 system

U disk to make a boot disk, install self-search. Dell to enter the bios is press F2, the boot mode to u disk boot boot boot animation appears
Note : dual system may choose to replace both systems or only replace ubuntu18.04 recommend without leaving win10.

2. Install the graphics driver

Preparing Files: NVIDIA-linux-x86_64-xxx.run cuda_9.0.xxxx_linux.run cudnn-9.0-Linux-xxx.tgz
16.04 version is recommended cuda9.0
1, the command Nvidia-smi see if you have installed, not shown, to continue following installation steps.

First nouveau disable command written to the file, that file editing /etc/modprobe.d/blacklist.conf.

sudo vim /etc/modprobe.d/blacklist.conf
added at the end the following :
blacklist Nouveau
blacklist LBM-Nouveau
Options Nouveau modeset = 0
Alias Nouveau OFF
Alias LBM-OFF Nouveau

Then call instruction ban nouveau:

echo options again modeset = 0 | sudo tee -a /etc/modprobe.d/nouveau-kms.

Next, update the kernel: sudo update-initramfs -u
then restart the computer: reboot
restart boot, press ctrl + alt + F1 enters ttf mode, execute the command: sudo service lightdm stop

Then go to the directory NVIDIA-Linux-x86_64-xxxxxx.run file, execute the command:
chmod + the X-NVIDIA-Linux-x86_64-384.130.run
sudo ./NVIDIA-Linux-x86_64-384.130.run --no-OpenGL-Files

Next Next + OK all the way to complete the installation of the whole process can be.
It should be stressed that the installation time -no-opengl-files option mandatory, or may cause the system to crash!

Installation CUDA

MD5 file with the test run, and if the numbers do not, have to re-download
enter the command: $ md5sum cuda_9.0.xxx_linux.run, appears similar to the following reply
1 installed

Start the installation CUDA

1. Disable the nouveau driver
terminal run: $ lsmod | grep nouveau, if output represents the nouveau Loading. We need to manually ban nouveau.
Ubuntu's nouveau Prohibited Method:

  1. Create a file in /etc/modprobe.d blacklist-nouveau.conf
    enter the command: $ sudo vi /etc/modprobe.d/blacklist-nouveau.conf (using the vi editor to edit and save files)
    input at the contents of the file:
    nouveau blacklist
    Options nouveau modeset = 0

  2. Executive:
    $ Sudo Update-Initramfs -U

  3. Then execute:
    $ lsmod | grep nouveau
    If no content output, success is disabled, if there is still content output, check the operation and repeat the above operation

2. Restart the computer, enter the login screen, do not log into the desktop (or might fail, if not carefully entered, restart the computer), press Ctrl + Alt + F1 to enter direct text mode (command line interface), log in account.

3. Enter $ sudo service lightdm stop off graphical interface
4. The switching installation file path to cuda:
Run: sudo sh cuda_xxx_linux.run
Note: a, must follow the prompts) the corresponding input character, e.g., some need to enter the accept, some need to enter yes;

  1. Encounter prompted to install openGL, select no (if your computer is like me dual display and main display of non-NVIDIA GPU choice no need to work, otherwise you can yes), the other is to choose yes or default

  2. Enter $ sudo service lightdm start to re-start the graphical interface.
    Hold down the Alt + ctrl + F7, return to the graphical login screen, enter your login password.
    If you can log in successfully, they will not have problems to log cycle, the basic instructions for installing the success of the CUDA

  3. Restart the computer, check Device Node Verification
    performed ls / dev / nvidia *
    If there is: / dev / nvidia0 / dev / nvidiactl / dev / nvidia-uvm
    or display similar information, there should be three (containing a similar / dev / nvidia- nvm), the installation is successful

  4. Setting environment variables
    terminal type $ sudo gedit / etc / profile
    at the open end of the file, add the following two lines.
    64 System:
    Export the PATH = / usr / local / CUDA-9.0 / bin Katex the parse error: the Expected '}', GOT 'the EOF' AT End of INPUT: {the PATH: +: {the PATH}}
    Export the LD_LIBRARY_PATH = / usr / local / CUDA-9.0 / the lib64
    Katex the parse error: the Expected '}', GOT 'the EOF' End of INPUT AT: ... LIBRARY_PATH: +: {}} the LD_LIBRARY_PATH
    save the file and restart

  5. Restart the computer and check the above environment variable settings successful.
    a, verify driver version
    $ cat / proc / driver / nvidia / version
    results show
    NVRM Version: the NVIDIA the x86_64 the UNIX Kernel 384.81 Module1 the PDT Sat On Sep 2017 02:43:11 2
    the GCC Version: Version 5.4.0 GCC 20,160,609 (the Ubuntu 5.4.0 ~ 16.04.5 -6ubuntu1)
    . b verify Toolkit CUDA
    $ nvcc -V outputs CUDA version information
    If this is:
    . at the Program 'nvcc' iS Rate this page Currently not Installed by You cAN install IT by Typing:
    sudo APT-GET install NVIDIA -cuda-toolkit
    may be environmental configuration is not successful, repeating the above step 7).

  6. Cuda try to compile the example provided by the
    open terminal and type: $ cd /home/xxx/NVIDIA_CUDA-9.0_Samples where xxx is your own user name, enter the command cd NVIDIA_CUDA-9.0_Samples directory.
    The terminal then enter: $ make
    the system will automatically enter into the build process, the whole process takes about ten to twenty minutes, and please be patient. If an error occurs, the system will stop the error immediately.

The first run-time error may prompt the error message may not be the system gcc

The solution is to re-install gcc on the command line, enter in a terminal: $ sudo apt-get install gcc gcc after you install, then make it normal.

If the compilation is successful, it will eventually show Finished building CUDA samples

2) Run the compiled binary files.
Compiled binary files stored in the default NVIDIA_CUDA-9.0_Samples / bin in.
Then in a terminal type: $ cd /home/lxxx/NVIDIA_CUDA-9.0_Samples/bin/x86_64/linux/release where xxx is your own user name
and then enter in a terminal: $ ./deviceQuery

Results representative where Result = PASS CUDA successfully installed and configured, when the failure = FAIL the Result
. 3) Finally, the system and check the connections CUDA-Capable device of
the terminal input: $ ./bandwidthTest
Here Insert Picture Description

Installation cudnn

  1. Unzip the file
    tar -xvf cudnn-9.0-linux- x64-v7.tgz
  2. Copy the file to a specific directory
    CD CUDA
    the sudo the include CP / cudnn.h / usr / local / CUDA / the include /
    the sudo the lib64 CP / * / usr / local / CUDA / the lib64 /
    the sudo the chmod A + R & lt / usr / local / CUDA / the include / cudnn.h
    the sudo the chmod A + R & lt / usr / local / CUDA / the lib64 / libcudnn *
  3. 软连接
    cd /usr/local/cuda/lib64/
    sudo rm -rf libcudnn.so libcudnn.so.7
    sudo ln -s libcudnn.so.7.0.5 libcudnn.so.7
    sudo ln -s libcudnn.so.7 libcudnn.so
    sudo ldconfig
    cuDNN 7.0.5 检测是否成功安装:
    下载三个文件:
    cuDNN v7.0.5 Runtime Library for Ubuntu16.04 (Deb)
    cuDNN v7.0.5 Develpoper Library for Ubuntu16.04 (Deb)
    cuDNN v7.0.5 Code Samples and User Guide for Ubuntu16.04 (Deb)
    sudo dpkg -i libcudnn7_7.4.2.24-1+cuda9.0_amd64.deb
    sudo dpkg -i libcudnn7-dev_7.4.2.24-1+cuda9.0_amd64.deb
    sudo dpkg -i libcudnn7-doc_7.4.2.24-1+cuda9.0_amd64.deb
    cp -r /usr/src/cudnn_samples_v7/ /home/wdong/
    cd /home/wdong/cudnn_samples_v7/mnistCUDNN
    make clean && make
    ./mnistCUDNN
    Here Insert Picture Description
Published 12 original articles · won praise 0 · Views 437

Guess you like

Origin blog.csdn.net/qq_36523203/article/details/103211865