Environment of 0.

Operating system: Ubuntu 16.04LTS Graphics card: Nvidia Geforce 970Copy the code

1. Installation mode description

1.1 ppa source installation

It is not recommended to install this way, as you cannot configure specific options and will need to manually update the driver often after success. Of course, since other methods of installation can be cumbersome and problematic for beginners, if you only need to temporary build or are very lucky, you can try it. Very simple indeed.

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 # update apt - a get
Copy the code

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

1.2 Manually Installing the RUN file

This is recommended, and we can configure the options for each machine. Avoid black screen, circular login and other problems.

2. Detailed installation of the run file

2.1 Manually Downloading the Driver

Official graphics driver NVIDIA-Linux-x86_64-390.48.run Select appropriate parameters to download the driver

2.2 Uninstalling the Old Driver

Uninstall any older versions of nvidia drivers that may exist (this step can be omitted for hosts that do not have nvidia drivers installed, but it is recommended and harmless), and also if your installation fails.

 sudo apt-get remove --purge nvidia*
 # Uninstall as well if the installation fails. / NVIDIA - Linux - x86_64-390.48. The run - uninstall# Make sure the uninstall is clean.
Copy the code

2.3 Dependencies that may be required for installation (optional, blush can be skipped)

This is just to make sure

Many of your environments are already installed, so there's not much time.
 sudo apt-get update 
 sudo apt-get install dkms build-essential linux-headers-generic
 sudo apt-get install gcc-multilib xorg-dev
 sudo apt-get install freeglut3-dev libx11-dev libxmu-dev install libxi-dev  libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
Copy the code

2.4 Disabling the Noueau Driver

 sudo vi /etc/modprobe.d/blacklist-nouveau.conf 
 # Add the following to the file blacklist-nouveau. Conf:
  blacklist nouveau
  blacklist lbm-nouveau
  options nouveau modeset=0
  alias nouveau off
  alias lbm-nouveau off
  # save: wq

Copy the code
Disable the Nouveau kernel module
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
reboot # to restart
lsmod |grep nouveau Of course, your desktop resolution will be larger without the driver.

Copy the code

2.5 Enter BLOS to Disable Secure Boot (Asus and Fast Boot)

Otherwise, the installation fails.

2.6 Accessing the TTY GUI

Press CTRL + ALT + F1 to log in and go from GUI to terminal TTy1 (all black). In order to rebuild the video output, it must first be paused.

sudo service lightdm stop
Copy the code

If the command line doesn’t work, the new Ubuntu version replaces the LightDM with Systemctl.

2.7 Running the. Run file Select appropriate options.

cdDownload chmod a+x NVIDIA- linux-x86_64-384.90. run# Add permissionSudo. / NVIDIA - Linux - x86_64-384.90. The run - DKMS - no - opengl - filesCopy the code
  • – no-opengl-files: Only the driver file is installed and the OpengL file is not installed. Do not omit this parameter. Otherwise, the login interface will be stuck in an infinite loop. It is generally called “login loop” or “stuck in login” in English. Of course not in the case of blushing. Mandatory: Because the NVIDIA driver installs OpenGL by default, and the Ubuntu kernel itself has OpenGL and is related to GUI display, if the NVIDIA driver overwrite OpenGL, it will cause problems when the GUI needs to dynamically link to the OpenGL library.
  • – no-x-check: indicates that the X service is not checked during driver installation. It is not required and the GUI is disabled.
  • – no-nouveau-check: Indicates that nouveau is not checked during driver installation. It is not required and we have disabled the driver.
  • -z, –disable-nouveau: Disables nouveau. This parameter is not required because Nouveau has been manually disabled.
  • -a: View more advanced options.
  • – DKMS (enabled by default) Installs the driver into the module when the kernel updates itself, preventing the driver from being reinstalled. During kernel updates, DKMS triggers driver recompilation to the new kernel module stack.

2.8 About Pre-Script Failed

At runtime, you may receive a pre-install script failed message. It doesn’t matter, just choose to continue with the installation, because the preinstallation script includes the command exit 1, whose goal is to make sure you really want to install the drivers. See my blog for details. Blog.csdn.net/u014561933/… Of course, you did not do the previous work correctly, will prompt other error messages. Log in/var/log/nvidia – the log

2.9 Installation Options

  • DKMS installation is recommended to yes
  • Yes is the best option for 32-bit compatible installation
  • Do not install x-org, select no, some computers may cause a black login screen

2.10 Verifying the Installation

nvidia-smi # If the list of GPU information is displayed, the driver is successfully installed

Copy the code

If the uninstallation fails, skip back to step 1 and start again.

2.11 Re-Entering the DESKTOP

sudo service lightdm start CRTL + Alt +f7
nvidia-settings If the setup dialog box is displayed, the driver is successfully installed
Copy the code