Ubuntu16.04 install Tensorflow1.7 process record 1: Install graphics card driver

To install a new system for the new Titan V, of course, the first step is to install the graphics card driver.

 You can refer to this: https://jingyan.baidu.com/article/d7130635c5a86113fdf47532.html

The additional driver display in the "Software and Updates" of the single start is empty, I thought it was not, so I went to Nvidia's official website to download the corresponding driver. The result is super slow, the download fails after half a day, and the download is completed immediately, but the file format is deb, and there is no run option.

I tried to install the deb file with the command, but it didn't work. I found that it was installed in "Other Software".

So try the method in https://blog.csdn.net/jasonzhangoo/article/details/54866049  :

Add official ppa source

The shortcut key ctrl+alt+T opens the command terminal and joins the official ppa source.

$ sudo add-apt-repository ppa:graphics-drivers/ppa

A password needs to be entered and confirmed by pressing enter. Then refresh the software repository and install the latest driver.

$ sudo apt-get update

Maybe updating the ppa source, or updating the system software in the process, the additional drivers in "Software and Updates" show 2 drivers for Nvidia and Ubuntu. Nvidia's driver is actually open source, and the version is even newer than the previous one. Click Apply. The process stopped for half an hour and made no progress at 1/4. After a night of sleep, it was installed, sweaty.

 

Attached: https://blog.csdn.net/CosmosHua/article/details/76644029

 

 

 

0. Overview

At present, there are 3 ways to install the Nvidia card driver: 

1. PPA source: the easiest, but may not have the latest driver (pro-test), or may encounter problems (rumor).

 

sudo add-apt-repository ppa:xorg-edgers/ppa #Add ppa source

sudo add-apt-repository ppa:graphics-drivers/ppa #Add ppa source

sudo apt-get update #更新apt-get

 

Then go to: System Settings -> Software and Updates -> Accessory Drivers, select the updated graphics card driver. 

2. When installing CUDA, install the driver by the way: but it may not be the latest driver (pro-test). 

3. Go to the official website to download the latest driver, and then install it locally (runfile is used in this article).

 

1. Uninstall the original Nvidia card driver first

#for case1: original driver installed by apt-get:

sudo apt-get remove --purge nvidia*

 

#for case2: original driver installed by runfile:

sudo chmod +x *.run

sudo ./NVIDIA-Linux-x86_64-384.59.run --uninstall

 

If the original driver was installed with apt-get, use the first method to uninstall. 

If the original driver was installed with runfile, use the --uninstall command to uninstall it. In fact, when you install with runfile, the previous driver will also be uninstalled, so you can uninstall it manually.

 

2. Disable nouveau driver

sudo gedit /etc/modprobe.d/blacklist.conf

1

Add at the end of the text: (disable the nouveau third-party driver, you don't need to change it back later)

 

blacklist new

options new modeset=0

 

Then execute: sudo update-initramfs -u

 

After reboot, execute: lsmod | grep nouveau. If there is no screen output, the nouveau is disabled successfully.

 

3. Disable X-Window Services

sudo service lightdm stop #This will close the GUI, but don't be nervous

 

Press Ctrl-Alt+F1 to enter the command line interface, and enter the user name and password to log in.

 

Tip: Enter: sudo service lightdm start on the command line, and then press Ctrl-Alt+F7 to restore to the graphical interface.

 

4. Install the driver from the command line

#Give execute permission to the driver run file:

sudo chmod +x NVIDIA-Linux-x86_64-384.59.run

The parameters after # are very important and cannot be omitted:

sudo ./NVIDIA-Linux-x86_64-384.59.run –no-opengl-files

 

–no-opengl-files: Indicates that only the driver files are installed, and the OpenGL files are not installed. This parameter cannot be omitted, otherwise it will lead to an infinite loop of the login interface, which is generally called "login loop" or "stuck in login" in English.

–no-x-check: Indicates that the X service is not checked when installing the driver, not required.

–no-nouveau-check: Indicates that nouveau is not checked when installing the driver, not required.

-Z, --disable-nouveau: Disable nouveau. This parameter is not required because nouveau has been manually disabled before.

-A: View more advanced options.

Explanation of required parameters: Because the NVIDIA driver will install OpenGL by default, and the Ubuntu kernel itself also has OpenGL, which is closely related to GUI display. Once the NVIDIA driver overrides OpenGL, it will cause problems when the GUI needs to dynamically link the OpenGL library.

 

After that, follow the prompts to install and restart after success. 

If it prompts that the installation fails, do not rush to restart the computer, repeat the above steps, and install it a few more times.

 

Driver test:

 

nvidia-smi #If the GPU information list is listed, it means that the driver installation is successful

nvidia-settings #If the settings dialog box pops up, it also means that the driver installation is successful

 

5. Adjust screen resolution (successful)

If the screen cannot reach the best resolution, please refer to: http://blog.csdn.net/nostandby/article/details/69383543

 

#View monitor identifier: mine is DVI-I-0, before 'connected'.

xrandr

#View resolution properties: I want to see a resolution of 1920x1080, after 'Modeline'.

cvt 1920 1080

#Create a new resolution mode: copy the information after 'Modeline'.

sudo xrandr --newmode "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

#Add resolution mode for display:

sudo xrandr --addmode DVI-I-0 "1920x1080"

#Apply the resolution mode to the display:

sudo xrandr --output DVI-I-0 --mode "1920x1080"

 

PS: In the end, it was found that the inferior graphics card-monitor adapter caused the monitor and the resolution to be unrecognized. After changing the adapter, the resolution will be restored naturally without the above steps.

 

6. Install CUDA

sudo ./cuda_8.0.61_375.26_linux.run --no-opengl-libs

1

--no-opengl-libs: Indicates that only the driver files are installed, and the OpenGL files are not installed. Required parameter for the same reason as above. Note: not -no-opengl-files.

--uninstall (deprecated): Used to uninstall the CUDA Driver (deprecated).

--toolkit: Indicates that only CUDA Toolkit is installed, and Driver and Samples are not installed.

--help: See more advanced options.

After that, follow the prompts to install. I chose in turn:

 

accept #Agree to install

n #Do not install Driver, because the latest driver has been installed

y #Install CUDA Toolkit

<Enter> #Install to the default directory

y #Create a soft link to the installation directory

n #Do not copy Samples, because there is /samples in the installation directory

 

CUDA Sample test:

 

#Compile and test the device deviceQuery:

cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery

sudo make

./deviceQuery

 

#Compile and test bandwidth bandwidthTest:

cd ../bandwidthTest

sudo make

./bandwidthTest

 

If the final results of these two tests are both Result = PASS, the CUDA installation is successful.

 

sudo ./cuda_8.0.61.2_linux.run #Finally install the patch CUDA official patch

 

references: 

http://blog.csdn.net/u012759136/article/details/53355781 

http://blog.csdn.net/u012581999/article/details/52433609 

http://hyichao.github.io/cv/2016/10/15/ubuntu-cuda-caffe.html 

http://blog.csdn.net/nostandby/article/details/69383543 

http://www.linuxdiyf.com/linux/24659.html

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324415413&siteId=291194637