Software & AppsOperating SystemLinux

Fixing Nvidia Driver Issues on Ubuntu 18.04

Ubuntu 2

In this article, we will delve into how to troubleshoot and fix Nvidia driver issues on Ubuntu 18.04. This is a common problem faced by many Ubuntu users, but with the right steps, you should be able to resolve it.

Quick Answer

To fix Nvidia driver issues on Ubuntu 18.04, you can try uninstalling and reinstalling the driver, installing the driver directly from Nvidia’s website, or using the graphics-drivers PPA.

Understanding the Problem

Nvidia driver issues can manifest in many ways, from the system not recognizing the graphics card to the driver not loading correctly. In some cases, you might experience screen flickering, poor resolution, or even system crashes. If you’re using an Nvidia GeForce 940M with an Intel i5 processor and dual-booting with Windows 10, you might encounter these problems even with Secure Boot disabled.

Preliminary Steps

Before we dive into the solutions, ensure that your system is up-to-date. Run the following commands in your terminal:

sudo apt update
sudo apt upgrade

The sudo apt update command updates the list of available packages and their versions, but it does not install or upgrade any packages. The sudo apt upgrade command actually installs newer versions of the packages you have.

Solution 1: Uninstall and Reinstall the Nvidia Driver

Sometimes, simply uninstalling and reinstalling the Nvidia driver can solve the problem. To uninstall the Nvidia driver, use the following command:

sudo apt-get remove --purge '^nvidia-.*'

This command removes the Nvidia driver and all its associated files. The --purge option is used to remove the configuration files as well.

After uninstalling, reboot your system:

sudo reboot

Once your system has rebooted, reinstall the Nvidia driver using:

sudo apt install nvidia-driver-390

This command installs the Nvidia driver version 390. You can replace ‘390’ with the version number suitable for your graphics card.

Solution 2: Install from Nvidia’s Website

If reinstalling from the terminal doesn’t work, you can try installing the driver directly from Nvidia’s website. Visit the Nvidia driver download page, select your graphics card model and download the appropriate driver.

Before installing the downloaded driver, disable the nouveau driver, which is a free and open-source graphics device driver for Nvidia cards. To disable it, open the /etc/modprobe.d/blacklist-nouveau.conf file and add these lines:

blacklist nouveau
options nouveau modeset=0

Then, update the initial RAM filesystem:

sudo update-initramfs -u

Now, you can install the downloaded Nvidia driver. Navigate to the directory where the driver is downloaded and run the installer:

cd ~/Downloads
sudo sh NVIDIA-Linux-x86_64-390.12.run

Replace NVIDIA-Linux-x86_64-390.12.run with the name of the file you downloaded.

Solution 3: Use the Graphics-Drivers PPA

If the above solutions don’t work, you can use the graphics-drivers PPA (Personal Package Archive). This PPA provides the latest drivers for Ubuntu. To add the PPA and install the driver, use the following commands:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-390

Replace ‘390’ with the version number suitable for your graphics card.

Conclusion

Troubleshooting Nvidia driver issues on Ubuntu 18.04 can be a bit tricky, but with the right steps, it is certainly doable. The solutions provided in this article should help you get your Nvidia graphics card working correctly. If you continue to experience problems, consider seeking help from the Ubuntu community or the Nvidia support forums.

How do I check if the Nvidia driver is installed on my system?

You can check if the Nvidia driver is installed by opening the terminal and running the command nvidia-smi. If the output displays information about your Nvidia graphics card, then the driver is installed.

How do I switch between the integrated Intel graphics and the Nvidia graphics card?

To switch between the integrated Intel graphics and the Nvidia graphics card, you can use the Nvidia Prime tool. Open the Nvidia X Server Settings application, go to the PRIME Profiles tab, and select the desired graphics card.

How can I check the version of the installed Nvidia driver?

You can check the version of the installed Nvidia driver by running the command nvidia-smi in the terminal. The output will display the driver version along with other information about your Nvidia graphics card.

Can I use the Nvidia driver with multiple graphics cards?

Yes, the Nvidia driver supports multiple graphics cards. You can install multiple Nvidia graphics cards on your system and configure them using the Nvidia X Server Settings application.

How can I enable or disable the Nvidia driver on Ubuntu 18.04?

To enable or disable the Nvidia driver on Ubuntu 18.04, you can use the Additional Drivers tool. Open the "Software & Updates" application, go to the "Additional Drivers" tab, and select the desired driver (either the Nvidia driver or the Nouveau driver) from the list.

Leave a Comment

Your email address will not be published. Required fields are marked *