How to Install NVIDIA Driver in Ubuntu 16.04

When I used the command ‘nvidia-smi‘ in terminal, a Error occurred like this: NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. So I decided to install the proper NVIDIA driver. The following shows that how to install a NVIDIA driver in ubuntu 16.04.

Wrong Way to Install NVIDIA Driver

First, I’d like to introduce the wrong way to install NVIDIA Driver. Why? Because I think it was the right way if the others didn’t tell me about it. Maybe you also use the wrong way to install it. If you want to know the right method directly, you can go to Right Way to Install NVIDIA Driver directly.

Step 1: Get the NVIDIA driver via ppa. Open the terminal and run this command:

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

Step 2: Update system package. Run the below command:

sudo apt update

Step 3: Launch Additional Drivers utility and select proper NVIDIA driver. Click the “Apply Changes” button will automatically download and install the driver on your system.

Step 4: Finally you need to restart computer to make the new driver take effect.

Until now, there is no error when you run “nvidia-smi” in terminal, there is a piece of information displayed. But you will find the model of the GPU is xxx Drivers, not the 1080Ti(My GPU is 1080Ti). Also the Addtional Drivers shows Unknow. It means that the NVIDIA Driver is not installed correctly.

Now, Let me introduce the right way to install NVIDIA Driver.

Right Way to Install NVIDIA Driver

Step1: Get the NVIDIA driver. You also can download the NVIDIA driver from official website.

Step 2: Enter the TTY1 Mode. (Click Ctrl+Alt+F1). Note: Disabled the nouveau is very important.

sudo service lightdm stop
#Change the current directory to the directory which has the xxx.run(NVIDIA Dirver)
sudo su
chmod 755 xxx.run
./xxx.run
#After finishing the install.
sudo service lightdm restart
########Add nouveau to blacklist
#/etc/modprob.d/blacklist.conf(Path for blacklist.conf, open it)
#blacklist nouveau(add this line)

Step 3: After installing the driver, you can run “nvidia-smi” in terminal, If you can see “1080Ti”(The model of Your GPU), It means you have installed the NVIDIA driver successfully.

Troubleshooting

Q1: Miss some .so files.

A1: Maybe you have downloaded the wrong version of driver. so you can download the correct version of driver and try it again.

Q2: After installing NVIDIA driver and restarting computer, it occurs that no video input enter sleep mode.

A2: Because you have separate and integrated GPU, you didn’t install NVIDIA driver very well and the system choose to use separate GPU by default. So you need to take off the separate GPU and restart the computer. After we can use the GPU, we can install the separate GPU to motherboard again.

Q3: why you can’t enter the desktop or tty mode?

A3: Because you didn’t disable neoveau or something wrong with neoveau. So Add nouveau to blacklist is very important in above steps.

Q4: If you can’t enter the desktop or tty mode.

A4: It was very pity. You need to install the system. After installing system, In desktop mode, You need to disable neoveau first. Then enter tty mode to install NVIDIA driver. Good Luck.

Q5: After installing NVIDIA driver successfully, maybe you will meet that you can’t use cuda. It hints that it can’t open the binary file.

A5:You can install a new version of cuda. After installing new cuda, You need to install the related cudnn.

Have a nice day and Good luck.

Share this article to your social media
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments