Machine learning stepped pit of Ubuntu systems install the Nvidia driver

Because the machine learning need to use the GPU for computing, so install the Nvidia driver for Ubuntu system becomes less important, install Nvidia in Ubuntu (hereinafter collectively referred to as N card) during driving is simply the most disgusting Ubuntu system appears After the installation log in circulation question, today I come to share with you stepped on my pit experience.

statement

There are many online an easy way to enter a line of code such as what

sudo apt-get install nvidia-*

Although this method can be used, but there is a very serious problem, this will cause the login screen cycle, so I used this method cumbersome to install.

Ready to work

  • We need to determine their own computer models N card
    in a terminal
    lspci | grep -i nvidia
    in brackets behind the show is the Nvidia graphics card models

  • According to N card model to Nvidia's official website to download the driver installation file.

    installation steps

    Proceed as follows

    Disable nouveau driver

    N cards need to first install the nouveau driver before driving shield to install N card official driver, will drive added to the blacklist blacklist.conf can
    not be modified due to the nature of this document, so you need to modify the file attributes

  • Modify file attributes
    input line of code in the terminal
sudo chomd 666 /etc/modprobe.d/blacklist.conf
  • Open with gedit editor blacklist.conf
    input line of code in the terminal
sudo gedit /etc/modprobe.d/blacklist.conf

Add it in the file after a few lines

blacklist vga16fb
 
blacklist nouveau
 
blacklist rivafb
 
blacklist rivatv
 
blacklist nvidiafb

save document

  • Run the following command to update the system to disable the nouveau
sudo update-initramfs -u
  • Restart the computer
  • After the restart is successful, the following command to check whether to disable the input nouveau success in the terminal, if there is no input, disable successful.
lsmod | grep nouveau

Press ctrl + alt + f1 into the command line interface

  • In the following command line interface command input, closing the graphical interface (will be wrong if the latter is not performed):
sudo service lightdm stop

Drive to run the file permissions given to the implementation of

sudo chmod a+x 文件名

installation

sudo ./filename -no-opengl-files

Note that many problems are due to the circulation Log opengl caused so here it directly removed can be avoided, the installation process there are many options
if suggestive old driver, asked to delete the old drive, choose yes
if prompted to lack a certain module (modules), asked whether the Internet to download, no election
if prompted to compile the module, asked whether to compile election ok
if you are prompted to be modified Xorg.conf, asking for permission, choose yes

Mount Nvidia driver

modprobe nvidia

Check the drive is successfully installed

nvidia-smi

If the installation instructions that appear similar to the following prompt success
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/AWSG-Shaodw/p/12398630.html